hi. i am trying to remove contaminants from my fastq files using bbduk but it gives the following error. it says invalid maximum heapn size. i am using a linux system and do not know how to change the heap size or how to solve the problem. any help would be appreciated. thanks
bbduk.sh in1=D1C180_1.fastq in2=D1C180_2.fastq out1=cleanD1C180_1.fastq out2=D1C180_2 \
ref=host_reference.fa k=31 mm=f
/home/s358309/bin/bbduk.sh: line 340: /home/s358309/bin//calcmem.sh: No such file or directory /home/s358309/bin/bbduk.sh: line 341: parseXmx: command not found /home/s358309/bin/bbduk.sh: line 345: freeRam: command not found java -ea -Xmxm -Xmsm -cp /home/s358309/bin/current/ jgi.BBDuk in1=D1C180_1.fastq in2=D1C180_2.fastq out1=cleanD1C180_1.fastq out2=D1C180_2 ref=host_reference.fa k=31 mm=f Invalid maximum heap size: -Xmxm Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
2 answers
Somehow the installation of the BBMap / BBTools suite is botched. BBTools programs in general dynamically calculate the memory available at the computer they are running, and set (if I remember correctly) 85% of that memory to the Java virtual machine. But bbduk.sh is not finding calcmem.sh, hence it can't calculate the memory it should reserve and is using an empty string to build the actual java command, thus the odd-looking -Xmxm -Xmsm.
Did you add the base BBTools directory to the PATH? Supposing BBTools scripts are located at /home/s358309/bin/, do:
export PATH=/home/s358309/bin:$PATH
Try removing bbmap first and install from anaconda. Use the following command:
conda install -c bioconda bbmap
You might need to install anaconda first if it isn't installed.
Cheers :)
Log in to answer this question.
How are you running this? compute cluster?
This is usually caused by a a lack of memory, try giving it much more memory to work with.
and is
javaavailable on your system?Are those flags correct?
-Xmxm -XmsmI'm no Java expert, but I think the flags don't normally have the last
m? They should also be followed by a number for how much memory you want to useThe parameters should be e.g. -Xmx 128M -Xms 16M. These are allocating respectively the maximum and initial heap size for the JVM.
For
bbduk.shyou should need not much RAM. Even a couple of gigs would be enough. Assign it explicitly in your command like this: