Skip to content

bcftools query; sample names missing in header line #1992

@WimSpee

Description

@WimSpee

Dear bcftools developers,

With older versions of bcftools query , sample names were used in the header line.
This makes it clear which sample the genotype attribute belongs to.

bcftools 1.9
bcftools query -H  -f '%CHROM\t%POS\t%REF\t%ALT[\t%GT]\n' input.vcf.gz | head
[1]CHROM [2]POS [3]REF [4]ALT [5]SAMPLE_1:GT [6]SAMPLE_2:GT
chr02 125 T C 0/0 1/1
chr02 126 C A 0/0 1/1

With recent versions of bcftools, including v1.18, the sample names are not used anymore in the header line.

bcftools 1.18
bcftools query -H  -f '%CHROM\t%POS\t%REF\t%ALT[\t%GT]\n' input.vcf.gz | head
[1]CHROM [2]POS [3]REF [4]ALT [5]GT [6]GT
chr02 125 T C 0/0 1/1
chr02 126 C A 0/0 1/1

It would be nice if the person receiving the output file of bcftools query can know which sample is which column.
Without having to go back to the input vcf, and without an extra step to add back the sample names.

Is it possible to (at least optionally) add the the sample names back again in the header line of the bcftools query output?

I know %SAMPLE can be used in the table, but that more than doubles the size of the ouptut file.
And sample meta data makes sense for me to be present once in the column header, not repetitive in all the records.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions