This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Realignertargetcreator Error: Not Enough Memory

Hi, everyone

I use GATK to realignment the bam files, which is about 400M, the command I ues is :

java -Xmx24g -jar GenomeAnalysis.jar -T RealignerTargretCreator    -rbs 10000000 -R ref.fa -I sample.bam -o sample.realigner.intervals

After running 1h, the program exit with this error report:

ERROR MESSAGE: There was a failure because you did not provide enough memory to run this program.  See the -Xmx JVM argument to adjust the maximum heap size provided to Java

How can I solve this problem,and what I can do to speed up the program, thank you!

gatk memory

What version of GATK?

I have never needed to allocate that much memory to RealignerTargetCreator - what is the purpose of buffering ten million reads in memory at this point? It seems to me that might be a likely cause of running out of memory.

As for speeding it up, very few of these operations are 'fast' with GATK. There are multiple route to parallelising GATK, you will need to read: http://www.broadinstitute.org/gatk/guide/article?id=1988 and http://www.broadinstitute.org/gatk/guide/article?id=1975

I tried without the -rbs 10000000 argument, the same error was report. And I also realigned the same bam file to the CDS region of my reference genome, the program succeed. The reason maybe my reference is too large which is above 4G of wheat draft genome.

The reason for this maybe too many contigs of my references, thanks for all your answers!

1 answer

you're missing the jar of gatk on your command line:

java -Xmx24g -jar GenomeAnalysis.jar ...

I missed the GenomeAnalysis.jar when i edit the post, sorry , and I have added in the post

but the jar should be the placed before the -T RealignerTargretCreator

 java [-options] -jar jarfile [args...]

Log in to answer this question.