Skip to content

Add the deacon/index tool. #8640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2025
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
7 changes: 7 additions & 0 deletions modules/nf-core/deacon/index/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::deacon=0.5.0"
47 changes: 47 additions & 0 deletions modules/nf-core/deacon/index/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
process DEACON_INDEX {
tag "$fasta"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/deacon:0.5.0--h4349ce8_0':
'biocontainers/deacon:0.5.0--h4349ce8_0' }"

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

output:
tuple val(meta), path("*.idx"), emit: index
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
deacon \\
index \\
build \\
--threads ${task.cpus} \\
$args \\
$fasta > ${prefix}.idx

cat <<-END_VERSIONS > versions.yml
"${task.process}":
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${fasta.baseName}"
"""
touch ${prefix}.idx

cat <<-END_VERSIONS > versions.yml
"${task.process}":
deacon: \$(deacon --version | head -n1 | sed 's/deacon //g')
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nf-core/deacon/index/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "deacon_index"
description: Create deacon index for reference genome
keywords:
- index
- fasta
- genome
- reference
- minimizer
- decontamination
tools:
- "deacon":
description: "Fast alignment-free sequence filter"
homepage: "https://github.com/bede/deacon"
documentation: "https://github.com/bede/deacon#readme"
tool_dev_url: "https://github.com/bede/deacon"
doi: "10.1093/bioinformatics/btae004"
licence: ["MIT"]
identifier: "biotools:deacon"

input:
- - meta:
type: map
description: |
Groovy Map containing reference information.
e.g. [ id:'test', single_end:false ]
- fasta:
type: file
description: Input genome fasta file
pattern: "*.{fasta,fasta.gz,fas,fas.gz,fa,fa.gz,fna,fna.gz}"
ontologies:
- edam: "http://edamontology.org/data_2044" # Sequence
- edam: "http://edamontology.org/format_1929" # FASTA

output:
- index:
- meta:
type: map
description: |
Groovy Map containing reference information.
e.g. [ id:'test', single_end:false ]
- "*.idx":
type: file
description: Deacon minimizer index file
pattern: "*.idx"
ontologies:
- edam: "http://edamontology.org/data_3210" # Genome index
- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@mberacochea"
maintainers:
- "@mberacochea"
88 changes: 88 additions & 0 deletions modules/nf-core/deacon/index/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
nextflow_process {

name "Test Process DEACON_INDEX"
script "../main.nf"
process "DEACON_INDEX"

tag "modules"
tag "modules_nfcore"
tag "deacon"
tag "deacon/index"

test("index sarscov2 - fasta") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.index,
process.out.versions.collect { path(it).yaml }
).match()
}
)
}

}

test("index sarscov2 - fasta gzipped") {

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out,
process.out.versions.collect{ path(it).yaml }
).match() }
)
}

}

test("index sarscov2 - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out,
process.out.versions.collect{ path(it).yaml }
).match() }
)
}
}
}
106 changes: 106 additions & 0 deletions modules/nf-core/deacon/index/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"index sarscov2 - fasta": {
"content": [
[
[
{
"id": "test"
},
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
]
],
[
{
"DEACON_INDEX": {
"deacon": "0.5.0"
}
}
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.3"
},
"timestamp": "2025-06-16T08:54:38.622063"
},
"index sarscov2 - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"genome.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
],
"index": [
[
{
"id": "test"
},
"genome.idx:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
]
},
[
{
"DEACON_INDEX": {
"deacon": "0.5.0"
}
}
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.3"
},
"timestamp": "2025-06-16T12:31:10.825365"
},
"index sarscov2 - fasta gzipped": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
]
],
"1": [
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
],
"index": [
[
{
"id": "test"
},
"test.idx:md5,7437b25e6659ebfd5cf9be7b325f90c3"
]
],
"versions": [
"versions.yml:md5,60749febc4eaab16229dc078af00ea27"
]
},
[
{
"DEACON_INDEX": {
"deacon": "0.5.0"
}
}
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.3"
},
"timestamp": "2025-06-16T12:31:07.212408"
}
}
Loading