-
Notifications
You must be signed in to change notification settings - Fork 0
/
blairExtract.sh
40 lines (34 loc) · 1.53 KB
/
blairExtract.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Mendelian diseases from Blair et al.
mendDis=$(wc -l ../data/blair/* | awk '/m/&&$1!=0{print $2}')
commDis=$(wc -l ../data/blair/* | awk '/c/&&$1!=0{print $2}')
{ echo "$mendDis" | xargs -I{} basename {} | tr '\n' '\t' | sed 's/\t$/\n/'
for x in $mendDis; do
basename $x | tr '\n' '\t'
for y in $mendDis; do
awk 'NR==FNR{pat[$1]=1;next} ($1 in pat)' $x $y | wc -l | tr '\n' '\t'
done | sed 's/\t$/\n/'
done; } > ../data/blairMendMend.dat
{ echo "$commDis" | xargs -I{} basename {} | tr '\n' '\t' | sed 's/\t$/\n/'
for x in $mendDis; do
basename $x | tr '\n' '\t'
for y in $commDis; do
awk 'NR==FNR{pat[$1]=1;next} ($1 in pat)' $x $y | wc -l | tr '\n' '\t'
done | sed 's/\t$/\n/'
done; } > ../data/blairMendComm.dat
#Rare diseases from our study
mendDis=$(ls ../data/pats/*)
commDis=$(wc -l ../data/blair/* | awk '/c/&&$1!=0{print $2}')
{ echo "$mendDis" | xargs -I{} basename {} | tr '\n' '\t' | sed 's/\t$/\n/'
for x in $mendDis; do
basename $x | tr '\n' '\t'
for y in $mendDis; do
awk 'NR==FNR{pat[$1]=1;next} ($1 in pat)' $x $y | wc -l | tr '\n' '\t'
done | sed 's/\t$/\n/'
done; } > ../data/blairMendMend_our.dat
{ echo "$commDis" | xargs -I{} basename {} | tr '\n' '\t' | sed 's/\t$/\n/'
for x in $mendDis; do
basename $x | tr '\n' '\t'
for y in $commDis; do
awk 'NR==FNR{pat[$1]=1;next} ($1 in pat)' $x $y | wc -l | tr '\n' '\t'
done | sed 's/\t$/\n/'
done; } > ../data/blairMendComm_our.dat