This is a test version of Biostars. For the public version, visit https://www.biostars.org.
update FMT/GT in VCF file using bcftools annotate

Hi - I am trying to use bcftools to overwrite the existing FMT/GT values in a VCF file, matching by the ID column, in addition to CHROM and POS.

I tried creating a .txt.gz file as an annotation file, but got a message that to update the FMT/GT values, I must use a VCF as my annotation file. I have done this, and then I am using:

bcftools1.18 annotate -a annotest.vcf.gz -c ~ID,FMT/GT -O z -o new.vcf.gz original.vcf.gz

When I do this, I get a note that says:

"todo: -c ~ID with -a VCF?"

Does this means that bcftools does not allow me to update FMT/GT using the ID column?

Thanks in advance!

bcftools annotate vcf

1 answer

the message is here

https://github.com/samtools/bcftools/blob/develop/vcfannotate.c#L2236

where tgts_is_vcf is set here https://github.com/samtools/bcftools/blob/develop/vcfannotate.c#L3512 when the annotation format is a VCF

   if ( type.format==vcf || type.format==bcf )
        {
            args->tgts_is_vcf = 1;

so the syntax using '~ID' only works with tabix indexed files, not VCF

Log in to answer this question.