MIN and MAX read depth for vcfutils.pl
1
0
Entering edit mode
7.1 years ago

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.1k views
ADD COMMENT
1
Entering edit mode
7.1 years ago

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
ADD COMMENT

Login before adding your answer.

Traffic: 2523 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6