diff --git a/modules/nf-core/td2/longorfs/environment.yml b/modules/nf-core/td2/longorfs/environment.yml new file mode 100644 index 00000000000..db97153a88d --- /dev/null +++ b/modules/nf-core/td2/longorfs/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::td2=1.0.6" diff --git a/modules/nf-core/td2/longorfs/main.nf b/modules/nf-core/td2/longorfs/main.nf new file mode 100644 index 00000000000..bf6e9f389da --- /dev/null +++ b/modules/nf-core/td2/longorfs/main.nf @@ -0,0 +1,43 @@ +process TD2_LONGORFS { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/41/4155bf3b720e1e32d0615a947696fb0287ee4e8cdbeb4ec784dd4da7bb5b2e86/data': + "community.wave.seqera.io/library/td2:1.0.6--ea3e5ac09443b677"}" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("${prefix}/longest_orfs.{cds,gff3,pep}"), emit: orfs + tuple val("${task.process}"), val('TD2.LongOrfs'), eval("echo td2: ${VERSION}"), emit: versions_td2, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + VERSION = 'v1.0.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + prefix = task.ext.prefix ?: "${meta.id}" + + """ + TD2.LongOrfs \\ + -t ${fasta} \\ + -O ${prefix} \\ + --threads ${task.cpus} \\ + ${args} + """ + + stub: + VERSION = 'v1.0.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix}/ + touch ${prefix}/longest_orfs.cds + touch ${prefix}/longest_orfs.gff3 + touch ${prefix}/longest_orfs.pep + """ +} diff --git a/modules/nf-core/td2/longorfs/meta.yml b/modules/nf-core/td2/longorfs/meta.yml new file mode 100644 index 00000000000..7ddeedfb29a --- /dev/null +++ b/modules/nf-core/td2/longorfs/meta.yml @@ -0,0 +1,67 @@ +name: "td2_longorfs" +description: TD2 identifies candidate coding regions within transcript + sequences, such as those generated by de novo RNA-Seq transcript assembly +keywords: + - td2 + - orfs + - longorfs + - transcripts +tools: + - td2: + description: "TD2 identifies candidate coding regions within transcript sequences, + such as those generated by de novo RNA-Seq transcript assembly" + homepage: "https://github.com/Markusjsommer/TD2" + documentation: "https://github.com/Markusjsommer/TD2" + tool_dev_url: "https://github.com/Markusjsommer/TD2" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Fasta file containing the target transcript sequences + pattern: "*.{fasta}" + ontologies: [] +output: + orfs: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - ${prefix}/longest_orfs.{cds,gff3,pep}: + type: file + description: Files containing the longest ORFs predicted from the input + transcript sequences + pattern: "${prefix}/longest_orfs.{cds,gff3,pep}" + ontologies: [] + versions_td2: + - - ${task.process}: + type: string + description: The process the versions were collected from + - TD2.LongOrfs: + type: string + description: The tool name + - "echo td2: ${VERSION}": + type: string + description: The version of TD2 used +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - TD2.LongOrfs: + type: string + description: The tool name + - "echo td2: ${VERSION}": + type: string + description: The version of TD2 used +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/td2/longorfs/tests/main.nf.test b/modules/nf-core/td2/longorfs/tests/main.nf.test new file mode 100644 index 00000000000..9f76f25c345 --- /dev/null +++ b/modules/nf-core/td2/longorfs/tests/main.nf.test @@ -0,0 +1,64 @@ +nextflow_process { + + name "Test Process TD2_LONGORFS" + script "../main.nf" + process "TD2_LONGORFS" + + tag "modules" + tag "modules_nfcore" + tag "td2" + tag "td2/longorfs" + + test("td2.longorfs - transcriptome.fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test_td2_longorfs' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/transcriptome.fasta', checkIfExists: true), + ] + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + + } + + test("td2.longorfs - transcriptome.fasta -stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test_td2_longorfs' ], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/transcriptome.fasta', checkIfExists: true), + ] + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/td2/longorfs/tests/main.nf.test.snap b/modules/nf-core/td2/longorfs/tests/main.nf.test.snap new file mode 100644 index 00000000000..aa8376128b7 --- /dev/null +++ b/modules/nf-core/td2/longorfs/tests/main.nf.test.snap @@ -0,0 +1,118 @@ +{ + "td2.longorfs - transcriptome.fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test_td2_longorfs" + }, + [ + "longest_orfs.cds:md5,4226fe196a4527f938e25061ffe7eaf6", + "longest_orfs.gff3:md5,864ae9147b65d07eb9d79c0e42968e12", + "longest_orfs.pep:md5,0151dac6998be924139a4f5a5a0c590b" + ] + ] + ], + "1": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ], + "orfs": [ + [ + { + "id": "test_td2_longorfs" + }, + [ + "longest_orfs.cds:md5,4226fe196a4527f938e25061ffe7eaf6", + "longest_orfs.gff3:md5,864ae9147b65d07eb9d79c0e42968e12", + "longest_orfs.pep:md5,0151dac6998be924139a4f5a5a0c590b" + ] + ] + ], + "versions_td2": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ] + }, + { + "versions_td2": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-04T21:11:35.499924547" + }, + "td2.longorfs - transcriptome.fasta -stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_td2_longorfs" + }, + [ + "longest_orfs.cds:md5,d41d8cd98f00b204e9800998ecf8427e", + "longest_orfs.gff3:md5,d41d8cd98f00b204e9800998ecf8427e", + "longest_orfs.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ], + "orfs": [ + [ + { + "id": "test_td2_longorfs" + }, + [ + "longest_orfs.cds:md5,d41d8cd98f00b204e9800998ecf8427e", + "longest_orfs.gff3:md5,d41d8cd98f00b204e9800998ecf8427e", + "longest_orfs.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions_td2": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ] + }, + { + "versions_td2": [ + [ + "TD2_LONGORFS", + "TD2.LongOrfs", + "td2: v1.0.6" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-04T21:13:55.06359889" + } +} \ No newline at end of file diff --git a/modules/nf-core/td2/predict/environment.yml b/modules/nf-core/td2/predict/environment.yml new file mode 100644 index 00000000000..db97153a88d --- /dev/null +++ b/modules/nf-core/td2/predict/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::td2=1.0.6" diff --git a/modules/nf-core/td2/predict/main.nf b/modules/nf-core/td2/predict/main.nf new file mode 100644 index 00000000000..78a444d6d4d --- /dev/null +++ b/modules/nf-core/td2/predict/main.nf @@ -0,0 +1,47 @@ +process TD2_PREDICT { + tag "$meta.id" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/41/4155bf3b720e1e32d0615a947696fb0287ee4e8cdbeb4ec784dd4da7bb5b2e86/data': + "community.wave.seqera.io/library/td2:1.0.6--ea3e5ac09443b677"}" + + input: + tuple val(meta), path(fasta), path(orfs_dir, stageAs: 'orfs') + + output: + tuple val(meta), path("${prefix}/*.TD2.{bed,cds,gff3,pep}"), emit: predictions + tuple val("${task.process}"), val('TD2.Predict'), eval("echo td2: ${VERSION}"), emit: versions_td2, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + VERSION = 'v1.0.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix}/ + + TD2.Predict \\ + -t ${fasta} \\ + -O ${orfs_dir} \\ + ${args} + + mv *.TD2.{bed,cds,gff3,pep} ${prefix}/ + """ + + stub: + VERSION = 'v1.0.6' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir -p ${prefix}/ + touch ${prefix}/fakefile.TD2.bed + touch ${prefix}/fakefile.TD2.cds + touch ${prefix}/fakefile.TD2.gff3 + touch ${prefix}/fakefile.TD2.pep + """ +} diff --git a/modules/nf-core/td2/predict/meta.yml b/modules/nf-core/td2/predict/meta.yml new file mode 100644 index 00000000000..43bdbb5f71c --- /dev/null +++ b/modules/nf-core/td2/predict/meta.yml @@ -0,0 +1,73 @@ +name: "td2_predict" +description: TD2 identifies candidate coding regions within transcript + sequences, such as those generated by de novo RNA-Seq transcript assembly +keywords: + - predict + - orfs + - coding regions + - td2.predict +tools: + - "td2": + description: "TD2 identifies candidate coding regions within transcript sequences, + such as those generated by de novo RNA-Seq transcript assembly" + homepage: "https://github.com/Markusjsommer/TD2" + documentation: "https://github.com/Markusjsommer/TD2" + tool_dev_url: "https://github.com/Markusjsommer/TD2" + licence: ["MIT"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: Transcripts fasta file + pattern: "*.{fasta}" + ontologies: [] + - orfs_dir: + type: file + description: Directory containing the ORF prediction files generated by + the `td2_longorfs` module + pattern: "orfs_dir/" + ontologies: [] +output: + predictions: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - ${prefix}/*.TD2.{bed,cds,gff3,pep}: + type: file + description: Files containing the TD2 ORF predictions for the input + transcript sequences + pattern: "${prefix}/*.TD2.{bed,cds,gff3,pep}" + ontologies: [] + versions_td2: + - - ${task.process}: + type: string + description: The process the versions were collected from + - TD2.Predict: + type: string + description: The tool name + - "echo td2: ${VERSION}": + type: string + description: The version of TD2 used +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - TD2.Predict: + type: string + description: The tool name + - "echo td2: ${VERSION}": + type: string + description: The version of TD2 used +authors: + - "@khersameesh24" +maintainers: + - "@khersameesh24" diff --git a/modules/nf-core/td2/predict/tests/main.nf.test b/modules/nf-core/td2/predict/tests/main.nf.test new file mode 100644 index 00000000000..4f3bb30eda2 --- /dev/null +++ b/modules/nf-core/td2/predict/tests/main.nf.test @@ -0,0 +1,79 @@ +nextflow_process { + + name "Test Process TD2_PREDICT" + script "../main.nf" + process "TD2_PREDICT" + + tag "modules" + tag "modules_nfcore" + tag "td2" + tag "td2/longorfs" + tag "td2/predict" + + setup { + run("TD2_LONGORFS") { + script "modules/nf-core/td2/longorfs/main.nf" + process { + """ + input[0] = [ + [id:'test_td2_predict'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + } + + test("td2.predict - transcriptome.fasta") { + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test_td2_predict'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]).combine(TD2_LONGORFS.out.orfs.map{ meta, orfs -> return [meta, file(orfs[0].getParent())] }, by: 0) + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + + } + + test("td2.predict - transcriptome.fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = Channel.of([ + [id: 'test_td2_predict'], + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true) + ]).combine(TD2_LONGORFS.out.orfs.map{ meta, orfs -> return [meta, file(orfs[0].getParent())] }, by: 0) + """ + } + } + + then { + assert process.success + assertAll( + { assert snapshot( + process.out, + process.out.findAll { key, val -> key.startsWith("versions")} + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/td2/predict/tests/main.nf.test.snap b/modules/nf-core/td2/predict/tests/main.nf.test.snap new file mode 100644 index 00000000000..d366015e16a --- /dev/null +++ b/modules/nf-core/td2/predict/tests/main.nf.test.snap @@ -0,0 +1,122 @@ +{ + "td2.predict - transcriptome.fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test_td2_predict" + }, + [ + "genome.fasta.TD2.bed:md5,2504559bdf4e321bc0612573be0a1eb6", + "genome.fasta.TD2.cds:md5,e3f601c2ab4e9513b6577bbcdc19fda5", + "genome.fasta.TD2.gff3:md5,0e4fd0095da808937192caee48fe47d5", + "genome.fasta.TD2.pep:md5,390c241ee523756f3cd81b3cf2fa62ac" + ] + ] + ], + "1": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ], + "predictions": [ + [ + { + "id": "test_td2_predict" + }, + [ + "genome.fasta.TD2.bed:md5,2504559bdf4e321bc0612573be0a1eb6", + "genome.fasta.TD2.cds:md5,e3f601c2ab4e9513b6577bbcdc19fda5", + "genome.fasta.TD2.gff3:md5,0e4fd0095da808937192caee48fe47d5", + "genome.fasta.TD2.pep:md5,390c241ee523756f3cd81b3cf2fa62ac" + ] + ] + ], + "versions_td2": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ] + }, + { + "versions_td2": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-04T21:17:11.987007488" + }, + "td2.predict - transcriptome.fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test_td2_predict" + }, + [ + "fakefile.TD2.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.cds:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.gff3:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "1": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ], + "predictions": [ + [ + { + "id": "test_td2_predict" + }, + [ + "fakefile.TD2.bed:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.cds:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.gff3:md5,d41d8cd98f00b204e9800998ecf8427e", + "fakefile.TD2.pep:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ] + ], + "versions_td2": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ] + }, + { + "versions_td2": [ + [ + "TD2_PREDICT", + "TD2.Predict", + "td2: v1.0.6" + ] + ] + } + ], + "meta": { + "nf-test": "0.9.3", + "nextflow": "25.10.2" + }, + "timestamp": "2025-12-04T21:19:34.49914593" + } +} \ No newline at end of file