Skip to content

Commit 051c8f9

Browse files
committed
add to_parquet rule, env, doc
1 parent cae102d commit 051c8f9

20 files changed

Lines changed: 93 additions & 238 deletions

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ COPY workflow/envs/filtering.yaml /conda-envs/31fc19a9498faffb09aa18f9246db95e/e
8484

8585
# Conda environment:
8686
# source: workflow/envs/gwaspipe.yaml
87-
# prefix: /conda-envs/724b79486d0cc8b8ba5722413b3608b2
87+
# prefix: /conda-envs/b8ce59d968b60f65eb89656a355281b5
8888
# name: gwaspipe
8989
# channels:
9090
# - conda-forge
@@ -94,9 +94,9 @@ COPY workflow/envs/filtering.yaml /conda-envs/31fc19a9498faffb09aa18f9246db95e/e
9494
# - pip==24
9595
# - mscorefonts
9696
# - pip:
97-
# - git+https://github.com/ht-diva/gwaspipe.git@aee66f1
98-
RUN mkdir -p /conda-envs/724b79486d0cc8b8ba5722413b3608b2
99-
COPY workflow/envs/gwaspipe.yaml /conda-envs/724b79486d0cc8b8ba5722413b3608b2/environment.yaml
97+
# - git+https://github.com/ht-diva/gwaspipe.git@712944e
98+
RUN mkdir -p /conda-envs/b8ce59d968b60f65eb89656a355281b5
99+
COPY workflow/envs/gwaspipe.yaml /conda-envs/b8ce59d968b60f65eb89656a355281b5/environment.yaml
100100

