-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.subs
36 lines (28 loc) · 1022 Bytes
/
test.subs
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
#!/bin/bash
# 23-2-2017 MRC-Epid JHZ
chr=$1
trait=$2
rt=$3
rt2=$4
awk=/bin/awk
join=/usr/bin/join
python=/usr/local/Cluster-Apps/python/2.7.5/bin/python
gunzip=/bin/gunzip
sort=/bin/sort
# double the effort but easier for GNU parallel
cd $rt2/QUS
$gunzip -c $rt/refpanel/1kg_phase3_chr${chr}_eur_5pct_legend.txt.gz | \
$awk '{print chr,$1,sprintf("%00000000015d",$2),$2,$3,$4}' chr=$chr | $sort -k3 > $chr
# Step 0 - GWAS summary statistics
echo $trait-$chr
$awk 'NR>1' ${trait}.${chr}.txt | \
$awk '{$2=sprintf("%00000000015d",$2);print}' | $sort -k2 > $trait-$chr
$join -13 -22 $chr $trait-$chr | $awk -f $rt2/test.awk > ${trait}-${chr}.dat
# Step 1 - compute eigenvalues and projections
$python $rt/hess.py \
--chrom $chr \
--h2g $trait-$chr.dat \
--reference-panel $rt/refpanel/1kg_phase3_chr${chr}_eur_5pct_gen.txt.gz \
--legend-file $rt/refpanel/1kg_phase3_chr${chr}_eur_5pct_legend.txt.gz \
--partition-file $rt/nygcresearch-ldetect-data-ac125e47bf7f/EUR/fourier_ls-chr${chr}.bed \
--out $trait