text: user1075: I have called variants on two strains of C. elegans separately. I now want to merge the VCF files into one using the following code:
  
  Create a sequence dictionary of the reference sequence
  Sort the VCF files with Picard
  Merge the sorted VCF files using GATK
  
   
  picard CreateSequenceDictionary \
      REFERENCE=c_elegans.PRJNA13758.WS263.genomic.fa \
      OUTPUT=c_elegans.PRJNA13758.WS263.genomic.dict
  
  picard SortVcf INPUT=strain1.vcf \
      OUTPUT=strain1sorted.vcf \
      SEQUENCE_DICTIONARY=c_elegans.PRJNA13758.WS263.genomic.dict
  
  picard SortVcf INPUT=strain2.vcf \
      OUTPUT=strain2sorted.vcf  \     
      SEQUENCE_DICTIONARY=c_elegans.PRJNA13758.WS263.genomic.dict
  
  GATK --analysis_type CombineVariants \
      -R c_elegans.PRJNA13758.WS263.genomic.fa \
      --variant strain1sorted.vcf \
      --variant strain2sorted.vcf \
      -o all.vcf \
      -genotypeMergeOptions UNIQUIFY
  
  The last command gives me the following error message:
  ERROR MESSAGE: Input files variant and reference have incompatible contigs. Please see https://www.broadinstitute.org/gatk/guide/article?id=63 for more information. Error details: The contig order in variant and reference is not the same; to fix this please see: (https://www.broadinstitute.org/gatk/guide/article?id=1328),  which describes reordering contigs in BAM and VCF files..
  ##### ERROR   variant contigs = [I, II, III, IV, MtDNA, V, X]
  ##### ERROR   reference contigs = [I, II, III, IV, V, X, MtDNA]
  
  But I have sorted the VCF files using Picard, so I don't know what else to do.
  Your help is appreciated.
  Update: I asked this question on the GATK forum on 4th May 2018 (today).
  
  user1075: GATK cannot combine VCF files generated by Sniffles, the variant caller that I used to call structural variants (answer from the GATK team).
  
  user2776: Answered in the GATK forum
  
  Try regenerating the index files for your VCFs. Picard SortVcf doesn't do it for you iirc, so when GATK looks at the index files (before opening the VCFs themselves) it sees the old order and complains.
  
  
original_text: 1075: <p>I have called variants on two strains of <em>C. elegans</em> separately. I now want to merge the VCF files into one using the following code:</p>
  
  <ul>
  <li>Create a sequence dictionary of the reference sequence</li>
  <li>Sort the VCF files with Picard</li>
  <li>Merge the sorted VCF files using GATK</li>
  </ul>
  
  <p>&nbsp;</p>
  
  <pre><code>picard CreateSequenceDictionary \
      REFERENCE=c_elegans.PRJNA13758.WS263.genomic.fa \
      OUTPUT=c_elegans.PRJNA13758.WS263.genomic.dict
  
  picard SortVcf INPUT=strain1.vcf \
      OUTPUT=strain1sorted.vcf \
      SEQUENCE_DICTIONARY=c_elegans.PRJNA13758.WS263.genomic.dict
  
  picard SortVcf INPUT=strain2.vcf \
      OUTPUT=strain2sorted.vcf  \     
      SEQUENCE_DICTIONARY=c_elegans.PRJNA13758.WS263.genomic.dict
  
  GATK --analysis_type CombineVariants \
      -R c_elegans.PRJNA13758.WS263.genomic.fa \
      --variant strain1sorted.vcf \
      --variant strain2sorted.vcf \
      -o all.vcf \
      -genotypeMergeOptions UNIQUIFY
  </code></pre>
  
  <p>The last command gives me the following error message:</p>
  
  <pre><code>ERROR MESSAGE: Input files variant and reference have incompatible contigs. Please see https://www.broadinstitute.org/gatk/guide/article?id=63 for more information. Error details: The contig order in variant and reference is not the same; to fix this please see: (https://www.broadinstitute.org/gatk/guide/article?id=1328),  which describes reordering contigs in BAM and VCF files..
  ##### ERROR   variant contigs = [I, II, III, IV, MtDNA, V, X]
  ##### ERROR   reference contigs = [I, II, III, IV, V, X, MtDNA]
  </code></pre>
  
  <p>But I have sorted the VCF files using Picard, so I don't know what else to do.</p>
  
  <p>Your help is appreciated.</p>
  
  <p>Update: I asked this question on the <a href="https://gatkforums.broadinstitute.org/gatk/discussion/11918/gatk-combinevariants-complains-the-contig-order-in-the-vcf-files/p1?new=1" rel="nofollow noreferrer">GATK</a> forum on 4th May 2018 (today).</p>
   1075: <p>GATK cannot combine VCF files generated by Sniffles, the variant caller that I used to call structural variants (answer from the GATK team).</p>
   2776: <p>Answered in the <a href="https://gatkforums.broadinstitute.org/gatk/discussion/11918/gatk-combinevariants-complains-the-contig-order-in-the-vcf-files" rel="nofollow noreferrer">GATK forum</a></p>
  
  <blockquote>
    <p>Try regenerating the index files for your VCFs. Picard SortVcf doesn't do it for you iirc, so when GATK looks at the index files (before opening the VCFs themselves) it sees the old order and complains.</p>
  </blockquote>
  