diff --git a/modules/nf-core/trimgalore/environment.yml b/modules/nf-core/trimgalore/environment.yml index 60b33ef21074..b2b79fe33692 100644 --- a/modules/nf-core/trimgalore/environment.yml +++ b/modules/nf-core/trimgalore/environment.yml @@ -5,3 +5,4 @@ channels: - bioconda dependencies: - bioconda::trim-galore=0.6.10 + - bioconda::cutadapt=5.2 diff --git a/modules/nf-core/trimgalore/main.nf b/modules/nf-core/trimgalore/main.nf index 0553bb54c4c8..d019d077e43a 100644 --- a/modules/nf-core/trimgalore/main.nf +++ b/modules/nf-core/trimgalore/main.nf @@ -46,6 +46,9 @@ process TRIMGALORE { def args_list = args.split("\\s(?=--)").toList() args_list.removeAll { arg -> arg.toLowerCase().contains('_r2 ') } """ + # Remove any trim_galore outputs left behind by a previous attempt that + # ran in this same workdir (e.g. AWS Batch retry after a Spot reclaim). + rm -f *.fq.gz *.html *.zip *_trimming_report.txt [ ! -f ${prefix}.fastq.gz ] && ln -s ${reads} ${prefix}.fastq.gz trim_galore \\ ${args_list.join(' ')} \\ @@ -56,6 +59,9 @@ process TRIMGALORE { } else { """ + # Remove any trim_galore outputs left behind by a previous attempt that + # ran in this same workdir (e.g. AWS Batch retry after a Spot reclaim). + rm -f *.fq.gz *.html *.zip *_trimming_report.txt [ ! -f ${prefix}_1.fastq.gz ] && ln -s ${reads[0]} ${prefix}_1.fastq.gz [ ! -f ${prefix}_2.fastq.gz ] && ln -s ${reads[1]} ${prefix}_2.fastq.gz trim_galore \\ diff --git a/modules/nf-core/trimgalore/tests/main.nf.test b/modules/nf-core/trimgalore/tests/main.nf.test index ac97b087142b..0833eafd25db 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test +++ b/modules/nf-core/trimgalore/tests/main.nf.test @@ -27,7 +27,7 @@ nextflow_process { { assert snapshot( process.out.reads, file(process.out.log[0][1]).readLines()[0..9], // line 11 changes - file(process.out.log[0][1]).readLines()[11..59], + file(process.out.log[0][1]).readLines()[11..59].findAll { !it.startsWith("This is cutadapt") }, // strip python version process.out.findAll { key, val -> key.startsWith("versions")} ).match() } ) @@ -56,9 +56,9 @@ nextflow_process { process.out.reads[0][1][0], process.out.reads[0][1][1], file(process.out.log[0][1][0]).readLines()[0..9], // line 11 changes - file(process.out.log[0][1][0]).readLines()[11..58], + file(process.out.log[0][1][0]).readLines()[11..58].findAll { !it.startsWith("This is cutadapt") }, // strip python version file(process.out.log[0][1][1]).readLines()[0..9], // line 11 changes - file(process.out.log[0][1][1]).readLines()[11..60], + file(process.out.log[0][1][1]).readLines()[11..60].findAll { !it.startsWith("This is cutadapt") }, // strip python version process.out.findAll { key, val -> key.startsWith("versions")} ).match() } ) @@ -95,9 +95,9 @@ nextflow_process { process.out.unpaired[0][1][0], process.out.unpaired[0][1][1], file(process.out.log[0][1][0]).readLines()[0..9], // line 11 changes - file(process.out.log[0][1][0]).readLines()[11..59], + file(process.out.log[0][1][0]).readLines()[11..59].findAll { !it.startsWith("This is cutadapt") }, // strip python version file(process.out.log[0][1][1]).readLines()[0..9], // line 11 changes - file(process.out.log[0][1][1]).readLines()[11..63], + file(process.out.log[0][1][1]).readLines()[11..63].findAll { !it.startsWith("This is cutadapt") }, // strip python version process.out.findAll { key, val -> key.startsWith("versions")} ).match() } ) diff --git a/modules/nf-core/trimgalore/tests/main.nf.test.snap b/modules/nf-core/trimgalore/tests/main.nf.test.snap index 2fb55f2d3936..8447b4bc2bdc 100644 --- a/modules/nf-core/trimgalore/tests/main.nf.test.snap +++ b/modules/nf-core/trimgalore/tests/main.nf.test.snap @@ -70,7 +70,6 @@ "Output file will be GZIP compressed", "", "", - "This is cutadapt 5.2 with Python 3.12.12", "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_1.fastq.gz", "Processing single-end reads on 1 core ...", "", @@ -133,7 +132,6 @@ "Output file will be GZIP compressed", "", "", - "This is cutadapt 5.2 with Python 3.12.12", "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_2.fastq.gz", "Processing single-end reads on 1 core ...", "", @@ -254,7 +252,6 @@ "Output file will be GZIP compressed", "", "", - "This is cutadapt 5.2 with Python 3.12.12", "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_1.fastq.gz", "Processing single-end reads on 1 core ...", "", @@ -316,7 +313,6 @@ "Output file will be GZIP compressed", "", "", - "This is cutadapt 5.2 with Python 3.12.12", "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test_2.fastq.gz", "Processing single-end reads on 1 core ...", "", @@ -407,7 +403,6 @@ "Output file will be GZIP compressed", "", "", - "This is cutadapt 5.2 with Python 3.12.12", "Command line parameters: -j 1 -e 0.1 -q 20 -O 1 -a AGATCGGAAGAGC test.fastq.gz", "Processing single-end reads on 1 core ...", "",