This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BCFTools query regex or boolean expression

Hello,

I would like to extract only some columns from my vcf files like this:

bcftools query --format '%CHROM\t%POS\t%ID\t%REF\t%ALT\t%HF\n' {my_files}.vcf > {out}.txt

My problem is for some vcf outputs (different variant calling tools) I have column named HF for others AF, is it possible to use regex or boolean to extract that columns using only one command line?

bcftools

is it possible to use regex or boolean to extract that columns using only one command line?

no

so I have to launch the same command line twice changing the HF to AF, right?

you can print both tags with bcftools query --allow-undef-tags --format ...

this prints me only . and not AF or HF values

Example input and expected output would help others to understand the issue.

0 answers

No answers yet.

Log in to answer this question.