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.
There cannot be an error at line 226 in MergeVcfs https://github.com/broadinstitute/picard/blob/master/src/main/java/picard/vcf/MergeVcfs.java#L226 . Please, update your version of picard.
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