How do I merge VCFs files containing CNVs?

I use vcf-merge, a VCFtools function, and after bgzip and tabix, SAMtools, to index and tab separate variants, but I don't know if it is the right way.

  • $\begingroup$ Can you post an example line from the VCF? If the CNV is formatted like a SNP, just with insertion/deletion alleles, I see no reason why there should be any problem. Then again, you can always just extract a line from the merged file and see if it looks as expected. $\endgroup$
    – juod
    Sep 8, 2017 at 7:33

2 Answers 2


vcf-merge (or better: bcftools merge) does a column-based merge of VCF files, basically taking on an additional genotype column to each variant. While this sort-of works, it doesn't take into account all the information about variation. There might be low coverage at a region in one VCF file that indicates a deletion, but the deletion is only observable when considering other samples with high coverage at that same region. It's also possible that INDELs could be defined differently in different samples, requiring an additional bcftools norm step for left-normalisation prior to the merge.

Assuming this column-based merge is what you want (and if not, then bcftools concat is your friend for row-based merging), then it's better to regenerate the merged VCF file as a multi-column file directly. One way of doing this is feeding all BAM files into samtools mpileup to generate genotype likelihoods, then feeding the result of that into bcftools call. Something like the following:

samtools mpileup -uf ref.fa in1.bam in2.bam in3.bam | \
  bcftools call -mv -O z -o variants_ref_1-3.vcf.gz

depending on your goals you could possibly use tools like https://github.com/mkirsche/Jasmine or simple bedtools intersect on the vcf entries could help (e.g. harmonize after the calling)

or if you have a cohort maybe possibly doing joint-CNV calling or "genotyping CNV" in a cohort is useful http://penncnv.openbioinformatics.org/en/latest/user-guide/joint/ or https://github.com/abyzovlab/CNVpytor#merging-calls-form-multiple-samples


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.