MIN and MAX read depth for vcfutils.pl
1
I am trying to filter vcf files for Whole Exome Sequencing and I want to know what value is the minimum and maximum depth and how can I calculate.
next-gen
alignment
sequencing
• 2.2k views
using bioalcidae:
java -jar dist/bioalcidae.jar -e 'var m=null,M=null;while(iter.hasNext()) {var ctx=iter.next();if(!ctx.hasAttribute("DP")) continue; var dp= ctx.getAttributeAsInt("DP",-1);if(m==null || m> dp) m=dp; if(M==null||M<dp) M=dp;} out.println("min "+m+" max "+M);' input.vcf.gz
using std linux:
$ gunzip -c input.vcf.gz | grep -v "#" | cut -f 8 | tr ";" "\n" | grep 'DP=' | cut -c 4- | sort -n | tail -1
$ gunzip -c input.vcf.gz | grep -v "#" | cut -f 8 | tr ";" "\n" | grep 'DP=' | cut -c 4- | sort -n | head -n 1
or even:
$ gunzip -c input.vcf.gz | grep -v "#" | cut -f 8 | tr ";" "\n" | grep 'DP=' | cut -c 4- | sort -n | tee >(head -n 1) >(tail -1) > /dev/null
Login before adding your answer.
Traffic: 3262 users visited in the last hour