Trimmomatic: Unknown trimmer error
0
0
Entering edit mode
11 months ago
foxiw ▴ 10

I'm trying to trun trimmomatic on all of my fastq files at the same time, this is my command:

trimmomatic SE Samplemerge.fastq.gz Sample_trimmed.fastq.gz ILLUMINACLIP:/mnt/scratch/c1818206/fastqs/merged_files/AdaptorsIF-SE.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15

However, I get this error message:

TrimmomaticSE: Started with arguments: Sample10merge.fastq.gz Sample11merge.fastq.gz Sample12merge.fastq.gz Sample13merge.fastq.gz Sample1merge.fastq.gz Sample2merge.fastq.gz Sample3merge.fastq.gz Sample4merge.fastq.gz Sample5merge.fastq.gz Sample6merge.fastq.gz Sample7merge.fastq.gz Sample8merge.fastq.gz Sample9merge.fastq.gz Sample*_trimmed.fastq.gz ILLUMINACLIP:/mnt/scratch/c1818206/fastqs/merged_files/AdaptorsIF-SE.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 Automatically using 4 threads Exception in thread "main" java.lang.RuntimeException: Unknown trimmer: Sample12merge.fastq.gz at org.usadellab.trimmomatic.trim.TrimmerFactory.makeTrimmer(TrimmerFactory.java:73) at org.usadellab.trimmomatic.Trimmomatic.createTrimmers(Trimmomatic.java:59) at org.usadellab.trimmomatic.TrimmomaticSE.run(TrimmomaticSE.java:318) at org.usadellab.trimmomatic.Trimmomatic.main(Trimmomatic.java:85)

I'm not sure what this means? If I run trimmomatic on my files individually it works, so why doesn't it work when I try to run them together? Thanks!

fastq trimmomatic RNA-seq • 594 views
0
Entering edit mode

Hi,

You said that you are running trimmomatic on all your fastq files at the same time, but in the command-line provided you only give one input fastq file. Is this (Samplemerge.fastq.gz) a combined fastq file with all your fastq files? Or are you actually providing all the fastq files as input? (like this: trimmomatic SE Sample10merge.fastq.gz Sample11merge.fastq.gz Sample12merge.fastq.gz ...)

If you're using the second option, from the documentation, I don't see how is this possible. I don't think that you can pass multiple fastq files as input. If you're using the single-end option trimmomatic SE, it only takes one fastq file as input and a second one as output. Therefore, what I think the program is doing is the following: it assumes that the 1st fastq file giving Sample10merge.fastq.gz is your input, and the second Sample11merge.fastq.gz is your output, and the 3rd - Sample12merge.fastq.gz - is atrimmomatic parameter, which we know that it's not, and that's why I think you're getting Unknown trimmer, because it only accepts 2 fastq files, everything else should be a parameter.

I hope this helps,

António

0
Entering edit mode

Hi Antonio,

I see the problem now. There is a copy/paste error - I tried to write the input as 'Samplemerge.fastq.gz' wherein the asterisk replaces the number ID of each file. My output file name was 'Sample_trimmed.fastq.gz' wherein I was hoping trimmomatic would take all of my sample files, trim them, and provide output files as _trimmed.fastq.gz for each of my inputs. From what you have said though, I see that that is not possible to do this way. However could you tell me if there is a way to run trimmomatic as a loop so that it does all of my files without me having to do them manually one after the other? Thanks.

1
Entering edit mode

Assuming that all your fastq files to trim are under the same folder, and you want to trim them all, and the ouput will be generated into the same folder, you can do a simple bash for loop (under this folder):

SAMPLES=ls *.fastq.gz
for i in $SAMPLES; do echo "Processing sample$i into ${i%%.*}_trimmed.fastq.gz ..." trimmomatic SE$i ${i%%.*}_trimmed.fastq.gz ILLUMINACLIP:/mnt/scratch/c1818206/fastqs/merged_files/AdaptorsIF-SE.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15; done;   This can be a bash script or run directly into the shell. The variable $i will be your input, i.e., Sample10merge.fastq.gz Sample11merge.fastq.gz ..., and \${i%%.*}_trimmed.fastq.gz` will be your output, i.e., Sample10merge_trimmed.fastq.gz Sample11merge_trimmed.fastq.gz ....

I hope this helps,

António

0
Entering edit mode

That's fantastic! Thanks, Antonio!

0
Entering edit mode

There is still no astrisk in my text haha. sorry if that is confusing.