This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to run a tool (package) installed into anaconda environment ..using mac terminal

Hi all,

I built an environment in Anaconda..and installed a Trimmomatic package... how to launch the Trimmomatic tool using Mac terminal.. and apply the tool on fastaq file located in my local server!

genome

Have you activated the environment? Did you try to run it following the manual?

Thanks for your answer, yes I activated the environment using the code " conda activate py2" and confirmed that the Trimmomatic is presented in Py2 environment by using the code "conda list", but whats next ...how to run Trimmomatic!

According to the manual, for single end mode; java -classpath <path to="" trimmomatic="" jar=""> org.usadellab.trimmomatic.TrimmomaticSE [- threads <threads>] [-phred33 | -phred64] [-trimlog <logfile>] <input> <output> <step 1=""> ...

Should I flow the same process even I used installation code to install Trmmomatic package, not downloaded a jar file!!

After installation with conda you should just run trimmomatic rather than java -jar etc

ok, but what is the command (code to run) ..I followed these steps;

In terminal;

activate py3 #(which is my anaconda environment that contains trimmomatic)

after activation;

I tried;

trimmomatic 
open trimmomatic

but no code could run the tool!!!

but no code could run the tool!!!

What does that mean? Which error message did you get? You will have to be more specific if you expect help. What is the output of conda list?

Hi, sorry for being unspecific ...Trimmomatic is shown in the conda list output, which confirmed that I have Trimmomatic in my environment.

run Trimmomatic showed me this output;

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>...

So I think I need to go through the trimmomatic guide to more understand these terms.

Thanks

What you are looking at is in-line help that trimmomatic provides. It is giving you a clue as to what you minimally need in your command line. Generally things in <> are optional. Here is an example of what a real command looks like:

trimmomatic PE -threads 4 SRR_1056_1.fastq SRR_1056_2.fastq  \
              SRR_1056_1.trimmed.fastq SRR_1056_1un.trimmed.fastq \
              SRR_1056_2.trimmed.fastq SRR_1056_2un.trimmed.fastq \
              ILLUMINACLIP:adapters.fa SLIDINGWINDOW:4:20

\ in command line is used to wrap the command on multiple lines. That is not necessary when you type the command out. This example is for paired-end data. If you have single-end reads then things would change some.

trimmomatic SE -threads 4 SRR_1056.fastq \
              SRR_1056.trimmed.fastq SRR_1056_un.trimmed.fastq \
              ILLUMINACLIP:SRR_adapters.fa SLIDINGWINDOW:4:20

thanks for your explanation

Hi genomax,

I activated my python-based environment in mac terminal. And using the Trimmomatic code:

trimmomatic PE -threads 4 SRR_292770_1.fastq SRR_292770_2.fastq \ SRR_292770_1.trimmed.fastq SRR_292770_1un.trimmed.fastq \ SRR_292770_2.trimmed.fastq SRR_292770_2un.trimmed.fastq \ ILLUMINACLIP:adapters.fa SLIDINGWINDOW:4:20

showed me this error; ^ SyntaxError: invalid syntax

I wonder where is the problem!!

Make sure you are using proper hypens and underscores. macOS has something called smartquotes and dashes. Turn them off under System pref -> Keyboard -> text and then re-type the command and see if that helps. Your command looks good otherwise.

So I think I need to go through the trimmomatic guide to more understand these terms.

Yes, that's usually the best idea to start there before diving in trying out a new tool.

I mean how to launch the Trimmomatic tool using Mac terminal.

There is no graphical interface to launch, if that is what you are expecting.

Actually I meant to start the tool..what command or code should I write in the terminal, after activating the environment

You can simply go into the bin folder of your anaconda and check how exactly the tool is named.

1 answer

After installation with conda the executable is named trimmomatic.

Log in to answer this question.