Out Of Disk Space With Picard Tools ?
2
10
Entering edit mode
12.7 years ago
Gabriel R. ★ 2.9k

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 • 29k views
ADD COMMENT
5
Entering edit mode

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

ADD REPLY
37
Entering edit mode
12.7 years ago
John St. John ★ 1.2k

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.

ADD COMMENT
0
Entering edit mode

Worked ! Many thanks !

ADD REPLY
0
Entering edit mode

Thanks.. worked for me as well.

ADD REPLY
0
Entering edit mode

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?

ADD REPLY
1
Entering edit mode

Add the parameter named MAX_FILE_HANDLES_FOR_READ_ENDS_MAP, I set it to 1000 and it helped :-) with the explanation here

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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'.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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...

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
6.1 years ago

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
ADD COMMENT

Login before adding your answer.

Traffic: 2126 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6