This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging 2 VCF files using bcftools, however how should I update the fields according to 2 VCF files

I used bcftools merge to merge 2 VCF files, however, when I see the merged VCF file, I don't see the updated fields. Suppose if I am running 2 samples in 1 VCF file which are different and 2 samples in another VCF files. I combined them but I am not getting the updated FORMAT, INFO fields of VCF file. In that case NS should show as 4 and other fields like DP, RO,AO should be recalculated. How to handle this?

bcftools merge vcf1.gz vcf2.gz > output.vcf I tried to merge it but how would I get the updated fields.

variant-calling vcf bcftools

1 answer

see option --info-rules for bcftools merge

Rules for merging INFO fields (scalars or vectors) or - to disable the default rules. METHOD is one of sum, avg, min, max, join. Default is DP:sum,DP4:sum if these fields exist in the input files. Fields with no specified rule will take the value from the first input file. The merged QUAL value is currently set to the maximum. This behaviour is not user controllable at the moment.

Log in to answer this question.