-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample_random_query.sh
More file actions
32 lines (30 loc) · 1.25 KB
/
sample_random_query.sh
File metadata and controls
32 lines (30 loc) · 1.25 KB
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
#!/bin/sh
snplist=${1}
sg=${2:-all}
output=${3}
case $sg in
all)
perl snp_to_edge.pl ./gene_sets/${snplist}.txt ./data/Polyphen/Polyphen_pair.txt|cut -f 1|sort -u >${snplist}.tmp1
perl snp_to_edge.pl ./gene_sets/${snplist}.txt ./data/GTEx_eQTL/AllTissue.GTEx_eQTL.txt|cut -f 1|sort -u >${snplist}.tmp2
all=$(cat ${snplist}.tmp1 ${snplist}.tmp2|sort -u|wc -l|awk '{print $1}')
c=$(wc -l ${snplist}.tmp1|awk '{print $1}')
nc=$( expr $all - $c )
shuf ./data/GTEx_eQTL/AllTissue.snp|head -n $nc >${output}
shuf ./data/Polyphen/Polyphen.nsSNP|head -n $c >>${output}
sleep 2
rm ${snplist}.tmp*
;;
Proximity)
;;
*)
perl snp_to_edge.pl ./gene_sets/${snplist}.txt ./data/Polyphen/Polyphen_pair.txt|cut -f 1|sort -u >${snplist}.tmp1
perl snp_to_edge.pl ./gene_sets/${snplist}.txt ./data/GTEx_eQTL/${sg}.GTEx_eQTL.txt|cut -f 1|sort -u >${snplist}.tmp2
all=$(cat ${snplist}.tmp1 ${snplist}.tmp2|sort -u|wc -l|awk '{print $1}')
c=$(wc -l ${snplist}.tmp1|awk '{print $1}')
nc=$( expr $all - $c )
shuf ./data/GTEx_eQTL/${sg}.snp|head -n $nc >${output}
shuf ./data/Polyphen/Polyphen.nsSNP|head -n $c >>${output}
sleep 2
rm ${snplist}.tmp*
;;
esac