Error while merging multiple vcf files using Picard MergeVcfs
Entering edit mode
3.0 years ago
nitinra ▴ 50

Hello all,

I am trying to merge multiple vcf files using MergeVcfs from Picard tools. Here is my command:

java -jar ./picard.jar I=input1.vcf I=input2.vcf I=inputx.vcf O=combined.vcf

However, I am getting the following error:

Input file .vcf has sample entries that don't match the other files.

This is what I used to call the variants:

gatk HaplotypeCaller -I input.sorted.bam -O .vcf -R reference.fasta

Is this is a problem as I did not output as GVCF? What tool can I use to merge it successfully?


snp genome picard gatk • 2.8k views
Entering edit mode
2.8 years ago
haizi.zh ▴ 20

I encountered similar problems.

I have two GVCF files generated by HaplotypeCaller, each one for a different sample. When I tried to merge them into a multi-sample VCF file using the following command:

gatk MergeVcfs -I M11189W.chr21.common.g.vcf.gz -I N11189.chr21.common.g.vcf.gz -O merged.picard.vcf.gz

I got this error message:

java.lang.IllegalArgumentException: Input file /pylon5/mc5plcp/haizizh/cofrag/stash/N11189.chr21.common.g.vcf.gz has sample entries that don't match the other files.
    at picard.vcf.MergeVcfs.doWork(
    at picard.cmdline.CommandLineProgram.instanceMain(
    at org.broadinstitute.hellbender.cmdline.PicardCommandLineProgramExecutor.instanceMain(
    at org.broadinstitute.hellbender.Main.runCommandLineProgram(
    at org.broadinstitute.hellbender.Main.mainEntry(
    at org.broadinstitute.hellbender.Main.main(

However, when I turned to CombineGVCFs, the command went through successfully:

gatk --java-options -Xmx2G CombineGVCFs \
-G StandardAnnotation -G StandardHCAnnotation -G AS_StandardAnnotation \
-R ../data/ref_genome/hs37-1kg/human_g1k_v37.fasta \
-V M11189W.chr21.common.g.vcf.gz -V N11189.chr21.common.g.vcf.gz \
-O merged.g.vcf.gz

I guess this is because HaplotypeCaller generates GVCF files, which are not exactly the same with standard VCF files.


Login before adding your answer.

Traffic: 2609 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6