-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_quickstat
executable file
·40 lines (34 loc) · 2.02 KB
/
run_quickstat
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
#!/bin/bash
DEFVCFDIR=data/variant_calling
DEFTYPE=snv
VCFDIR=${VCFDIR:-$DEFVCFDIR}
TYPE=${TYPE:-$DEFTYPE}
for TYPE in snv indel
do
for exp in wgs wxs
do
echo "---------------------------------------------------------------------------"
echo "Total donors with $exp $TYPE data: " $( grep ${exp} ${VCFDIR}/union*.${TYPE}.all | awk '{print $2}'|sort -u|wc -l )
declare -A private gnomad
for caller in sanger mutect2 sanger,mutect2
do
private[$caller]=$( grep $exp ${VCFDIR}/union.${TYPE}.all | awk -v awkvar="$caller" '$9==awkvar'|wc -l)
gnomad[$caller]=$( grep $exp ${VCFDIR}/union.${TYPE}.all | awk '$11!="."'|awk -v awkvar="$caller" '$9==awkvar'|wc -l)
done
total=$( cat ${VCFDIR}/union.${TYPE}.all | grep -c ${exp} )
gnomad_all=$( grep $exp ${VCFDIR}/union.${TYPE}.all | awk '$11!="."'| wc -l)
echo -e "Total\t${private[sanger]} / ${gnomad[sanger]}\t${private[mutect2]} / ${gnomad[mutect2]}\t${private[sanger,mutect2]} / ${gnomad[sanger,mutect2]}\t$total\t$gnomad_all"
for region in cds exon utr3 utr5 protein_coding_promoter protein_coding_splice_site lncRNA_promoter lncRNA lncRNA_splice_site smallRNA smallRNA_promoter open_access
do
declare -A private gnomad
for caller in sanger mutect2 sanger,mutect2
do
private[$caller]=$( grep $exp ${VCFDIR}/union_${region}.${TYPE}.all | awk -v awkvar="$caller" '$9==awkvar'|wc -l)
gnomad[$caller]=$( grep $exp ${VCFDIR}/union_${region}.${TYPE}.all | awk '$11!="."'|awk -v awkvar="$caller" '$9==awkvar'|wc -l)
done
total=$( cat ${VCFDIR}/union_${region}.${TYPE}.all | grep -c ${exp} )
gnomad_all=$( grep $exp ${VCFDIR}/union_${region}.${TYPE}.all | awk '$11!="."'| wc -l)
echo -e "$region\t${private[sanger]} / ${gnomad[sanger]}\t${private[mutect2]} / ${gnomad[mutect2]}\t${private[sanger,mutect2]} / ${gnomad[sanger,mutect2]}\t$total\t$gnomad_all"
done
done
done