Question: filtering and statistics of depth per genotype per SNP of VCF files (solved)
0
gravatar for Hanan
5.4 years ago by
Hanan70
Tel Aviv University
Hanan70 wrote:

Hello

I need to get the statistics of VCF file. I would like to see the distribution of read depth for each sample at  each SNP.

I would like also to filter by this depth, sey, set the data point to NULL when the value is below a threshold.

Thank you

Hanan

snp next-gen • 3.3k views
ADD COMMENTlink modified 5.4 years ago • written 5.4 years ago by Hanan70

Thank you for your response

I have used Bioconductor - VariantAnnotation R package so I can easily manipulate the statistics.

read vcf file with obj<-readVcf( ) and look at the obj@assays$data@listData[["DP"] matrix.

Hanan

ADD REPLYlink modified 7 months ago by RamRS27k • written 5.4 years ago by Hanan70
0
gravatar for Pierre Lindenbaum
5.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum128k wrote:

if your VCF contains the DEPTH (DP) information in the FORMAT section. use awk to get the index of this DP-column and extract the DP for each sample:

 

$ curl -sL "https://raw.githubusercontent.com/chmille4/ngs_server/89f038f986747390d190baf09efa93a8897c0ec6/ext/vcftools/examples/valid-4.1.vcf" |\
awk -F '     ' '/^#CHROM/ {split($0,samples);next;} /^#/ {next;} {dpcol=-1;n=split($9,fmt,/\:/);for(i=1;i<=n;++i) if(fmt[i]=="DP") { dpcol=i;break;} if(dpcol==-1) next; for(i=10;i<=NF;++i) {split($i,a,/\:/);printf("%s\t%s\t%s\t%s\n",$1,$2,samples[i],a[dpcol]);}}'
19    14370    NA00001    1
19    14370    NA00002    8
19    14370    NA00003    5
20    17330    NA00001    3
20    17330    NA00002    5
20    17330    NA00003    3
20    1110696    NA00001    6
20    1110696    NA00002    0
20    1110696    NA00003    4
20    1230237    NA00001    7

(...)

 

 

 

ADD COMMENTlink written 5.4 years ago by Pierre Lindenbaum128k

Thank you,  where do i put my  local file name

ADD REPLYlink written 5.4 years ago by Hanan70
0
gravatar for jesse.hoff
5.4 years ago by
jesse.hoff0
United States
jesse.hoff0 wrote:

You can use vcftools

ADD COMMENTlink modified 7 months ago by RamRS27k • written 5.4 years ago by jesse.hoff0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1662 users visited in the last hour