BCFTools query regex or boolean expression
0
0
Entering edit mode
3.8 years ago
User000 ▴ 710

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 • 1.1k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

no

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

this prints me only . and not AF or HF values

ADD REPLY

Login before adding your answer.

Traffic: 1719 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6