error when running bbduk
1
0
Entering edit mode
2.8 years ago
Lila M ★ 1.2k

Hi there,

I'm trying to run bbduk in order to remove adapters from my fastq files:

bbduk.sh in=R1_001.fastq.gz  out=clean_1.fastq.gz ktrim=r k=21 path=adapters.fa

But i've got this error:

/usr/bin/bbduk.sh: line 344: /usr/share/bbmap/calcmem: No such file or directory
/usr/bin/bbduk.sh: line 345: setEnvironment: command not found
/usr/bin/bbduk.sh: line 346: parseXmx: command not found
/usr/bin/bbduk.sh: line 350: freeRam: command not found
java -Xmxm -Xmsm -cp /usr/share/java/bbmap.jar jgi.BBDuk in=1_S1_L001_R1_001.fastq.gz out=clean_1_1.fastq.gz ktrim=r k=21 path=adapters.fa
Invalid maximum heap size: -Xmxm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

PS:

java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Any idea whats wrong? Thank you!

bbduk error • 3.6k views
ADD COMMENT
1
Entering edit mode
ADD REPLY
0
Entering edit mode

of course I've tried but it doesn't work :/

ADD REPLY
1
Entering edit mode

How did you install bbduk e.g. via conda? It sounds like an installation issue as pointed out in the previous post.

ADD REPLY
1
Entering edit mode

I think there is a problem with the BBMap package installation. Can you double check that?

eg. it should not say : "/usr/share/bbmap/calcmem: No such file or directory" .

Can you run other tools from the package? Is bbduk the only one failing?

ADD REPLY
0
Entering edit mode

if I run it without any parameter eg

bbduk.sh
Written by Brian Bushnell
Last modified November 7, 2019

Description:  Compares reads to the kmers in a reference dataset, optionally 
allowing an edit distance. Splits the reads into two outputs - those that 
match the reference, and those that don't. Can also trim (remove) the matching 
parts of the reads rather than binning the reads.
Please read bbmap/docs/guides/BBDukGuide.txt for more information.

Usage:  bbduk.sh in=<input file> out=<output file> ref=<contaminant files> .....

I've got the usage and the options and everything, to it seems the package is correctly installed, isn't it?

ADD REPLY
1
Entering edit mode

yes, that's on thing already indeed.

Can you then check why it complains on the line I posted above (the calcmem program) ? Is it there?

ADD REPLY
0
Entering edit mode

yes it is, in the same directory too

ADD REPLY
1
Entering edit mode

You have not answered the question "how did you install bbmap suite"? We need to know that to diagnose this properly.

You can also explicitly set the memory and try running as

bbduk.sh -Xmx4g in=R1_001.fastq.gz  out=clean_1.fastq.gz ktrim=r k=21 ref=adapters.fa
ADD REPLY
0
Entering edit mode

yes sorry, what I did was:

  • Download BBTools from Sourceforge
  • tar -xvzf BBMap_(version).tar.gz
  • run the bash file

GenoMax , I've run the code as you suggested and it fails too :/

ADD REPLY
2
Entering edit mode
2.8 years ago
GenoMax 141k

You need to make sure that the directory containing bbmap scripts is in your $PATH. So try

export PATH=$PATH:/path_to_dir_with_bbmap_scripts

and see if that fixes the problem. You can then amend your $PATH permanently via your .bashrc or profile file.

ADD COMMENT
0
Entering edit mode

It worked! but still have a warning and error:

Initial:
Memory: max=4294m, total=4294m, free=4266m, used=28m

******  WARNING! A KMER OPERATION WAS CHOSEN BUT NO KMERS WERE LOADED.  ******
******  YOU NEED TO SPECIFY A REFERENCE FILE OR LITERAL SEQUENCE.       ******

Exception in thread "main" java.lang.AssertionError: You can bypass this assertion with the -da flag.
    at jgi.BBDuk.process2(BBDuk.java:1178)
    at jgi.BBDuk.process(BBDuk.java:1082)
    at jgi.BBDuk.main(BBDuk.java:81)
ADD REPLY
2
Entering edit mode

That is because you are using an incorrect option. path= is used when you have a pre-built BBMap index available. You should use ref= when you are starting with a fasta file. So try this:

bbduk.sh -Xmx4g in=R1_001.fastq.gz  out=clean_1.fastq.gz ktrim=r k=21 ref=adapters.fa
ADD REPLY
0
Entering edit mode

my bad, it works now! Thank you and sorry for making loose your time with this silly questions!

ADD REPLY

Login before adding your answer.

Traffic: 1558 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