I'm executing this command in two different folders and in two different terminals:
for i in *_RG.bam; do k=`echo $i | sed "s/.bam/_Reordered.bam/"` java -jar /home/Programas/picard-tools-1.107/ReorderSam.jar R=/local/Referencias/Homo_sapiens/UCSC/hg19/Sequence/Bowtie2Index/genome.fa I= $i O= "$k" ; done
In one terminal it works ok, but on the other terminal the code is not working at all. It gives the next error.
Runtime.totalMemory()=1517289472 To get help, see http://picard.sourceforge.net/index.shtml#GettingHelp Exception in thread "main" net.sf.samtools.util.RuntimeIOException: File not found: at net.sf.samtools.util.BinaryCodec.<init>(BinaryCodec.java:102) at net.sf.samtools.util.BlockCompressedOutputStream.<init>(BlockCompressedOutputStream.java:127) at net.sf.samtools.BAMFileWriter.<init>(BAMFileWriter.java:50) at net.sf.samtools.SAMFileWriterFactory.makeBAMWriter(SAMFileWriterFactory.java:154) at net.sf.samtools.SAMFileWriterFactory.makeBAMWriter(SAMFileWriterFactory.java:136) at net.sf.samtools.SAMFileWriterFactory.makeSAMOrBAMWriter(SAMFileWriterFactory.java:246) at net.sf.picard.sam.ReorderSam.doWork(ReorderSam.java:118) at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:179) at net.sf.picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:120) at net.sf.picard.sam.ReorderSam.main(ReorderSam.java:77) Caused by: java.io.FileNotFoundException: (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:221) at java.io.FileOutputStream.<init>(FileOutputStream.java:171) at net.sf.samtools.util.BinaryCodec.<init>(BinaryCodec.java:95) ... 9 more
When I call the program as
java -jar /home/ktroule/Programas/picard-tools-1.107/ReorderSam.jar -h in a new terminal, it prints the help as I would expect.
After this I stopped using
ctrl+c the terminal that was working properly and I exchanged the terminals to prove if the problem was related to the files or to the terminal. And the same happened, only one terminal worked (the same that was working previously).
I closed the terminal that wasn't working and opened a new one, but only on the original one the code works.
I have also compared on the terminal that works and the one that doesn't the output of printenv by usinf
diff and both are the same excepet for the
Any guess on the problem?
I'm not closing the terminal that runs the code as I need it and I'm afraid of not being able to run the code.