This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Java error message when using BBDuk

Hi all,

I am trying to run BBDuk to quality trim and filter my illumina whole genome sequences. I have used this program before and haven't had any problems. However when I run the command:

bbduk.sh -Xmx80g in1=17198wC1_Sample_3_1_trimmed.fastq  in2=17198wC1_Sample_3_2_trimmed.fastq out1=~/comp_genomics/bb_qc_30/bb30_17198wC1_Sample_3_1_trimmed.fastq out2=~/comp_genomics/bb_qc_30/bb30_17198wC1_Sample_3_2_trimmed.fastq qtrim=rl trimq=30 maq= 30 t=16

Or if I run the command in a forloop:

for i in ~/comp_genomics/raw_genomes/scalp_genomereads/*_1_trimmed.fastq; do bbduk.sh -Xmx80g in1=$i in2=${i%%_1_trimmed.fastq}_2_trimmed.fastq out1=~/comp_genomics/bb_qc_30/$i out2=~/comp_genomics/bb_qc_30/${i%%_1_trimmed.fastq}_2_trimmed.fastq qtrim=rl trimq=30 maq= 30 t=16; done

I get the error message:

Version 38.22 Exception in thread "main" java.lang.NullPointerException
    at shared.Parser.parseTrim(Parser.java:317)
    at jgi.BBDukF.<init>(BBDukF.java:163)
    at jgi.BBDukF.main(BBDukF.java:67)

I have run this both in a conda environment and using the downloaded program, however I still get the same error and no output. I have also made sure that the versions I have are updated.

If anyone could help, I would be very grateful!

Thank you!!

genome bbduk qc java bbtools

Can you validate your fastq files using validateFiles utility here? Remeber to do chmod a+x validateFiles after you download.

I run validateFiles on my fastq files and the output was "Error count 0"

bbduk.sh should not need 80g of RAM. Can you try running this with a smaller number of threads (t=4 and -Xmx5g). Are you input files already trimmed for adapters and you are now doing quality trim?

Yes, my files are already trimmed for adapters I am now doing a quality trim.

I tried with the lower number of RAM and threads and got this error:

    Exception in thread "main" java.lang.NullPointerException
    at shared.Parser.parseTrim(Parser.java:333)
    at jgi.BBDuk.<init>(BBDuk.java:176)
    at jgi.BBDuk.main(BBDuk.java:76)
java -ea -Xmx5g -Xms5g -cp /pub38/cchong/Software_Downloads/bbmap/current/ jgi.BBDuk -Xmx5g in1=17198wA4_Sample_25_1_trimmed.fastq in2=17198wA4_Sample_25_2_trimmed.fastq out1=/pub38/cchong/comp_genomics/bb_qc_30/17198wA4_Sample_25_1_trimmed.fastq out2=/pub38/cchong/comp_genomics/bb_qc_30/17198wA4_Sample_25_2_trimmed.fastq qtrim=rl trimq=30 maq= 30 t=4
Executing jgi.BBDuk [-Xmx5g, in1=17198wA4_Sample_25_1_trimmed.fastq, in2=17198wA4_Sample_25_2_trimmed.fastq, out1=/pub38/cchong/comp_genomics/bb_qc_30/17198wA4_Sample_25_1_trimmed.fastq, out2=/pub38/cchong/comp_genomics/bb_qc_30/17198wA4_Sample_25_2_trimmed.fastq, qtrim=rl, trimq=30, maq=, 30, t=4]

That worked! Such a simple fix!!

Thank you very much!

Great. You can accept the answer below to provide closure to this thread.

1 answer

It looks like you have a space in one of the command line options after the = sign: maq= 30. Can you remove that and try?

That worked! Such a simple fix!!

Thank you very much!

Log in to answer this question.