This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to merge 2 VCF files that was previously extracted from same file

Hello, I have a VCF file containing 9 samples. After I used "gatk SelectVariants" to extract SNP and INDEL into 2 files and "gatk VariantFiltration" for hard filtering, I want to merge them back using "gatk MergeVcfs". Anyway, I always get this error:

java.lang.IllegalStateException: The elements of the input Iterators are not sorted according to the comparator htsjdk.variant.variantcontext.VariantContextComparator

htsjdk.variant.variantcontext.VariantContextComparator at htsjdk.samtools.util.MergingIterator.next(MergingIterator.java:107) at picard.vcf.MergeVcfs.doWork(MergeVcfs.java:230) at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:295) at org.broadinstitute.hellbender.cmdline.PicardCommandLineProgramExecutor.instanceMain(PicardCommandLineProgramExecutor.java:25) at org.broadinstitute.hellbender.Main.runCommandLineProgram(Main.java:162) at org.broadinstitute.hellbender.Main.mainEntry(Main.java:205) at org.broadinstitute.hellbender.Main.main(Main.java:291)

Do you guys have any recommendation for merging VCF files or fixing this error. I also have tried some tools, but they only can concatenate VCF files, so I'll get duplicated positions with different ALT in case of multiallelic site contains both SNP and INDEL. Thank you in advance for your kind help.

snp variant software error vcf gatk

I didn't use picard directly. I use GATK 4.1.2.0

Edited: Oh sorry, this error got from picard (I run both software to see whether I'll get the same error). I'll update error from GATK

0 answers

No answers yet.

Log in to answer this question.