-
Notifications
You must be signed in to change notification settings - Fork 3
/
analysis_plan.Rmd
192 lines (128 loc) · 4.74 KB
/
analysis_plan.Rmd
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
title: "predixcan_analysis"
author: "Hae Kyung Im"
date: "2020-06-03"
output: workflowr::wflow_html
editor_options:
chunk_output_type: console
---
# Transcriptome-wide association methods
```{r testing}
print(getwd())
```
```{bash setup}
cd ~
source .bashrc
```
## predict expression
```{bash predict genetic component of expression,eval=FALSE}
export DATA=$PRE/s-predixcan/data
export MODEL=$PRE/models
export METAXCAN=$PRE/MetaXcan-master/software
export OUTPUT=$PRE/results
<!-- export METAXCAN=/Users/haekyungim/Desktop/local-analysis/QGT-Columbia-HKI/MetaXcan-master/software -->
<!-- export DATA=/Users/haekyungim/Desktop/local-analysis/QGT-Columbia-HKI/predixcan/data -->
<!-- export RESULTS=/Users/haekyungim/Desktop/local-analysis/QGT-Columbia-HKI/predixcan/results -->
<!-- mkdir $RESULTS -->
printf "Predict expression\n\n"
python3 $METAXCAN/Predict.py \
--model_db_path $DATA/models/gtex_v8_en/en_Whole_Blood.db \
--vcf_genotypes $DATA/1000G_hg38/ALL.chr22.shapeit2_integrated_snvindels_v2a_27022019.GRCh38.phased.vcf.gz \
--vcf_mode genotyped \
--variant_mapping $DATA/gtex_v8_eur_filtered_maf0.01_monoallelic_variants.txt.gz id rsid \
--on_the_fly_mapping METADATA "chr{}_{}_{}_{}_b38" \
--prediction_output $RESULTS/vcf_1000G_hg38_en/Whole_Blood__predict.txt \
--prediction_summary_output $RESULTS/vcf_1000G_hg38_en/Whole_Blood__summary.txt \
--verbosity 9 \
--throw
printf "association\n\n"
python3 $METAXCAN/PrediXcanAssociation.py \
--expression_file $RESULTS/vcf_1000G_hg38_en/Whole_Blood__predict.txt \
--input_phenos_file $DATA/1000G_hg38/random_pheno_1000G_hg38.txt \
--input_phenos_column pheno \
--output $RESULTS/vcf_1000G_hg38_en/Whole_Blood__association.txt \
--verbosity 9 \
--throw
```
# Summary PrediXcan
## download harmonized and imputed GWAS result for coronary artery disease
```{r}
```
```{bash, eval=TRUE}
export PRE=/Users/haekyungim/Box/LargeFiles/QGT-Columbia-HKI
export DATA=$PRE/s-predixcan/data
export MODEL=$PRE/models
export METAXCAN=$PRE/MetaXcan-master/software
export OUTPUT=$PRE/results
echo $PRE
echo $DATA
echo $MODEL
echo $METAXCAN
echo $OUTPUT
```
## run s-predixcan
```{bash, eval=FALSE}
export PRE=/Users/haekyungim/Box/LargeFiles/QGT-Columbia-HKI
export DATA=$PRE/s-predixcan/data
export MODEL=$PRE/models
export METAXCAN=$PRE/MetaXcan-master/software
export OUTPUT=$PRE/results
python $METAXCAN/SPrediXcan.py \
--gwas_file $DATA/imputed_CARDIoGRAM_C4D_CAD_ADDITIVE.txt.gz \
--snp_column panel_variant_id --effect_allele_column effect_allele --non_effect_allele_column non_effect_allele --zscore_column zscore \
--model_db_path $MODEL/gtex_v8_mashr/mashr_Whole_Blood.db \
--covariance $MODEL/gtex_v8_mashr/mashr_Whole_Blood.txt.gz \
--keep_non_rsid --additional_output --model_db_snp_key varID \
--throw \
--output_file $OUTPUT/spredixcan/eqtl/CARDIoGRAM_C4D_CAD_ADDITIVE__PM__Whole_Blood.csv
```
## plot and interpret s-predixcan results
```{r}
```
## run multixcan (optional)
```{bash, eval=FALSE}
python $METAXCAN/SMulTiXcan.py \
--models_folder $DATA/models/eqtl/mashr \
--models_name_pattern "mashr_(.*).db" \
--snp_covariance $DATA/models/gtex_v8_expression_mashr_snp_covariance.txt.gz \
--metaxcan_folder $OUTPUT/spredixcan/eqtl/ \
--metaxcan_filter "CARDIoGRAM_C4D_CAD_ADDITIVE__PM__(.*).csv" \
--metaxcan_file_name_parse_pattern "(.*)__PM__(.*).csv" \
--gwas_file $OUTPUT/processed_summary_imputation/imputed_CARDIoGRAM_C4D_CAD_ADDITIVE.txt.gz \
--snp_column panel_variant_id --effect_allele_column effect_allele --non_effect_allele_column non_effect_allele --zscore_column zscore --keep_non_rsid --model_db_snp_key varID \
--cutoff_condition_number 30 \
--verbosity 7 \
--throw \
--output $OUTPUT/smultixcan/eqtl/CARDIoGRAM_C4D_CAD_ADDITIVE_smultixcan.txt
```
# Colocalization methods
## fine-map GWAS results -
We will run torus due to time limitation
```{bash, eval=FALSE}
#torus -d Height.torus.zval.gz --load_zval -dump_pip Height.gwas.pip
#gzip Height.gwas.pip
torus -d /Users/haekyungim/Box/LargeFiles/QGT-Columbia-HKI/fastenloc/data/Height.torus.zval.gz --load_zval -dump_pip /Users/haekyungim/Box/LargeFiles/QGT-Columbia-HKI/fastenloc/data/Height.gwas.pip
gzip Height.gwas.pip
```
## estimate priors
is this done internally by fastENLOC?
```{r}
```
## calculate colocalization with fastENLOC
```{bash, eval=FALSE}
## tutorial https://github.com/xqwen/fastenloc/tree/master/tutorial
export EQTLGZ=eqtl_annotation_gzipped
export GWASGZ=gwas_data_gzipped
export TISSUE=Whole_Blood
fastenloc -eqtl EQTLGZ -gwas GWASGZ -t tissue_name #[-total_variants total_snp] [-thread n] [-prefix prefix_name] [-s shrinkage]
```
## analyze results compare with s-predixcan results
```{r}
```
# Mendelian randomization methods
## run SMR (optional)
```{bash, eval=FALSE}
```
## run TWMR (for a locus)
```{bash, eval=FALSE}
```