Question: Fill in missing VCF information with bcftools or vcftools or Vcf.pm
1
gravatar for Lee Katz
4.5 years ago by
Lee Katz2.9k
Atlanta, GA
Lee Katz2.9k wrote:

Hi Biostars, I was wondering how I might backfill some information into the VCF format. Here are the first three lines of a VCF pooled file I created with bcftools merge.

#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Sample1 2:Sample1 3:Sample1 4:Sample1 5:Sample1 6:Sample1 7:Sample
NC001416 1 . G . 0 PASS ADP=3;WT=0;HET=0;HOM=0;NC=1 GT:GQ:SDP:DP:RD:AD:RBQ:ABQ:RDF:RDR:ADF:ADR ./.:.:3:.:.:.:.:.:.:.:.:
NC001416 2 . G . 0 PASS ADP=3;WT=0;HET=0;HOM=0;NC=1 GT:GQ:SDP:DP:RD:AD:RBQ:ABQ:RDF:RDR:ADF:ADR ./.:.:3:.:.:.:.:.:.:.:.:
NC001416 3 . G . 0 PASS ADP=6;WT=0;HET=0;HOM=0;NC=1 GT:GQ:SDP:DP:RD:AD:RBQ:ABQ:RDF:RDR:ADF:ADR ./.:.:6:.:.:.:.:.:.:.:.:

One thing I would want to backfill is the DP attribute for each sample.  Would I use bcftools annotate?  How?  Is there an example or tutorial out there I could follow?  I have all the original bam files, so I can supply that information to a given script.

ADD COMMENTlink modified 16 months ago by Biostar ♦♦ 20 • written 4.5 years ago by Lee Katz2.9k

Have you tried the Squaring off utility of bcbio.variation.recall

ADD REPLYlink modified 4.5 years ago • written 4.5 years ago by komal.rathi3.4k

I think that bcbio.variation.recall does the same thing that bcftools merge does.  Right?  I am not sure if I can use it to backfill information such as DP (depth).

ADD REPLYlink written 4.5 years ago by Lee Katz2.9k
0
gravatar for Lee Katz
4.5 years ago by
Lee Katz2.9k
Atlanta, GA
Lee Katz2.9k wrote:

This seems like at least a partial answer that I've worked out, using Vcf.pm.  I set the depth to 5x on every line in this example.

perl -MVcf -MData::Dumper -e '$vcf=Vcf->new(file=>"sample2.fastq.gz-lambda_virus.vcf.gz"); $vcf->parse_header();while(my $x=$vcf->next_data_hash()){$$x{gtypes}{Sample1}{DP}=5; print $vcf->format_line($x);}'| head
ADD COMMENTlink written 4.5 years ago by Lee Katz2.9k
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: 1516 users visited in the last hour