Question: how to capture vcf's INFO field with bcftools
0
gravatar for genya35
2.4 years ago by
genya3520
genya3520 wrote:

Hello,

I'm trying to print the content of a vcf file but having problem with capturing the 'INFO' column.

Here is the code.

my $cmd2 = `bcftools query $vcf_indexed -f '%CHROM\t%POS\t%REF\t%ALT\t%INFO/TAG[\t%SAMPLE=%AD]\n' --samples '$sample'`;print $cmd2;

I get "Error: no such tag defined in the VCF header: INFO/TAG"

Thanks

software error • 1.5k views
ADD COMMENTlink modified 2.4 years ago by Pierre Lindenbaum127k • written 2.4 years ago by genya3520
1
gravatar for Pierre Lindenbaum
2.4 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum127k wrote:

it only works if TAG is declared in the VCF header:

grep INFO your.vcf | grep TAG

##INFO=<ID=TAG,Number=...
ADD COMMENTlink modified 2.4 years ago • written 2.4 years ago by Pierre Lindenbaum127k

Thanks, sorry for a simple question but how do I redirect the output to a text file of my choice?

Sorry, i got it. my $cmd2 = bcftools query $vcf_indexed -f '%CHROM\t%POS\t%REF\t%ALT\t%INFO/ANN][\t%SAMPLE=%AD]\n' --samples '$sample' > $output_file;print $cmd2;

ADD REPLYlink modified 2.4 years ago • written 2.4 years ago by genya3520
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: 1775 users visited in the last hour