-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgtex-fusion.sge
29 lines (28 loc) · 1.11 KB
/
gtex-fusion.sge
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
#!/bin/bash
# 12-7-2017 MRC-Epid JHZ
Rscript=/genetics/bin/Rscript.sh
sumstats=/genetics/bin/FUSION/tests/PGC2.SCZ.sumstats
mkdir $sumstats.tmp
cd $sumstats.tmp
ln -sf /genetics/bin/FUSION/tests/glist-hg19
for GTEx in $(/bin/cat /genetics/bin/FUSION/GTEx.list);do
for chr in $(seq 22); do
echo -e "#!/bin/bash\n\
$Rscript /genetics/bin/fusion_twas/FUSION.assoc_test.R \
--sumstats $sumstats \
--weights /genetics/bin/FUSION/GTEx/$GTEx.pos \
--weights_dir /genetics/bin/FUSION/GTEx \
--ref_ld_chr /genetics/bin/FUSION/LDREF/1000G.EUR. \
--chr ${chr} \
--out $sumstats.tmp/${GTEx}_${chr}.dat;\
N=`/bin/awk 'END{print FNR-1}' $sumstats.tmp/${GTEx}_${chr}.dat`;\
/bin/cat $sumstats.tmp/${GTEx}_${chr}.dat|\
/bin/awk -vN=$N -f /genetics/bin/TWAS-pipeline/gtex-fusion.awk > $sumstats.tmp/${GTEx}_${chr}.top;\
$Rscript /genetics/bin/fusion_twas/FUSION.post_process.R \
--sumstats $sumstats \
--input $sumstats.tmp/${GTEx}_${chr}.top \
--out $sumstats.tmp/${GTEx}_${chr}.top.analysis \
--ref_ld_chr /genetics/bin/FUSION/LDREF/1000G.EUR. --chr ${chr} --plot --locus_win 100000" > sge.sh
sge "sge.sh"
done
done