diff --git a/modules/nf-core/transdecoder/longorf/main.nf b/modules/nf-core/transdecoder/longorf/main.nf index 3dea0641dc9..5524c6d9e28 100644 --- a/modules/nf-core/transdecoder/longorf/main.nf +++ b/modules/nf-core/transdecoder/longorf/main.nf @@ -40,17 +40,15 @@ process TRANSDECODER_LONGORF { """ stub: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" def fasta_no_gz = fasta.toString() - '.gz' output_dir_name = "${meta.id}/${fasta_no_gz}.transdecoder_dir" """ mkdir -p $output_dir_name - touch $output_dir_name/longest_orfs.pep - touch $output_dir_name/longest_orfs.gff3 - touch $output_dir_name/longest_orfs.cds - touch $output_dir_name/base_freqs.dat + touch ${output_dir_name}/longest_orfs.pep + touch ${output_dir_name}/longest_orfs.gff3 + touch ${output_dir_name}/longest_orfs.cds + touch ${output_dir_name}/base_freqs.dat cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/transdecoder/predict/environment.yml b/modules/nf-core/transdecoder/predict/environment.yml index 2484d15af09..19be873fc94 100644 --- a/modules/nf-core/transdecoder/predict/environment.yml +++ b/modules/nf-core/transdecoder/predict/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::transdecoder=5.5.0 + - bioconda::transdecoder=5.7.1 diff --git a/modules/nf-core/transdecoder/predict/main.nf b/modules/nf-core/transdecoder/predict/main.nf index 7d56a79da47..ceec55018dc 100644 --- a/modules/nf-core/transdecoder/predict/main.nf +++ b/modules/nf-core/transdecoder/predict/main.nf @@ -4,8 +4,8 @@ process TRANSDECODER_PREDICT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/transdecoder:5.5.0--pl5262hdfd78af_4': - 'quay.io/comp-bio-aging/transdecoder' }" + 'https://depot.galaxyproject.org/singularity/transdecoder:5.7.1--pl5321hdfd78af_0': + 'biocontainers/transdecoder:5.7.1--pl5321hdfd78af_0' }" input: tuple val(meta), path(fasta) @@ -23,12 +23,10 @@ process TRANSDECODER_PREDICT { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" - """ TransDecoder.Predict \\ $args \\ - -O ${prefix} \\ + -O . \\ -t \\ $fasta @@ -37,4 +35,18 @@ process TRANSDECODER_PREDICT { transdecoder: \$(echo \$(TransDecoder.Predict --version) | sed -e "s/TransDecoder.Predict //g") END_VERSIONS """ + + stub: + def fasta_no_gz = fasta.toString() - '.gz' + """ + touch ${fasta_no_gz}.transdecoder.pep + touch ${fasta_no_gz}.transdecoder.gff3 + touch ${fasta_no_gz}.transdecoder.cds + touch ${fasta_no_gz}.transdecoder.bed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + transdecoder: \$(echo \$(TransDecoder.Predict --version) | sed -e "s/TransDecoder.Predict //g") + END_VERSIONS + """ } diff --git a/modules/nf-core/transdecoder/predict/tests/main.nf.test b/modules/nf-core/transdecoder/predict/tests/main.nf.test new file mode 100644 index 00000000000..7a5b1b29670 --- /dev/null +++ b/modules/nf-core/transdecoder/predict/tests/main.nf.test @@ -0,0 +1,140 @@ +nextflow_process { + + name "Test Process TRANSDECODER_PREDICT" + script "../main.nf" + process "TRANSDECODER_PREDICT" + + tag "modules" + tag "modules_nfcore" + tag "transdecoder" + tag "transdecoder/longorf" + tag "transdecoder/predict" + + test("sarscov2 - uncompressed") { + + setup { + run("TRANSDECODER_LONGORF") { + script "../../longorf/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[1] = TRANSDECODER_LONGORF.out.folder + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + // orfs are output in a random order; can't be easily sorted either. + path(process.out.bed[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.cds[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.gff3[0][1]).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.pep[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - compressed") { + + setup { + run("TRANSDECODER_LONGORF") { + script "../../longorf/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true) + ] + input[1] = TRANSDECODER_LONGORF.out.folder + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + // orfs are output in a random order; can't be easily sorted either. + path(process.out.bed[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.cds[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.gff3[0][1]).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + path(process.out.pep[0][1] ).getText().contains("ID=GENE.MT192765.1~~MT192765.1.p7"), + process.out.versions + ).match() } + ) + } + + } + + test("sarscov2 - uncompressed - stub") { + + options "-stub" + + setup { + run("TRANSDECODER_LONGORF") { + script "../../longorf/main.nf" + process { + """ + input[0] = [ + [id: 'test'], + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + when { + process { + """ + input[0] = [ + [ id:'test', single_end:false ], // meta map + file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + input[1] = TRANSDECODER_LONGORF.out.folder + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} diff --git a/modules/nf-core/transdecoder/predict/tests/main.nf.test.snap b/modules/nf-core/transdecoder/predict/tests/main.nf.test.snap new file mode 100644 index 00000000000..62d1a2d0c9a --- /dev/null +++ b/modules/nf-core/transdecoder/predict/tests/main.nf.test.snap @@ -0,0 +1,123 @@ +{ + "sarscov2 - uncompressed - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.cds:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "4": [ + "versions.yml:md5,d68aca63cf424e1cc9f544b5b3aa9c99" + ], + "bed": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.bed:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "cds": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.cds:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "gff3": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.gff3:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "pep": [ + [ + { + "id": "test", + "single_end": false + }, + "genome.fasta.transdecoder.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,d68aca63cf424e1cc9f544b5b3aa9c99" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-13T19:14:55.271439958" + }, + "sarscov2 - uncompressed": { + "content": [ + false, + false, + true, + false, + [ + "versions.yml:md5,d68aca63cf424e1cc9f544b5b3aa9c99" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-14T17:04:13.113096174" + }, + "sarscov2 - compressed": { + "content": [ + false, + false, + true, + false, + [ + "versions.yml:md5,d68aca63cf424e1cc9f544b5b3aa9c99" + ] + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.3" + }, + "timestamp": "2025-01-14T17:00:33.707348893" + } +} \ No newline at end of file diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a2300fb29f3..d5738b76e73 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -585,9 +585,6 @@ svtk/vcf2bed: topas/gencons: - modules/nf-core/topas/gencons/** - tests/modules/nf-core/topas/gencons/** -transdecoder/predict: - - modules/nf-core/transdecoder/predict/** - - tests/modules/nf-core/transdecoder/predict/** truvari/bench: - modules/nf-core/truvari/bench/** - tests/modules/nf-core/truvari/bench/** diff --git a/tests/modules/nf-core/transdecoder/predict/main.nf b/tests/modules/nf-core/transdecoder/predict/main.nf deleted file mode 100644 index 91bcf879d4b..00000000000 --- a/tests/modules/nf-core/transdecoder/predict/main.nf +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { TRANSDECODER_PREDICT } from '../../../../../modules/nf-core/transdecoder/predict/main.nf' -include { TRANSDECODER_LONGORF } from '../../../../../modules/nf-core/transdecoder/longorf/main.nf' - -workflow test_transdecoder_predict { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)] - - TRANSDECODER_LONGORF ( input ) - TRANSDECODER_PREDICT ( input, TRANSDECODER_LONGORF.out.folder ) - -} - -workflow test_transdecoder_predict_gz_input { - - input = [ - [ id:'test', single_end:false ], // meta map - file(params.test_data['sarscov2']['genome']['genome_fasta_gz'], checkIfExists: true)] - - TRANSDECODER_LONGORF ( input ) - TRANSDECODER_PREDICT ( input, TRANSDECODER_LONGORF.out.folder ) - -} diff --git a/tests/modules/nf-core/transdecoder/predict/nextflow.config b/tests/modules/nf-core/transdecoder/predict/nextflow.config deleted file mode 100644 index 50f50a7a357..00000000000 --- a/tests/modules/nf-core/transdecoder/predict/nextflow.config +++ /dev/null @@ -1,5 +0,0 @@ -process { - - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - -} \ No newline at end of file diff --git a/tests/modules/nf-core/transdecoder/predict/test.yml b/tests/modules/nf-core/transdecoder/predict/test.yml deleted file mode 100644 index 1339746dde9..00000000000 --- a/tests/modules/nf-core/transdecoder/predict/test.yml +++ /dev/null @@ -1,25 +0,0 @@ -- name: transdecoder predict test_transdecoder_predict - command: nextflow run ./tests/modules/nf-core/transdecoder/predict -entry test_transdecoder_predict -c ./tests/config/nextflow.config - tags: - - transdecoder - - transdecoder/predict - files: - - path: output/transdecoder/genome.fasta.transdecoder.bed - - path: output/transdecoder/genome.fasta.transdecoder.cds - - path: output/transdecoder/genome.fasta.transdecoder.gff3 - - path: output/transdecoder/genome.fasta.transdecoder.pep - - path: output/transdecoder/versions.yml - md5sum: 2847cc159dc93e9014b57d76987623ea - -- name: transdecoder predict test_transdecoder_predict_gz_input - command: nextflow run ./tests/modules/nf-core/transdecoder/predict -entry test_transdecoder_predict_gz_input -c ./tests/config/nextflow.config - tags: - - transdecoder - - transdecoder/predict - files: - - path: output/transdecoder/genome.fasta.transdecoder.bed - - path: output/transdecoder/genome.fasta.transdecoder.cds - - path: output/transdecoder/genome.fasta.transdecoder.gff3 - - path: output/transdecoder/genome.fasta.transdecoder.pep - - path: output/transdecoder/versions.yml - md5sum: e035a36b6a65a255d738d6bbdcb77f07