4
$\begingroup$

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).

$\endgroup$
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Hi, thanks for the answer, it's already helpful. However, It would be even nicer for community to write the actual answer and to provide the link just as the source (you can edit your answer). $\endgroup$ – Kamil S Jaron May 6 '18 at 22:35
2
$\begingroup$

GATK cannot combine VCF files generated by Sniffles, the variant caller that I used to call structural variants (answer from the GATK team).

$\endgroup$

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.