This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Picard throwing error for non-existent file

I am trying to run this picard tool RevertSam, but I am not sure why it is throwing error for "non-existent" file. I can also ls this bam file, so it is there. What am I missing here?

fileName="little.bam"
JAVAOPTS="-Xms2g -Xmx4g -XX:+UseSerialGC -Dpicard.useLegacyParser=false"
/usr/bin/java ${JAVAOPTS} -jar /usr/bin/picard.jar   RevertSam  -I /mnt/an/test/${fileName}   -O $PWD   -SORT_ORDER queryname   -COMPRESSION_LEVEL 0   -VALIDATION_STRINGENCY SILENT

I am not sure why it generates this error for non-exixtent file though the file is presen in given location.

Deflater: Intel; Inflater: Intel; Provider GCS is not available; Picard version: Version:2.20.8-SNAPSHOT
[Thu Nov 26 10:56:33 CST 2020] picard.sam.RevertSam done. Elapsed time: 0.00 minutes.
Runtime.totalMemory()=2075918336
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMException: Cannot read non-existent file: file:///mnt/an/test/little.bam
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:483)
at htsjdk.samtools.util.IOUtil.assertFileIsReadable(IOUtil.java:470)
at picard.sam.RevertSam.doWork(RevertSam.java:248)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:305) at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103) at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)

picard bam revertsam

what is the output of

fileName="little.bam"
JAVAOPTS="-Xms2g -Xmx4g -XX:+UseSerialGC -Dpicard.useLegacyParser=false"

echo /mnt/an/test/${fileName} && ls /mnt/an/test/${fileName} &&  /usr/bin/java ${JAVAOPTS} -jar /usr/bin/picard.jar   RevertSam  -I /mnt/an/test/${fileName}   -O $PWD   -SORT_ORDER queryname   -COMPRESSION_LEVEL 0   -VALIDATION_STRINGENCY SILENT

I am running this on docker. Do I execute like this?

root@WL-05104:/mnt/an/test# docker run -t achalneupane/bam2fq echo /mnt/an/test/${fileName} && ls /mnt/an/test/${fileName} &&  /usr/local/openjdk-8/bin/java ${JAVAOPTS} -jar /usr/bin/picard.jar   RevertSam  -I /mnt//test/${fileName}   -O $PWD   -SORT_ORDER queryname   -COMPRESSION_LEVEL 0   -VALIDATION_STRINGENCY SILENT     /mnt/an/test/   

/mnt/an/test/little.bam 
/mnt/an/test/little.bam    
bash: /usr/local/openjdk-8/bin/java: No such file or directory

When I do:

root@WL-05104:/mnt/an/test# docker run -t achalneupane/bam2fq which java  
/usr/local/openjdk-8/bin/java

I can also run help command for RevertSam.

bash: /usr/local/openjdk-8/bin/java: No such file or directory

this is not the same error than in your question.

0 answers

No answers yet.

Log in to answer this question.