I've been trying bcftools
bcftools view -s Sample1
: Creates splits out Sample1.
bcftools reheader -s Sample1
: Creates a new VCF with only Sample1, and the header, but includes all of the fields.
bcftools query -f '%CHROM\t%POS\t%REF\t%ALT\t%GT\n'
: Creates a table with just the fields I want, but it drops the header.
bcftools view -s Sample1 20201229_PS-19-000796A8.vcf -f '%CHROM\t%POS\t%REF\t%ALT\t%GT\n'
: This should work, but surprisingly keeps all of the fields despite the format request. EDIT: I gues the -f
flag with view is for filtering not formatting.
The command that would do what I want would theoretically be bcftools reheader -s Sample1 --f '%CHROM\t%POS\t%REF\t%ALT\t%GT\n'
But this is not a valid command and throws an error. The -f
switch with reheader
serves another purpose.
The header was kept on my machine.
Sorry. You are correct, and I edited the question.
the output of bcftools query is not VCF
Yes. I get that. But I WANT a VCF. There is a
-H, --print-header
, but it does not actually print the header.