Skip to content

Commit 596fc4c

Browse files
authored
Add the deacon/index tool. (#8640)
* Add the deacon/ / index tool. The container seems to have on apple sillicon, so I tested this locally using conda. * Adjust deacon/index based on PR feedback
1 parent ea8d54b commit 596fc4c

File tree

5 files changed

+306
-0
lines changed

5 files changed

+306
-0
lines changed
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::deacon=0.5.0"

modules/nf-core/deacon/index/main.nf

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
process DEACON_INDEX {
2+
tag "$fasta"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/deacon:0.5.0--h4349ce8_0':
8+
'biocontainers/deacon:0.5.0--h4349ce8_0' }"
9+
10+
input:
11+
tuple val(meta), path(fasta)
12+
13+
output:
14+
tuple val(meta), path("*.idx"), emit: index
15+
path "versions.yml" , emit: versions
16+
17+
when:
18+
task.ext.when == null || task.ext.when
19+
20+
script:
21+
def args = task.ext.args ?: ''
22+
def prefix = task.ext.prefix ?: "${meta.id}"
23+
"""
24+
deacon \\
25+
index \\
26+
build \\
27+
--threads ${task.cpus} \\
28+
$args \\
29+
$fasta > ${prefix}.idx
30+
31+
cat <<-END_VERSIONS > versions.yml
32+
"${task.process}":
33+
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
34+
END_VERSIONS
35+
"""
36+
37+
stub:
38+
def prefix = task.ext.prefix ?: "${fasta.baseName}"
39+
"""
40+
touch ${prefix}.idx
41+
42+
cat <<-END_VERSIONS > versions.yml
43+
"${task.process}":
44+
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
45+
END_VERSIONS
46+
"""
47+
}

modules/nf-core/deacon/index/meta.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
3+
name: "deacon_index"
4+
description: Create deacon index for reference genome
5+
keywords:
6+
- index
7+
- fasta
8+
- genome
9+
- reference
10+
- minimizer
11+
- decontamination
12+
tools:
13+
- "deacon":
14+
description: "Fast alignment-free sequence filter"
15+
homepage: "https://github.com/bede/deacon"
16+
documentation: "https://github.com/bede/deacon#readme"
17+
tool_dev_url: "https://github.com/bede/deacon"
18+
doi: "10.1093/bioinformatics/btae004"
19+
licence: ["MIT"]
20+
identifier: "biotools:deacon"
21+
22+
input:
23+
- - meta:
24+
type: map
25+
description: |
26+
Groovy Map containing reference information.
27+
e.g. [ id:'test', single_end:false ]
28+
- fasta:
29+
type: file
30+
description: Input genome fasta file
31+
pattern: "*.{fasta,fasta.gz,fas,fas.gz,fa,fa.gz,fna,fna.gz}"
32+
ontologies:
33+
- edam: "http://edamontology.org/data_2044" # Sequence
34+
- edam: "http://edamontology.org/format_1929" # FASTA
35+
36+
output:
37+
- index:
38+
- meta:
39+
type: map
40+
description: |
41+
Groovy Map containing reference information.
42+
e.g. [ id:'test', single_end:false ]
43+
- "*.idx":
44+
type: file
45+
description: Deacon minimizer index file
46+
pattern: "*.idx"
47+
ontologies:
48+
- edam: "http://edamontology.org/data_3210" # Genome index
49+
- versions:
50+
- "versions.yml":
51+
type: file
52+
description: File containing software versions
53+
pattern: "versions.yml"
54+
55+
authors:
56+
- "@mberacochea"
57+
maintainers:
58+
- "@mberacochea"
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
nextflow_process {
2+
3+
name "Test Process DEACON_INDEX"
4+
script "../main.nf"
5+
process "DEACON_INDEX"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "deacon"
10+
tag "deacon/index"
11+
12+
test("index sarscov2 - fasta") {
13+
14+
when {
15+
process {
16+
"""
17+
input[0] = [
18+
[ id:'test'],
19+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
20+
]
21+
"""
22+
}
23+
}
24+
25+
then {
26+
assertAll(
27+
{ assert process.success },
28+
{ assert snapshot(
29+
process.out.index,
30+
process.out.versions.collect { path(it).yaml }
31+
).match()
32+
}
33+
)
34+
}
35+
36+
}
37+
38+
test("index sarscov2 - fasta gzipped") {
39+
40+
when {
41+
process {
42+
"""
43+
input[0] = [
44+
[ id:'test'],
45+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)
46+
]
47+
"""
48+
}
49+
}
50+
51+
then {
52+
assertAll(
53+
{ assert process.success },
54+
{ assert snapshot(
55+
process.out,
56+
process.out.versions.collect{ path(it).yaml }
57+
).match() }
58+
)
59+
}
60+
61+
}
62+
63+
test("index sarscov2 - fasta - stub") {
64+
65+
options "-stub"
66+
67+
when {
68+
process {
69+
"""
70+
input[0] = [
71+
[ id:'test'],
72+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
73+
]
74+
"""
75+
}
76+
}
77+
78+
then {
79+
assertAll(
80+
{ assert process.success },
81+
{ assert snapshot(
82+
process.out,
83+
process.out.versions.collect{ path(it).yaml }
84+
).match() }
85+
)
86+
}
87+
}
88+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"index sarscov2 - fasta": {
3+
"content": [
4+
[
5+
[
6+
{
7+
"id": "test"
8+
},
9+
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
10+
]
11+
],
12+
[
13+
{
14+
"DEACON_INDEX": {
15+
"deacon": "0.5.0"
16+
}
17+
}
18+
]
19+
],
20+
"meta": {
21+
"nf-test": "0.9.2",
22+
"nextflow": "25.04.3"
23+
},
24+
"timestamp": "2025-06-16T08:54:38.622063"
25+
},
26+
"index sarscov2 - fasta - stub": {
27+
"content": [
28+
{
29+
"0": [
30+
[
31+
{
32+
"id": "test"
33+
},
34+
"genome.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
35+
]
36+
],
37+
"1": [
38+
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
39+
],
40+
"index": [
41+
[
42+
{
43+
"id": "test"
44+
},
45+
"genome.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
46+
]
47+
],
48+
"versions": [
49+
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
50+
]
51+
},
52+
[
53+
{
54+
"DEACON_INDEX": {
55+
"deacon": "0.5.0"
56+
}
57+
}
58+
]
59+
],
60+
"meta": {
61+
"nf-test": "0.9.2",
62+
"nextflow": "25.04.3"
63+
},
64+
"timestamp": "2025-06-16T12:31:10.825365"
65+
},
66+
"index sarscov2 - fasta gzipped": {
67+
"content": [
68+
{
69+
"0": [
70+
[
71+
{
72+
"id": "test"
73+
},
74+
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
75+
]
76+
],
77+
"1": [
78+
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
79+
],
80+
"index": [
81+
[
82+
{
83+
"id": "test"
84+
},
85+
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
86+
]
87+
],
88+
"versions": [
89+
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
90+
]
91+
},
92+
[
93+
{
94+
"DEACON_INDEX": {
95+
"deacon": "0.5.0"
96+
}
97+
}
98+
]
99+
],
100+
"meta": {
101+
"nf-test": "0.9.2",
102+
"nextflow": "25.04.3"
103+
},
104+
"timestamp": "2025-06-16T12:31:07.212408"
105+
}
106+
}

0 commit comments

Comments
 (0)