text: user1075: I am trying to use Pilon to improve a reference based on some Illumina data I have got. So, I aligned the Illumina reads to the reference using bwa. Then, I want to use Pilon to improve the reference using the alignment file in BAM format.
  Information about Pilon is found here. I installed Pilon using conda.
  The output of 'pilon' is:
  Pilon version 1.22 Wed Mar 15 16:38:30 2017 -0400
  
      Usage: pilon --genome genome.fasta [--frags frags.bam] [--jumps jumps.bam] [--unpaired unpaired.bam]
                   [...other options...]
             pilon --help for option details
  
  The output of:
  pilon --genome ref.fa --frags readsSorted.bam --output pilo --outdir output/scaffold
  
  is:
   Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      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.<init>(GenomeRegion.scala:55)
      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.<init>(GenomeFile.scala:52)
      at org.broadinstitute.pilon.Pilon$.main(Pilon.scala:98)
      at org.broadinstitute.pilon.Pilon.main(Pilon.scala)
      ... 6 more
  
  
  user939: Like gringer already commented, the cause of your error is nicely given by the java program. Your default max heap settings are probably too low for the program. If you have more memory on your machine you can give max heap a higher value. See this post and answers on Stack overflow.
  You'll probably need to use the -Xmxn argument in java.
  
original_text: 1075: <p>I am trying to use Pilon to improve a reference based on some Illumina data I have got. So, I aligned the Illumina reads to the reference using bwa. Then, I want to use Pilon to improve the reference using the alignment file in BAM format.</p>
  
  <p>Information about Pilon is found <a href="https://github.com/broadinstitute/pilon/wiki/Requirements-&amp;-Usage" rel="nofollow noreferrer" title="Requirements of Pilon">here</a>. I installed Pilon using conda.</p>
  
  <p>The output of 'pilon' is:</p>
  
  <pre><code>Pilon version 1.22 Wed Mar 15 16:38:30 2017 -0400
  
      Usage: pilon --genome genome.fasta [--frags frags.bam] [--jumps jumps.bam] [--unpaired unpaired.bam]
                   [...other options...]
             pilon --help for option details
  </code></pre>
  
  <p>The output of:</p>
  
  <pre><code>pilon --genome ref.fa --frags readsSorted.bam --output pilo --outdir output/scaffold
  </code></pre>
  
  <p>is:</p>
  
  <pre><code> Exception in thread "main" java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      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.&lt;init&gt;(GenomeRegion.scala:55)
      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.&lt;init&gt;(GenomeFile.scala:52)
      at org.broadinstitute.pilon.Pilon$.main(Pilon.scala:98)
      at org.broadinstitute.pilon.Pilon.main(Pilon.scala)
      ... 6 more
  </code></pre>
   939: <p>Like gringer already commented, the cause of your error is nicely given by the <code>java</code> program. Your default <code>max heap</code> settings are probably too low for the program. If you have more memory on your machine you can give <code>max heap</code> a higher value. See this <a href="https://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap">post</a> and answers on Stack overflow.</p>
  
  <p>You'll probably need to use the <code>-Xmxn</code> argument in <code>java</code>.</p>
  