This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools merge doesn't recalculate AF

Hey everyone,

I am trying to combine two VCFs I created with a GATK pipeline (https://github.com/snakemake-workflows/dna-seq-gatk-variant-calling). I used bcftools merge (with and without -g genome.fasta with identical results). The resulting genotypes are correct, but it seems like bcftools merge does not recalculate allele frequency. Is there a better too for combining or cann I just recalculate the AF later? Here are exemplary results of a merge:

                                sample1  sample2
VCF1:    C,CAA   AF=0.023,0.031   0/2
VCF2:    CAA,C   AF=0.279,0.074            0/1
merged:  C,CAA   AF=0.074,0.279   0/2      0/2

It looks like the AF was just taken from the second VCF. Any ideas how to get the correct AF?

I also tried gatk CombineGVCFs, but this tells me The list of input alleles must contain <NON_REF> as an allele but that is not the case at position 98999; please use the Haplotype Caller with gVCF output to generate appropriate records. However, the VCFs were generated with HaplotypeCaller.

Thanks :)

bcftools

1 answer

to recalculate the allele frequency you can use bcftools +fill-tags <your merged VCF>

Or pipe merge into fill-tags

Log in to answer this question.