101101
# Conda environment:
102102
# source: workflow/envs/liftover_bcftools.yaml
@@ -119,6 +119,6 @@ RUN mamba env create --prefix /conda-envs/6e056d31662ab0bd2fd3fba49416042f --fil
119119
mamba env create --prefix /conda-envs/20b7f0f77b859d9ac85875e0e8e2c471 --file /conda-envs/20b7f0f77b859d9ac85875e0e8e2c471/environment.yaml && \
120120
mamba env create --prefix /conda-envs/1952d8a40f9d550db08b42e8de561992 --file /conda-envs/1952d8a40f9d550db08b42e8de561992/environment.yaml && \
121121
mamba env create --prefix /conda-envs/31fc19a9498faffb09aa18f9246db95e --file /conda-envs/31fc19a9498faffb09aa18f9246db95e/environment.yaml && \
122-
mamba env create --prefix /conda-envs/724b79486d0cc8b8ba5722413b3608b2 --file /conda-envs/724b79486d0cc8b8ba5722413b3608b2/environment.yaml && \
122+
mamba env create --prefix /conda-envs/b8ce59d968b60f65eb89656a355281b5 --file /conda-envs/b8ce59d968b60f65eb89656a355281b5/environment.yaml && \
123123
mamba env create --prefix /conda-envs/bb7d3ca556579c4e816225676dfd5175 --file /conda-envs/bb7d3ca556579c4e816225676dfd5175/environment.yaml && \
124124
mamba clean --all -y

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ run:
2525
gwascatalog: False
2626
summarize: True
2727
delivery: False
28+
to_parquet: False
2829
```
2930
3031
* _harmonization_: If set to True, the harmonization rules will be executed.
3132
* _liftoverbcf_harmonization_: If set to False, the harmonization rules will not be executed after BCFtools liftover.
3233
* _gwascatalog_: If set to False, the summary statistics will not be downloaded by GWAS Catalog.
3334
* _summarize_: If set to True, the summarization rules will be executed.
3435
* _delivery_: If set to False, the delivery rules will not be executed.
36+
* _to_parquet_: If set to True, the harmonized summary statistics will be available in parquet format, along with .tsv.gz.
3537
3638
**Paths**
3739
@@ -167,6 +169,10 @@ Examples of configuration files for *BELIEVE*, *Decode*, *FinnGen*, *Genes & Hea
167169
*Purpose*: Creates a region-based index (CHR and POS columns) of GWAS harmonized data for fast queries.<br />
168170
*Output*: *{sumstat_id}.gwaslab.tsv.gz.tbi*: Index of GWAS harmonized data.<br />
169171

172+
* **to_parquet** (`to_parquet: True`): <br />
173+
*Purpose:* Convert harmonized summary statistics from *.tsv.gz* to *parquet* format.<br />
174+
*Output*: *{sumstat_id}.gwaslab.parquet*: Standardized and aligned GWAS summary statistics in *parquet* format.<br />
175+
170176
* **create_snp_mapping_table** (`harmonization: True`): <br />
171177
*Purpose:* Creates mapping table to match input data and harmonized summary statistics.<br />
172178
*Output*: *table.snp_mapping.tsv.gz*: Table that links input SNPID (and rsID when available) to harmonized SNPID. Note that in case `gwascatalog: True`, SNPID mapping is generated for each summary statistics.<br />

config/config.yaml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1-
# Rule execution flags
21
run:
3-
harmonization: False
4-
liftoverbcf_harmonization: False
5-
gwascatalog: True
2+
harmonization: True
63
summarize: True
74
delivery: True
8-
pre_filtering_and_harmonization: True
5+
to_parquet: True
96

107

118
# Paths
12-
sumstats_path: config/sumstats_from_gwascatalog.tsv
13-
sumstats_url: config/urls_gwascatalog_test.tsv
14-
sumstats_suffix: ".gwas.regenie.gz" # Suffix of input summary statistics files (check it in the sumstats_path list)
9+
sumstats_path: config/local.txt
10+
sumstats_suffix: ".gwas.regenie.gz" # Suffix of input summary statistics files (check in sumstats_path)c
11+
dest_path: "/project/cdh/interval/result"
12+
workspace_path: ../results
1513
sumstats_sep: "\t"
16-
dest_path: "../destination"
17-
workspace_path: "../results"
18-
hg37_fasta_file_path: '/group/diangelantonio/public_data/liftOver/human_g1k_v37.fasta'
19-
hg38_fasta_file_path: '/group/diangelantonio/public_data/liftOver/hg38.fa'
20-
chain_file_path: '/group/diangelantonio/public_data/liftOver/hg19ToHg38.over.chain.gz'
14+
2115

2216
# Common parameters
2317
input_format: &iformat "regenie" # Input format of summary
@@ -26,16 +20,9 @@ params:
2620
harmonize_sumstats:
2721
input_format: *iformat
2822
config_file: "config/config_harmonize_sumstats.yml"
29-
snp_mapping:
30-
input_format: *iformat
31-
config_file: "config/config_snp_mapping.yml"
3223
summarize_sumstats:
3324
input_format: "gwaslab"
3425
config_file: "config/config_summarize_sumstats.yml"
35-
to_vcf:
26+
snp_mapping:
3627
input_format: *iformat
37-
config_file: "config/config_to_vcf.yaml"
38-
harmonize_sumstats_pre_filtering:
39-
config_file: "config/config_harmonize_sumstats_pre_filtering.yml"
40-
harmonize_sumstats_post_filtering:
41-
config_file: "config/config_harmonize_sumstats_post_filtering.yml"
28+
config_file: "config/config_snp_mapping.yml"

config/config_harmonize_sumstats.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ steps:
2929
params:
3030
run: True
3131
gl_params:
32-
to_fill: ['MLOG10P', 'Z' ]
32+
to_fill: ['MLOG10P', 'Z', 'CHISQ', 'EAF']
3333
overwrite: False
3434
extreme: True
3535
harmonize: # see https://cloufield.github.io/gwaslab/Harmonization/
@@ -50,14 +50,15 @@ steps:
5050
workspace_subfolder: True
5151
gl_params:
5252
fmt: "gwaslab"
53+
xymt_number: True
5354
to_csvargs:
5455
compression:
5556
method: "gzip"
5657
compresslevel: 1
5758
mtime: 1
5859

5960

60-
# Filename transformation, e.g.: seq.3007.7.gwas.regenie.gz
61+
# Filename transformation, e.g.: seq.3007.7.liftover.vcf.gz
6162
filename_mask: [ True, True, True, False, False, False]
6263
filename_sep: '.'
6364

config/config_harmonize_sumstats_post_filtering.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

config/config_harmonize_sumstats_pre_filtering.yml

Lines changed: 0 additions & 67 deletions
This file was deleted.

config/config_snp_mapping.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ steps:
5050
gl_params:
5151
fmt: "snp_mapping"
5252

53-
# Filename transformation, e.g.: seq.3007.7.gwas.regenie.gz
53+
# Filename transformation, e.g.: seq.3007.7.liftover.vcf.gz
5454
filename_mask: [ True, True, True, False, False, False]
5555
filename_sep: '.'
5656

config/config_summarize_sumstats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ steps:
4747
sig_level: 5e-8
4848

4949

50-
# Filename transformation, e.g.: seq.3007.7.gwas.regenie.gz
50+
# Filename transformation, e.g.: seq.3007.7.gwaslab.tsv.gz
5151
filename_mask: [ True, True, True, False, False, False]
5252
filename_sep: '.'
5353

config/config_to_vcf.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

config/sumstats_from_gwascatalog.tsv

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)