Tuesday, July 6, 2021

Mutect - java.lang.IllegalArgumentException: Comparison method violates its general contract!

 This is likely caused by you trying to use a decent version of java. At the time of this writing (July 2021) the latest version of mutect (1.1.4) still needs java 1.6.

Download and install the 1.6 Java Runtime Environment from here, and the problem will likely disappear. Here is the full stack trace I was getting:


##### ERROR ------------------------------------------------------------------------------------------
##### ERROR stack trace
java.lang.RuntimeException: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at org.broadinstitute.cga.tools.gatk.walkers.cancer.mutect.MuTect.map(MuTect.java:712)
at org.broadinstitute.cga.tools.gatk.walkers.cancer.mutect.MuTect.map(MuTect.java:34)
at org.broadinstitute.sting.gatk.traversals.TraverseLociNano$TraverseLociMap.apply(TraverseLociNano.java:243)
at org.broadinstitute.sting.gatk.traversals.TraverseLociNano$TraverseLociMap.apply(TraverseLociNano.java:231)
at org.broadinstitute.sting.utils.nanoScheduler.NanoScheduler.executeSingleThreaded(NanoScheduler.java:287)
at org.broadinstitute.sting.utils.nanoScheduler.NanoScheduler.execute(NanoScheduler.java:252)
at org.broadinstitute.sting.gatk.traversals.TraverseLociNano.traverse(TraverseLociNano.java:120)
at org.broadinstitute.sting.gatk.traversals.TraverseLociNano.traverse(TraverseLociNano.java:67)
at org.broadinstitute.sting.gatk.traversals.TraverseLociNano.traverse(TraverseLociNano.java:23)
at org.broadinstitute.sting.gatk.executive.LinearMicroScheduler.execute(LinearMicroScheduler.java:74)
at org.broadinstitute.sting.gatk.GenomeAnalysisEngine.execute(GenomeAnalysisEngine.java:281)
at org.broadinstitute.sting.gatk.CommandLineExecutable.execute(CommandLineExecutable.java:113)
at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:236)
at org.broadinstitute.sting.commandline.CommandLineProgram.start(CommandLineProgram.java:146)
at org.broadinstitute.sting.gatk.CommandLineGATK.main(CommandLineGATK.java:93)
Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeLo(TimSort.java:747)
at java.util.TimSort.mergeAt(TimSort.java:483)
at java.util.TimSort.mergeCollapse(TimSort.java:410)
at java.util.TimSort.sort(TimSort.java:214)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at org.broadinstitute.cga.tools.gatk.walkers.cancer.mutect.MuTect.map(MuTect.java:480)
... 14 more