This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Out Of Disk Space With Picard Tools ?

Hi,

I am trying to run the following command:

java -Xmx2g -jar   SortSam.jar  SORT_ORDER=coordinate INPUT=input.bam OUTPUT=output.sort

But I keep getting:

Exception in thread "main" net.sf.samtools.util.RuntimeIOException: java.io.IOException: No space left on device

Despite the fact that I have ample space to write.

Has anyone had similar trouble?

picard

perhaps it is using the temporary directory that is located on a different, smaller partition,

2 answers

That sounds like an issue with your system's TMP directory filling up. Why not make a folder called tmp in your current directory (mkdir tmp) where you are doing your work and then run picard like this:

java -Xmx2g -Djava.io.tmpdir=`pwd`/tmp -jar SortSam.jar SORT_ORDER=coordinate INPUT=input.bam OUTPUT=output.sort TMP_DIR=`pwd`/tmp

It is possible that this part:

TMP_DIR=`pwd`/tmp

would be sufficient, but setting -Djava.io.tmpdir=bla should work for java programs in general.

Worked ! Many thanks !

Thanks.. worked for me as well.

that solved the no-space issue, but now I am getting this: Exception in thread "main" net.sf.samtools.util.RuntimeIOException: java.io.FileNotFoundException: /Picard/picard-tools-1.72/pwd/tmp/sortingcollection.4875296484959495534.tmp (Too many open files) Anyone had similar issue?

You have to go to /etc/security/limits.conf and put it like this:

#<domain>      <type>  <item>         <value>
#
*               hard    nofile            65536
*               soft    nofile            65536

then you can have 65536 open files at the same time with your user. You will need root rights.

Didn't work for me. I run picard via GATK 4.0.11.

I made a tmp folder in my GATK directory and used the command:

./gatk SortSam -I=/home/xxxxx/Desktop/folder/input.sam -O=/home/xxxxx/Desktop/folder/sortedsample.bam -SO=coordinate TMP_DIR=`pwd`/tmp

Got the error:

Invalid argument 'TMP_DIR=tmp'.

TMP_DIR is not a part of the command, it's an environmental variable

gatk has its own rules for the parameter names, the picard variables are passed with same name but you need to add -- before the parameter name. Although its is not mentioned in their help/usage text you can use '--TMP_DIR /some/path' to set the tmp directory manually...

Thanks changing the tmp dir fixed the out of disk space error for me as well.

The problem is, as others said with a probable low space in the default temporary directory. I changed my directory to a custom one. Worked perfectly for me using this code:

./gatk --java-options "-Djava.io.tmpdir=/custom file path" SortSam -I=samplealn.sam -O=sortedsamplealn.bam -SO=coordinate --TMP_DIR=/custom file path

Log in to answer this question.