I am trying to create synthetic reads from a fasta reference using BBMap's randomreads. Using this command from within the BBMap /sh directory:
[cmp07 sh]$ java -ea -Xmx23g -cp /home/mina/tools/BBMap-master/current/align2/RandomReads3.java ref=/home/mina/reference-genomes/N1a1.fasta reads=1258301 length=301 overwrite=f seed=-1 snprate=0.001 maxq=40 midq=30 minq=10 overlap=50
Unfortunately this produces and error:
Error: Could not find or load main class ref=.home.mina.reference-genomes.N1a1.fasta
How do I provide the path to my reference fasta file? Is there something I am missing about how to use this tool? Why are the slashes being converted to dots in the file path in the error message?
If you are not using this program on WIndows, I suggest that you just use
randomreads.sh
the wrapper script to run this.@genomax I had tried running randomreads.sh as well using this command:
Unfortunately that method give me this error message:
Which led me to believe that I needed to run it using the original version of the command I asked about.
Have you moved any of the folder contents after downloading BBMap suite?
No, I have not moved any of the folder contents. My first thought is to add the full path to the randomreads.sh script but after trying that still I get an error message. Any ideas on what I could do?
Are you running the latest BBMap version? I just tried your command with BBmap v. 38.22 and was able to get an output file. You seem to be missing
out=file.fq.gz
in your command line but that should not cause the error you see.Very good point genomax. I realized I wasn't running the latest version. I downloaded version 38.32 and untarred/zipped the file. Now when running
randomreads.sh
I get a different error:Are you using 64-bit java on a 64-bit OS?
I tried your command line with human genome on my machine (albeit with 10G of RAM) and I am able to get an output file without any issues.
Can you try (I assume you have 10G of free memory available):
I tried your change and still get this error:
Is
N1a1.fasta
bigger or smaller than human genome?N1a1.fastq is much smaller. It is a human mitochondrial genome so ~16.5K base pairs long.
Can you try reducing number of reads to 10000 and see if that works? Since the genome is so small bbmap may be running out sequence in trying to generate the number of reads you are asking of 171 bp length.
I tried reducing the number of reads to 10000 and unfortunately it gave me the same error message referencing the ArrayIndexOutOfBounds Exception.
Not sure what to tell you. I downloaded human mitochondrial genome (~17kb) and tried your original command as well as one for 10,000 reads and both worked without error.
in the github repo, there is no method called at line 39: https://github.com/BioInfoTools/BBMap/blob/master/current/align2/RandomReads3.java#L39 Are you sure you're using the latest version of BBMAP ?
I am using version 38.32 which I downloaded and untarred today. I downloaded this from https://sourceforge.net/projects/bbmap/ . If there is a different version I should be using, please let me know where to find it.