Error: Trimmomatic Command not found
1
0
Entering edit mode
4 months ago
Tundup • 0

I am try to trim the reads using Trimmomatic 0.39. But I am encountering error saying command not found. I am invoking it using command:

java -jar Trimmomatic-0.39/trimmomatic-0.39.jar

After that I am getting:

Usage:
       PE [-version] [-threads <threads>] [-phred33|-phred64] [-trimlog <trimLogFile>] [-summary <statsSummaryFile>] [-quiet] [-validatePairs] [-basein <inputBase> | <inputFile1> <inputFile2>] [-baseout <outputBase> | <outputFile1P> <outputFile1U> <outputFile2P> <outputFile2U>] <trimmer1>...
   or:
       SE [-version] [-threads <threads>] [-phred33|-phred64] [-trimlog <trimLogFile>] [-summary <statsSummaryFile>] [-quiet] <inputFile> <outputFile> <trimmer1>...
   or:
       -version

After the following command, I am getting the mentioned error:

trimmomatic PE threads 4 mycoplasma_pneumoniae_F_100K.fastq m ycoplasma_pneumoniae_R_100K.fastq./trimmomatic-out/mycoplasma_pneumoniae_F_paired_100K.fastq/trimmomatic-out/mycoplasm a_pneumoniae_F_unpaired_100K.fastq./trimmomatic-out/mycoplasma_pneumoniae_R_paired_100K.fastq./trimmomatic-out/mycoplas ma_pneumoniae_R_unpaired_100K.fastq ILLUMINACLIP: all_adapters.fa:2:30:10 LEADING:3 TRAILING: 3 SLIDINGWINDOW:4:20 CROP:240 HEADCROP:19 MINLEN:50

I am aware of anaconda/conda. But this method should also work.

I searched for executables and also defined the PATH. But still getting the same problem.

Any suggestion would be highly appreciated. Thanks!

NGS Illumina Quality-Control Trimmomatic • 497 views
ADD COMMENT
1
Entering edit mode

Do you get a valid directory path after running which trimmomatic.

If your $PATH is correctly set then you should get the usage to print (as above) if you just run trimmomatic. If you don't then your $PATH is not set right.

You also need to make sure you have spaces in the correct delimiting positions and - in front of options like threads and no space beteween : and filename below.

ILLUMINACLIP: all_adapters.fa:2:30:10

ADD REPLY
0
Entering edit mode

which trimmomatic does not returns anything. But, whereis trimmomatic works. I am getting usage after calling trimmomatic (means I have set path correctly).

Even trimmomatic -version gives command not found error.

ADD REPLY
0
Entering edit mode

The zip from github does not contain any executable, just the ./trimmomatic-0.39.jar and adapters dir. Compare the output: whereis java => java: /path/to/java_executable vs whereis trimmomatic trimmomatic: (nothing here)

So most likely there is no trimmomatic command anywhere on your system, not just on your PATH unless you installed it not from the zip but from another source

ADD REPLY
2
Entering edit mode
4 months ago
Michael 55k

Trimmomatic is a Java program that needs to be run as described in the README on github https://github.com/usadellab/Trimmomatic This is how java programs are run (java -jar ...).

That trimmomatic can be run - in some environments - by simply typing trimmomatic is because the conda packages contain a wrapper that conda places in your $PATH. If you just downloaded the the code from github, then you will not have an executable.

The simplest shell wrapper that would (mostly) accomplish is something like this is (call the file trimmomatic and make it executable):

#!/bin/sh
 <path-to-java/>java -jar <path-to-trimmomatic/>Trimmomatic-0.39/trimmomatic-0.39.jar $@

replace <path-to-.../> with the full path to java and trimmomatic.

With this crude wrapper, you will also have to give the full path to the adapter files or trimmomatic will not find them.

The conda java wrapper is a python program that takes care of many more cases and also allows to set java VM args eg. -Xmx. If you need this functionality, install the program with conda/mamba/micromamba or if you cannot use conda for some reason, copy the code of the wrapper from a conda install.

As a side-note, I think there is now better trimming software that I would prefer for ease of use, e.g. fastp, Cutadapt, or BBduk

ADD COMMENT

Login before adding your answer.

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