-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_substats_prep.sh
26 lines (18 loc) · 995 Bytes
/
1_substats_prep.sh
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
#!/bin/bash
set -beEuo pipefail
index_file="../../cascade/cascade.input.files.tsv"
out_dir="@@@@@@/projects/biomarkers/meta/figshare_submission"
array_f="@@@@@@/projects/biomarkers_rivas/meta_flipfixed/METAANALYSIS_{{trait}}_1.tbl.gz"
imp_f="@@@@@@/projects/biomarkers/meta/plink_imputed/filtered/GLOBAL_{{trait}}.sumstats.tsv.gz"
cat ${index_file} | awk -v FS='\t' '(NR>1){print $2}' | while read trait ; do
echo ${trait}
zcat $(echo ${array_f} | sed -e "s/{{trait}}/${trait}/g" | sed -e "s/adjstatins/adjust_statins/g") \
| bgzip -l9 -@6 > ${out_dir}/${trait}.array.gz
singularity run -H /home/jobyan @@@@@@@@/users/ytanigaw/simg/jupyter_yt_20200428.sif \
Rscript imp_sumstats_format.R \
$(echo ${imp_f} | sed -e "s/{{trait}}/${trait}/g") \
${out_dir}/${trait}.imp
bgzip -f -l9 -@6 ${out_dir}/${trait}.imp
tabix -f -c '#' -s 1 -b 2 -e 2 ${out_dir}/${trait}.array.gz
tabix -f -c '#' -s 1 -b 2 -e 2 ${out_dir}/${trait}.imp.gz
done