This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trimmomatic unknown trimmer

Hi all,

I am really struggling with Trimmomatic these days and getting confused. I'm trying to run trimmomatic:

java -jar trimmomatic-0.39.jar PE -threads 2 -phred33 \ ly1_1.fq ly1_2.fq \ ly1_paired_1.trimmed.fq ly1_unpaired_1.trimmed.fq ly1_paired_2.trimmed.fq ly1_unpaired_2.trimmed.fq HEADCROP:9

This is my error:

        TrimmomaticPE: Started with arguments:`
-threads 2 -phred64  ly1_1.fq ly1_2.fq  ly1_paired_1.trimmed.fq ly1_unpaired_1.trimmed.fq ly1_paired_2.trimmed.fq ly1_unpaired_2.trimmed.fq HEADCROP:9
Exception in thread "main" java.io.FileNotFoundException:  ly1_1.fq (No such file or directory)`
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at org.usadellab.trimmomatic.fastq.FastqParser.parse(FastqParser.java:135)
        at org.usadellab.trimmomatic.TrimmomaticPE.process(TrimmomaticPE.java:265)
        at org.usadellab.trimmomatic.TrimmomaticPE.run(TrimmomaticPE.java:555)
        at org.usadellab.trimmomatic.Trimmomatic.main(Trimmomatic.java:80)

Any help would be appreciated.

trimmomatic

1 answer

The error is that trimmomatic cannot find your input file.

see the last part of the second line of the error message:

  ly1_1.fq (No such file or directory)`

But it exactly exists in my mobile HDD.

Are the reads files located within your working directory? Try providing the full paths to the reads files.

I have fixed that. But when I input the command:

[root@localhost TOSHIBA EXT]# java -jar /home/yun/Downloads/Trimmomatic-0.39/trimmomatic-0.39.jar PE -threads 2 -phred33 ly1_1.fq ly1_2.fq \ly1_paired_1.trim.fq.gz ly1_unpaired_1.trim.fq.gz ly1_paired_2.trim.fq.gz ly1_unpaired_2.trim.fq,gz \ HEADCROP:9 

This is another error:

 TrimmomaticPE: Started with arguments:
 -threads 2 -phred33 ly1_1.fq ly1_2.fq ly1_paired_1.trim.fq.gz ly1_unpaired_1.trim.fq.gz ly1_paired_2.trim.fq.gz ly1_unpaired_2.trim.fq,gz  HEADCROP:9
Exception in thread "main" java.lang.RuntimeException: Unknown trimmer:  HEADCROP
    at org.usadellab.trimmomatic.trim.TrimmerFactory.makeTrimmer(TrimmerFactory.java:73)
    at org.usadellab.trimmomatic.Trimmomatic.createTrimmers(Trimmomatic.java:59)
    at org.usadellab.trimmomatic.TrimmomaticPE.run(TrimmomaticPE.java:552)
    at org.usadellab.trimmomatic.Trimmomatic.main(Trimmomatic.java:80)

Not sure what your issue is then. I installed trimmomatic via conda and ran the following, which worked:

trimmomatic PE in.R1.fq.gz  in.R2.fq.gz  out.paired.R1.fq.gz out.unpaired.R1.fq.gz out.paired.R2.fq.gz out.unpaired.R2.fq.gz HEADCROP:9

I also tried a simplified version, which worked:

trimmomatic PE in.R1.fq.gz  in.R2.fq.gz  -baseout sampleFiltered.fq.gz HEADCROP:9

Thanks a lot! I think I have done it well.

java -jar /home/yun/Downloads/Trimmomatic-0.39/trimmomatic-0.39.jar PE ly1_1.fq ly1_2.fq -baseout sampleFiltered.fq.gz HEADCROP:9

I think maybe there is something wrong in output file name.

I'm wondering if it is anything to do with the \ charactors you have in there. That is I wonder if my using \ you are forcing it to include the following space in the name of the trimmer. So it is looking for " HEADCROP" rather than "HEADCROP"

Log in to answer this question.