Skip to content

Commit f590526

Browse files
lbeltrameSPPearce
andauthored
Add finaletoolkit/endmotifs (#12035)
* Add finaletoolkit/endmotifs From the upstream documentation: > Measures frequency of k-mer 5’ end motifs. * Remove the export from the test, add it to the module * Update modules/nf-core/finaletoolkit/endmotifs/main.nf Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> * Update modules/nf-core/finaletoolkit/endmotifs/main.nf Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com> --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
1 parent db578af commit f590526

5 files changed

Lines changed: 267 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- "bioconda::finaletoolkit=0.11.1"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
process FINALETOOLKIT_ENDMOTIFS {
2+
tag "${meta.id}"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
7+
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/34/34f01d128ed135aedc33ddb62fced3911bef6d1a909694291b7184bf83719402/data'
8+
: 'community.wave.seqera.io/library/finaletoolkit:0.11.1--8fe5ba6ec9e2ec95'}"
9+
10+
input:
11+
tuple val(meta), path(bam), path(bai)
12+
tuple val(meta2), path(genome)
13+
14+
output:
15+
tuple val(meta), path("${prefix}.tsv"), emit: tsv
16+
tuple val("${task.process}"), val('finaletoolkit'), eval("finaletoolkit --version | sed 's/FinaleToolkit //g'"), topic: versions, emit: versions_finaletoolkit
17+
18+
when:
19+
task.ext.when == null || task.ext.when
20+
21+
script:
22+
def args = task.ext.args ?: ''
23+
prefix = task.ext.prefix ?: "${meta.id}_motifs"
24+
"""
25+
export MPLCONFIGDIR='./tmp'
26+
27+
finaletoolkit \\
28+
end-motifs \\
29+
-w ${task.cpus} \\
30+
${bam} \\
31+
${genome} \\
32+
${args} \\
33+
-o "${prefix}.tsv"
34+
"""
35+
36+
stub:
37+
def args = task.ext.args ?: ''
38+
prefix = task.ext.prefix ?: "${meta.id}_motifs"
39+
"""
40+
echo ${args}
41+
42+
touch "${prefix}.tsv"
43+
"""
44+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: "finaletoolkit_endmotifs"
2+
description: |
3+
Measure the frequency of 5' k-mer end motifs.
4+
keywords:
5+
- end-motifs
6+
- genomics
7+
- fragmentomics
8+
tools:
9+
- "finaletoolkit":
10+
description: "Extract cfDNA fragmentation features from sequencing data."
11+
homepage: "https://epifluidlab.github.io/FinaleToolkit/"
12+
documentation: "https://epifluidlab.github.io/FinaleToolkit/documentation/index.html"
13+
tool_dev_url: "https://github.com/epifluidlab/FinaleToolkit"
14+
doi: "10.1093/bioadv/vbaf236"
15+
licence:
16+
- "MIT"
17+
identifier: biotools:finaletoolkit
18+
input:
19+
- - meta:
20+
type: map
21+
description: |
22+
Groovy Map containing sample information
23+
e.g. `[ id:'sample1' ]`
24+
- bam:
25+
type: file
26+
description: Sorted BAM file
27+
pattern: "*.bam"
28+
ontologies:
29+
- edam: "http://edamontology.org/format_2572"
30+
- bai:
31+
type: file
32+
description: BAM file index
33+
pattern: "*.bai"
34+
ontologies:
35+
- edam: "http://edamontology.org/format_3327"
36+
- - meta2:
37+
type: map
38+
description: |
39+
Groovy Map containing sample information
40+
e.g. `[ id:'sample1' ]`
41+
- genome:
42+
type: file
43+
description: |
44+
FASTA or 2bit compressed genome file (must be the same as the one used for the
45+
BAM file)
46+
pattern: "*.2bit|*.fasta|*.fa"
47+
ontologies:
48+
- edam: "http://edamontology.org/format_3009"
49+
- edam: "http://edamontology.org/format_1929"
50+
output:
51+
tsv:
52+
- - meta:
53+
type: map
54+
description: |
55+
Groovy Map containing sample information
56+
e.g. `[ id:'sample1' ]`
57+
- "${prefix}.tsv":
58+
type: file
59+
pattern: "*.tsv"
60+
description: |
61+
TSV file containing k-mer frequencies
62+
ontologies:
63+
- edam: "http://edamontology.org/format_3475"
64+
versions_finaletoolkit:
65+
- - ${task.process}:
66+
type: string
67+
description: The name of the process
68+
- finaletoolkit:
69+
type: string
70+
description: The name of the tool
71+
- finaletoolkit --version | sed 's/FinaleToolkit //g':
72+
type: eval
73+
description: The expression to obtain the version of the tool
74+
topics:
75+
versions:
76+
- - ${task.process}:
77+
type: string
78+
description: The name of the process
79+
- finaletoolkit:
80+
type: string
81+
description: The name of the tool
82+
- finaletoolkit --version | sed 's/FinaleToolkit //g':
83+
type: eval
84+
description: The expression to obtain the version of the tool
85+
authors:
86+
- "@lbeltrame"
87+
maintainers:
88+
- "@lbeltrame"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
nextflow_process {
2+
3+
name "Test Process FINALETOOLKIT_ENDMOTIFS"
4+
script "../main.nf"
5+
process "FINALETOOLKIT_ENDMOTIFS"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "finaletoolkit"
10+
tag "finaletoolkit/endmotifs"
11+
12+
test("homo_sapiens - bam") {
13+
14+
when {
15+
16+
process {
17+
18+
"""
19+
input[0] = [
20+
[ id:'test' ],
21+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr22.bam', checkIfExists: true),
22+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/NA12878.chr22.bam.bai', checkIfExists: true),
23+
]
24+
input[1] = [
25+
[id: 'genome' ],
26+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.2bit', checkIfExists: true),
27+
]
28+
"""
29+
}
30+
}
31+
32+
then {
33+
assert process.success
34+
assertAll(
35+
{ assert snapshot(sanitizeOutput(process.out)).match() }
36+
)
37+
38+
}
39+
40+
}
41+
42+
test("homo_sapiens - stub") {
43+
44+
options "-stub"
45+
46+
when {
47+
48+
process {
49+
50+
"""
51+
input[0] = [
52+
[ id:'test' ],
53+
[],
54+
[]
55+
]
56+
input[1] = [
57+
[id: 'genome' ],
58+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.2bit', checkIfExists: true),
59+
]
60+
"""
61+
}
62+
}
63+
64+
then {
65+
assert process.success
66+
assertAll(
67+
{ assert snapshot(sanitizeOutput(process.out)).match() }
68+
)
69+
70+
}
71+
72+
}
73+
74+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"homo_sapiens - stub": {
3+
"content": [
4+
{
5+
"tsv": [
6+
[
7+
{
8+
"id": "test"
9+
},
10+
"test_motifs.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
11+
]
12+
],
13+
"versions_finaletoolkit": [
14+
[
15+
"FINALETOOLKIT_ENDMOTIFS",
16+
"finaletoolkit",
17+
"0.11.1"
18+
]
19+
]
20+
}
21+
],
22+
"meta": {
23+
"nf-test": "0.9.3",
24+
"nextflow": "25.10.4"
25+
},
26+
"timestamp": "2026-06-18T10:03:20.535719738"
27+
},
28+
"homo_sapiens - bam": {
29+
"content": [
30+
{
31+
"tsv": [
32+
[
33+
{
34+
"id": "test"
35+
},
36+
"test_motifs.tsv:md5,bf6ce194a19bc80859a5b569b9075724"
37+
]
38+
],
39+
"versions_finaletoolkit": [
40+
[
41+
"FINALETOOLKIT_ENDMOTIFS",
42+
"finaletoolkit",
43+
"0.11.1"
44+
]
45+
]
46+
}
47+
],
48+
"meta": {
49+
"nf-test": "0.9.3",
50+
"nextflow": "25.10.4"
51+
},
52+
"timestamp": "2026-06-18T09:58:04.501956285"
53+
}
54+
}

0 commit comments

Comments
 (0)