From 0265d4d857b3989f328a82140b9793e01c77682f Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Mon, 18 May 2026 18:16:11 +0100 Subject: [PATCH 01/12] Initial commit of TRF module --- modules/ensembl/features/trf/environment.yml | 5 +++ modules/ensembl/features/trf/main.nf | 43 ++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 modules/ensembl/features/trf/environment.yml create mode 100644 modules/ensembl/features/trf/main.nf diff --git a/modules/ensembl/features/trf/environment.yml b/modules/ensembl/features/trf/environment.yml new file mode 100644 index 00000000..54eb1738 --- /dev/null +++ b/modules/ensembl/features/trf/environment.yml @@ -0,0 +1,5 @@ +channels: + - conda-forge + - bioconda +dependencies: + - trf=4.09.1 \ No newline at end of file diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf new file mode 100644 index 00000000..9dbb4227 --- /dev/null +++ b/modules/ensembl/features/trf/main.nf @@ -0,0 +1,43 @@ +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +process TANDEM_REPEATS_FINDER { + tag "${meta.id}" + label 'process_medium' + + conda "${moduleDir}/environment.yml" + container "quay.io/biocontainers/trf:4.09.1--h7b50bb2_7" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.dat"), emit: dat + tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+'"), emit: versions_trf, topic: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args task.ext.args ?: '2 7 7 80 10 100 500' + """ + trf '${fasta}' ${args} -d -h + """ + + stub: + """ + touch ${fasta.name}.dat + """ +} \ No newline at end of file From a43bd154ef8235bcaff8fc26287cba4502302376 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Mon, 18 May 2026 22:00:17 +0100 Subject: [PATCH 02/12] Update process name --- modules/ensembl/features/trf/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 9dbb4227..104b7faf 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -13,7 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -process TANDEM_REPEATS_FINDER { +process FEATURES_TRF { tag "${meta.id}" label 'process_medium' From d06160205cc81303ed1516384b7f27070416a53c Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Wed, 20 May 2026 11:09:06 +0100 Subject: [PATCH 03/12] Fix typo --- modules/ensembl/features/trf/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 104b7faf..868f562e 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -31,7 +31,7 @@ process FEATURES_TRF { task.ext.when == null || task.ext.when script: - def args task.ext.args ?: '2 7 7 80 10 100 500' + def args = task.ext.args ?: '2 7 7 80 10 100 500' """ trf '${fasta}' ${args} -d -h """ From bd3a2491569226b03ede2e583a73211f7ca64c5e Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Wed, 17 Jun 2026 15:49:18 +0100 Subject: [PATCH 04/12] Add tests and meta --- modules/ensembl/features/trf/main.nf | 8 ++- modules/ensembl/features/trf/meta.yml | 67 +++++++++++++++++++ .../ensembl/features/trf/tests/main.nf.test | 49 ++++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 modules/ensembl/features/trf/meta.yml create mode 100644 modules/ensembl/features/trf/tests/main.nf.test diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 868f562e..da842749 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -25,7 +25,7 @@ process FEATURES_TRF { output: tuple val(meta), path("*.dat"), emit: dat - tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+'"), emit: versions_trf, topic: versions + tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+' || echo 4.09.1"), emit: versions_trf, topic: versions when: task.ext.when == null || task.ext.when @@ -38,6 +38,8 @@ process FEATURES_TRF { stub: """ - touch ${fasta.name}.dat + cat > "${fasta.name}.dat" << 'EOF' + Sequence: ${fasta.name} + EOF """ -} \ No newline at end of file +} diff --git a/modules/ensembl/features/trf/meta.yml b/modules/ensembl/features/trf/meta.yml new file mode 100644 index 00000000..07ba48e5 --- /dev/null +++ b/modules/ensembl/features/trf/meta.yml @@ -0,0 +1,67 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "features_trf" +description: Detect tandem repeats in FASTA sequences with Tandem Repeats Finder. +keywords: + - fasta + - features + - repeats + - tandem repeats + - trf + - genomio +tools: + - "trf": + description: "Tandem Repeats Finder detects and reports tandem repeats in DNA sequences." + homepage: "https://tandem.bu.edu/trf/trf.html" + documentation: "https://tandem.bu.edu/trf/trf.html" + tool_dev_url: "https://tandem.bu.edu/trf/trf.html" + licence: ["custom"] + identifier: "biotools:trf" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: FASTA file containing DNA sequence(s) + pattern: "*.{fa,fasta,fna}" + ontologies: + - edam: "http://edamontology.org/format_1929" # FASTA +output: + dat: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.dat": + type: file + description: TRF repeat annotations in DAT format + pattern: "*.dat" + versions_trf: + - - ${task.process}: + type: string + description: The process the versions were collected from + - trf: + type: string + description: The tool name + - trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+' || echo 4.09.1: + type: eval + description: The expression to obtain the TRF version +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - trf: + type: string + description: The tool name + - trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+' || echo 4.09.1: + type: eval + description: The expression to obtain the TRF version +authors: + - "ensembl-dev@ebi.ac.uk" +maintainers: + - "ensembl-dev@ebi.ac.uk" diff --git a/modules/ensembl/features/trf/tests/main.nf.test b/modules/ensembl/features/trf/tests/main.nf.test new file mode 100644 index 00000000..ca06d4f0 --- /dev/null +++ b/modules/ensembl/features/trf/tests/main.nf.test @@ -0,0 +1,49 @@ +// See the NOTICE file distributed with this work for additional information +// regarding copyright ownership. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// nf-core modules test features/trf +nextflow_process { + + name "Test Process FEATURES_TRF" + script "../main.nf" + process "FEATURES_TRF" + + tag "features" + tag "features/trf" + + test("Stub: TRF") { + when { + options "-stub" + + process { + """ + input[0] = [[ id: 'test' ],file('dummy.fa') + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert process.out.dat.size() == 1 }, + { assert process.out.dat[0][0] == [ id: 'test' ] }, + { assert file(process.out.dat[0][1]).name == 'dummy.fa.dat' }, + { assert file(process.out.dat[0][1]).size() > 0 }, + { assert process.out.versions_trf.size() == 1 } + ) + } + } +} From 174b29c5c969c4a66eaf653f55a702abf5d444b2 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Tue, 23 Jun 2026 11:36:05 +0100 Subject: [PATCH 05/12] Use TRF v4.10.0-rc2 to ensure 0 exit code on success --- modules/ensembl/features/trf/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index da842749..919abc2c 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -18,14 +18,14 @@ process FEATURES_TRF { label 'process_medium' conda "${moduleDir}/environment.yml" - container "quay.io/biocontainers/trf:4.09.1--h7b50bb2_7" + container "quay.io/biocontainers/trf:4.10.0rc2-0" input: tuple val(meta), path(fasta) output: tuple val(meta), path("*.dat"), emit: dat - tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+' || echo 4.09.1"), emit: versions_trf, topic: versions + tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0rc2-0"), emit: versions_trf, topic: versions when: task.ext.when == null || task.ext.when From 445a68578d35c3c0d4e9b03e92ebbdda0770aca3 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Tue, 23 Jun 2026 11:58:10 +0100 Subject: [PATCH 06/12] Update container --- modules/ensembl/features/trf/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 919abc2c..979e1a47 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -18,7 +18,7 @@ process FEATURES_TRF { label 'process_medium' conda "${moduleDir}/environment.yml" - container "quay.io/biocontainers/trf:4.10.0rc2-0" + container "quay.io/biocontainers/trf:4.10.0rc2--h7b50bb2_0" input: tuple val(meta), path(fasta) From 2ab2d8e4f2577e58681eb132c3a630c2f13639b9 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Thu, 25 Jun 2026 12:46:37 +0100 Subject: [PATCH 07/12] Refactor TRF arg input --- modules/ensembl/features/trf/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 979e1a47..484849ee 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -31,9 +31,9 @@ process FEATURES_TRF { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '2 7 7 80 10 100 500' + def args = task.ext.args ?: '2 7 7 80 10 100 500 -d -h' """ - trf '${fasta}' ${args} -d -h + trf '${fasta}' ${args} """ stub: From fdd9434e8d3c3a94b4d59cbb1c6a821d1bbbb16d Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Thu, 25 Jun 2026 13:54:02 +0100 Subject: [PATCH 08/12] Test and versioning updates --- modules/ensembl/features/trf/main.nf | 2 +- modules/ensembl/features/trf/meta.yml | 4 +- .../ensembl/features/trf/tests/main.nf.test | 15 +++---- .../features/trf/tests/main.nf.test.snap | 43 +++++++++++++++++++ 4 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 modules/ensembl/features/trf/tests/main.nf.test.snap diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index 484849ee..a2eaa9e9 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -25,7 +25,7 @@ process FEATURES_TRF { output: tuple val(meta), path("*.dat"), emit: dat - tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0rc2-0"), emit: versions_trf, topic: versions + tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0rc2"), emit: versions_trf, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/ensembl/features/trf/meta.yml b/modules/ensembl/features/trf/meta.yml index 07ba48e5..2a989345 100644 --- a/modules/ensembl/features/trf/meta.yml +++ b/modules/ensembl/features/trf/meta.yml @@ -47,7 +47,7 @@ output: - trf: type: string description: The tool name - - trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+' || echo 4.09.1: + - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0-rc2: type: eval description: The expression to obtain the TRF version topics: @@ -58,7 +58,7 @@ topics: - trf: type: string description: The tool name - - trf -v 2>&1 | grep -oE '[0-9]+(\.[0-9]+)+' || echo 4.09.1: + - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0-rc2: type: eval description: The expression to obtain the TRF version authors: diff --git a/modules/ensembl/features/trf/tests/main.nf.test b/modules/ensembl/features/trf/tests/main.nf.test index ca06d4f0..348c575d 100644 --- a/modules/ensembl/features/trf/tests/main.nf.test +++ b/modules/ensembl/features/trf/tests/main.nf.test @@ -36,14 +36,13 @@ nextflow_process { } then { - assertAll( - { assert process.success }, - { assert process.out.dat.size() == 1 }, - { assert process.out.dat[0][0] == [ id: 'test' ] }, - { assert file(process.out.dat[0][1]).name == 'dummy.fa.dat' }, - { assert file(process.out.dat[0][1]).size() > 0 }, - { assert process.out.versions_trf.size() == 1 } - ) + assert process.success + assert snapshot(process.out).match() + assert process.out.dat.size() == 1 + assert process.out.dat[0][0] == [ id: 'test' ] + assert file(process.out.dat[0][1]).name == 'dummy.fa.dat' + assert file(process.out.dat[0][1]).size() > 0 + assert process.out.versions_trf.size() == 1 } } } diff --git a/modules/ensembl/features/trf/tests/main.nf.test.snap b/modules/ensembl/features/trf/tests/main.nf.test.snap new file mode 100644 index 00000000..401f0329 --- /dev/null +++ b/modules/ensembl/features/trf/tests/main.nf.test.snap @@ -0,0 +1,43 @@ +{ + "Stub: TRF": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "dummy.fa.dat:md5,7afa5cc8da76212b28fe6a2c4db74917" + ] + ], + "1": [ + [ + "FEATURES_TRF", + "trf", + "4.10.0rc2" + ] + ], + "dat": [ + [ + { + "id": "test" + }, + "dummy.fa.dat:md5,7afa5cc8da76212b28fe6a2c4db74917" + ] + ], + "versions_trf": [ + [ + "FEATURES_TRF", + "trf", + "4.10.0rc2" + ] + ] + } + ], + "timestamp": "2026-06-25T13:50:41.590756", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.3" + } + } +} \ No newline at end of file From 13b3bbe31b418808ae6846ae2e75e02d8de04cd8 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Thu, 25 Jun 2026 14:07:32 +0100 Subject: [PATCH 09/12] Bump environment version --- modules/ensembl/features/trf/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ensembl/features/trf/environment.yml b/modules/ensembl/features/trf/environment.yml index 54eb1738..51431634 100644 --- a/modules/ensembl/features/trf/environment.yml +++ b/modules/ensembl/features/trf/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - trf=4.09.1 \ No newline at end of file + - trf=4.10.0-rc2 \ No newline at end of file From b843348325039f7775bf6d0ca8b9518ad811a2d2 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Thu, 25 Jun 2026 14:22:27 +0100 Subject: [PATCH 10/12] Fix TRF versions --- modules/ensembl/features/trf/main.nf | 2 +- modules/ensembl/features/trf/meta.yml | 4 ++-- modules/ensembl/features/trf/tests/main.nf.test.snap | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index a2eaa9e9..e9b16b77 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -25,7 +25,7 @@ process FEATURES_TRF { output: tuple val(meta), path("*.dat"), emit: dat - tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0rc2"), emit: versions_trf, topic: versions + tuple val("${task.process}"), val('trf'), eval("trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0"), emit: versions_trf, topic: versions when: task.ext.when == null || task.ext.when diff --git a/modules/ensembl/features/trf/meta.yml b/modules/ensembl/features/trf/meta.yml index 2a989345..ea472367 100644 --- a/modules/ensembl/features/trf/meta.yml +++ b/modules/ensembl/features/trf/meta.yml @@ -47,7 +47,7 @@ output: - trf: type: string description: The tool name - - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0-rc2: + - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0: type: eval description: The expression to obtain the TRF version topics: @@ -58,7 +58,7 @@ topics: - trf: type: string description: The tool name - - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0-rc2: + - trf -v 2>&1 | grep -oE '[0-9]+(\\.[0-9]+)+(rc[0-9]+)?(-[0-9]+)?' || echo 4.10.0: type: eval description: The expression to obtain the TRF version authors: diff --git a/modules/ensembl/features/trf/tests/main.nf.test.snap b/modules/ensembl/features/trf/tests/main.nf.test.snap index 401f0329..7325e373 100644 --- a/modules/ensembl/features/trf/tests/main.nf.test.snap +++ b/modules/ensembl/features/trf/tests/main.nf.test.snap @@ -14,7 +14,7 @@ [ "FEATURES_TRF", "trf", - "4.10.0rc2" + "4.10.0" ] ], "dat": [ @@ -29,7 +29,7 @@ [ "FEATURES_TRF", "trf", - "4.10.0rc2" + "4.10.0" ] ] } From e66f12ef23a919f2425d49aa44a24f2b9a18b5c3 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Tue, 14 Jul 2026 13:10:22 +0100 Subject: [PATCH 11/12] TRF version fix --- modules/ensembl/features/trf/environment.yml | 2 +- modules/ensembl/features/trf/meta.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ensembl/features/trf/environment.yml b/modules/ensembl/features/trf/environment.yml index 51431634..202c4484 100644 --- a/modules/ensembl/features/trf/environment.yml +++ b/modules/ensembl/features/trf/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - trf=4.10.0-rc2 \ No newline at end of file + - trf=4.10.0rc2 \ No newline at end of file diff --git a/modules/ensembl/features/trf/meta.yml b/modules/ensembl/features/trf/meta.yml index ea472367..043433c2 100644 --- a/modules/ensembl/features/trf/meta.yml +++ b/modules/ensembl/features/trf/meta.yml @@ -1,5 +1,4 @@ --- -# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json name: "features_trf" description: Detect tandem repeats in FASTA sequences with Tandem Repeats Finder. keywords: From 5ac0ebcb4b761aa9c5bab7ed5d73760ad336f533 Mon Sep 17 00:00:00 2001 From: Mark Quinton-Tulloch Date: Tue, 14 Jul 2026 13:17:24 +0100 Subject: [PATCH 12/12] Enforce -h option --- modules/ensembl/features/trf/main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ensembl/features/trf/main.nf b/modules/ensembl/features/trf/main.nf index e9b16b77..475dba64 100644 --- a/modules/ensembl/features/trf/main.nf +++ b/modules/ensembl/features/trf/main.nf @@ -31,9 +31,9 @@ process FEATURES_TRF { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '2 7 7 80 10 100 500 -d -h' + def args = task.ext.args ?: '2 7 7 80 10 100 500 -d' """ - trf '${fasta}' ${args} + trf '${fasta}' ${args} -h """ stub: