-
Notifications
You must be signed in to change notification settings - Fork 3
/
Snakefile
66 lines (52 loc) · 1.82 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from snakemake.remote.GS import RemoteProvider as GSRemoteProvider
from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
import pandas as pd
HTTP = HTTPRemoteProvider()
GS = GSRemoteProvider()
configfile: "config.yaml"
envvars:
"UKB_APP_ID",
"GCS_BUCKET",
"GCP_PROJECT",
"GKE_IO_NCPU",
"GKE_IO_MEM_MB"
bucket = os.environ['GCS_BUCKET']
ukb_app_id = os.environ['UKB_APP_ID']
gcp_project = os.environ['GCP_PROJECT']
gke_io_ncpu = int(os.environ['GKE_IO_NCPU'])
gke_io_mem_mb = int(os.environ['GKE_IO_MEM_MB'])
gke_io_mem_req_mb = int(.85 * gke_io_mem_mb)
def bucket_path(path, add_protocol=False):
path = bucket + '/' + path
if add_protocol:
path = 'gs://' + path
return path
def to_df(contigs):
return pd.DataFrame(contigs).astype(str).set_index('name', drop=False)
plink_contigs = to_df(config['raw']['plink']['contigs'])
bgen_contigs = to_df(config['raw']['bgen']['contigs'])
rule all:
input:
expand(
"prep/gt-imputation/ukb_chr{bgen_contig}.ckpt",
bgen_contig=bgen_contigs['name']
),
"prep/main/ukb.ckpt",
"prep/main/meta/data_dictionary_showcase.csv",
"prep/main/ukb_sample_qc.csv",
"prep/main/ukb_sample_qc.ckpt",
expand(
"pipe/nealelab-gwas-uni-ancestry-v3/output/gt-imputation/ukb_chr{bgen_contig}.ckpt",
bgen_contig=bgen_contigs['name']
),
"prep/main/ukb_phesant_phenotypes-subset01.csv",
"pipe/nealelab-gwas-uni-ancestry-v3/output/sumstats.parquet"
include: "rules/zarr_integration.smk"
include: "rules/primary_integration.smk"
include: "rules/sumstat_integration.smk"
include: "rules/phenotype_integration.smk"
include: "rules/gwas_pipeline.smk"
onsuccess:
print("Workflow finished successfully")
onerror:
print("Workflow failed")