Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions modules/ensembl/features/trf/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
dependencies:
- trf=4.10.0rc2
45 changes: 45 additions & 0 deletions modules/ensembl/features/trf/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 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 FEATURES_TRF {
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "quay.io/biocontainers/trf:4.10.0rc2--h7b50bb2_0"

input:
tuple val(meta), path(fasta)

output:
tuple val(meta), path("*.dat"), emit: dat
Comment thread
JAlvarezJarreta marked this conversation as resolved.
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
Comment thread
JAlvarezJarreta marked this conversation as resolved.

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: '2 7 7 80 10 100 500 -d'
"""
trf '${fasta}' ${args} -h
"""

stub:
"""
cat > "${fasta.name}.dat" << 'EOF'
Sequence: ${fasta.name}
EOF
"""
}
66 changes: 66 additions & 0 deletions modules/ensembl/features/trf/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
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
Comment thread
JAlvarezJarreta marked this conversation as resolved.
- trf:
type: string
description: The tool name
Comment thread
JAlvarezJarreta marked this conversation as resolved.
- 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:
versions:
- - ${task.process}:
type: string
description: The process the versions were collected from
Comment thread
JAlvarezJarreta marked this conversation as resolved.
- trf:
type: string
description: The tool name
Comment thread
JAlvarezJarreta marked this conversation as resolved.
- 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:
- "ensembl-dev@ebi.ac.uk"
maintainers:
- "ensembl-dev@ebi.ac.uk"
48 changes: 48 additions & 0 deletions modules/ensembl/features/trf/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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 {
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
}
}
}
43 changes: 43 additions & 0 deletions modules/ensembl/features/trf/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"Stub: TRF": {
"content": [
{
"0": [
[
{
"id": "test"
},
"dummy.fa.dat:md5,7afa5cc8da76212b28fe6a2c4db74917"
]
],
"1": [
[
"FEATURES_TRF",
"trf",
"4.10.0"
]
],
"dat": [
[
{
"id": "test"
},
"dummy.fa.dat:md5,7afa5cc8da76212b28fe6a2c4db74917"
]
],
"versions_trf": [
[
"FEATURES_TRF",
"trf",
"4.10.0"
]
]
}
],
"timestamp": "2026-06-25T13:50:41.590756",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.3"
}
}
}
Loading