Hello,
    I'd like to avoid writing my own parser, using stock 'bcftools query'
for its intended purpose instead.

I need to extract the DP4 field, and the command I'm issuing is not
including it:

First I check that DP4 is actually present in my vcf:

 grep "<X" results.vcf | head -2
1 10397540  . T <X>     0  .
 
DP=15;I16=11,4,0,0,535,19161,0,0,300,6000,0,0,238,4626,0,0;QS=1,0;MQSB=1;MQ0F=0;DPR=15,0
       PL:DP4:DPR      0,45,146:11,4,0,0:15,0
1 10397541  . G <X>     0  .
 
DP=15;I16=11,4,0,0,514,17700,0,0,300,6000,0,0,235,4541,0,0;QS=1,0;MQSB=1;MQ0F=0;DPR=15,0
       PL:DP4:DPR      0,45,146:11,4,0,0:15,0



Then I try bcftools query:
$bcftools_htslib_path/bcftools query
-f'%CHROM\t%POS\t%REF\t%ALT\t%DPR\t%DP4\n' results.vcf | head
1 10397540  T <X>       15,0    .
1 10397541  G <X>       15,0    .
1 10397542  C <X>       15,0    .
1 10397543  A <X>       15,0    .
1 10397544  G <X>       15,0    .
1 10397545  G <X>       15,0    .
1 10397546  C <X>       15,0    .
1 10397547  C <X>       16,0    .
1 10397548  A <X>       17,0    .
1 10397549  G <X>       17,0    .


Is there a way to adjust my command, or is this a bug?

Best,
Jonathan
------------------------------------------------------------------------------
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to