<p>depending on your goals you could possibly use tools like <a href="https://github.com/mkirsche/Jasmine" rel="nofollow noreferrer">https://github.com/mkirsche/Jasmine</a> or simple bedtools intersect on the vcf entries could help (e.g. harmonize after the calling)</p>
<p>or if you have a cohort maybe possibly doing joint-CNV calling or &quot;genotyping CNV&quot; in a cohort is useful <a href="http://penncnv.openbioinformatics.org/en/latest/user-guide/joint/" rel="nofollow noreferrer">http://penncnv.openbioinformatics.org/en/latest/user-guide/joint/</a> or <a href="https://github.com/abyzovlab/CNVpytor#merging-calls-form-multiple-samples" rel="nofollow noreferrer">https://github.com/abyzovlab/CNVpytor#merging-calls-form-multiple-samples</a></p>

CC BY-SA 4.0
2021-12-07T11:19:46.247Z
2021-12-07T11:29:35.060Z
2021-12-07T11:29:35.060Z
Colin D
<p><code>vcf-merge</code> (or better: <code>bcftools merge</code>) 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 <code>bcftools norm</code> step for left-normalisation prior to the merge.</p>

<p>Assuming this column-based merge is what you want (and if not, then <code>bcftools concat</code> 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 <em>all</em> BAM files into <code>samtools mpileup</code> to generate genotype likelihoods, then feeding the result of that into <code>bcftools call</code>. Something like the following:</p>

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

CC BY-SA 3.0
2017-12-29T10:20:37.313Z
2017-12-29T10:20:37.313Z
gringer
<p>How do I merge VCFs files containing CNVs?</p>

<p>I use <a href="https://vcftools.github.io/perl_module.html#vcf-merge" rel="nofollow noreferrer">vcf-merge</a>, a VCFtools function, and after bgzip and <a href="http://www.htslib.org/doc/tabix.html" rel="nofollow noreferrer">tabix</a>, SAMtools, to index and tab separate variants, but I don't know if it is the right way.</p>

CC BY-SA 3.0
2017-09-08T07:33:10.433Z
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.
juod
<vcf><cnv>
VCF merge containing CNV
# VCF merge containing CNV

(Asked by: username_0 on 2017-09-07)

How do I merge VCFs files containing CNVs?

I use [vcf-merge](https://vcftools.github.io/perl_module.html#vcf-merge), a VCFtools function, and after bgzip and [tabix](http://www.htslib.org/doc/tabix.html), SAMtools, to index and tab separate variants, but I don't know if it is the right way.

**Tags:** vcf, cnv
> **Comments:**
> **username_1**: 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.  

---

## 2 answers

### Answer by username_3 on 2017-12-29. Score: 2 | Accepted answer

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


---

### Answer by username_2 on 2021-12-07. Score: 0

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>


---

