CSB5 / OPERA-MS

OPERA-MS - Hybrid Metagenomic Assembler
Other
92 stars 17 forks source link

Error in during pilon. --Java #74

Open wdp9966 opened 1 year ago

wdp9966 commented 1 year ago

Hello,

When I polishing, I then received this message:

Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.simontuffs.onejar.Boot.run(Boot.java:340) at com.simontuffs.onejar.Boot.main(Boot.java:166) Caused by: java.lang.OutOfMemoryError: Java heap space at org.broadinstitute.pilon.GenomeRegion.(GenomeRegion.scala:60) at org.broadinstitute.pilon.GenomeFile$$anonfun$contigRegions$1.apply(GenomeFile.scala:72) at org.broadinstitute.pilon.GenomeFile$$anonfun$contigRegions$1.apply(GenomeFile.scala:72) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234) at scala.collection.immutable.Range.foreach(Range.scala:160) at scala.collection.TraversableLike$class.map(TraversableLike.scala:234) at scala.collection.AbstractTraversable.map(Traversable.scala:104) at org.broadinstitute.pilon.GenomeFile.contigRegions(GenomeFile.scala:72) at org.broadinstitute.pilon.GenomeFile$$anonfun$2.apply(GenomeFile.scala:52) at org.broadinstitute.pilon.GenomeFile$$anonfun$2.apply(GenomeFile.scala:52) at scala.collection.immutable.List.map(List.scala:277) at org.broadinstitute.pilon.GenomeFile.(GenomeFile.scala:52) at org.broadinstitute.pilon.Pilon$.main(Pilon.scala:98) at org.broadinstitute.pilon.Pilon.main(Pilon.scala) ... 6 more

Thank you in advance

jsgounot commented 1 year ago

Hi wdp9966,

as the error message suggest, you don't have enough memory when running pilon. We did not offer an option within OPERA-MS for this issue but you can modify your OPERA-MS code this way.

In OPERA-MS.pl line 1141, you can add a java parameter this way:

run_exe("java -jar -Xmx80G $pilon_path --fix bases --threads $num_processor --genome $temp_contig --bam $temp_contig.bam --outdir $polishing_dir > $polishing_dir/pilon.out 2> $polishing_dir/pilon.err");

In this example, I specified 80G of memory. FYI - it is possible that Pilon requires a minimum memory size. I recommend running OPERA-MS on a computer with more memory if you can.