This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge multiple vcf files while preserving FILTER information

Hello,

I have multiple vcf files from different samples. I would like to combine all of the in one file but I would like to preserve information from FILTER field. For example if I have a vcf record which passes the filter in one sample:

chr1    949654  .   A   G   571.55  PASS

and fails it another

chr1    949654  .   A   G   571.55  FAILED

I would like a record in vcf file to be something like that

chr1    949654  .   A   G   571.55  PASS;FAILED

I already tried vcf-merge from http://vcftools.sourceforge.net/ - it just seems to ignore records without the PASS tag and there doesn't seem to be any option to turn that off. I also think that GATK CombineVariants won't do the trick; there's an option to include filtered-out variants but without including all the information from tags.

variants vcf

1 answer

bcftools merge's -F should be useful here. https://samtools.github.io/bcftools/bcftools.html

I've seen that bcftools and vcftools together can address almost any need we may have with VCF files.

Unfortunately it doesn't preserve information on all filters - it can mark variant only as PASS or FAILED but not both, if ti passes a filter in one sample but not the other.

Hi, I was just curious if you had found a way to preserve all filter information in a resulting merged .vcf file?

Log in to answer this question.