Skip to content
Open
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
1,186 changes: 1,186 additions & 0 deletions modules/nf-core/spoligotyper/.conda-lock/linux_amd64-bd-679a58efe8efff70_1.txt

Large diffs are not rendered by default.

1,076 changes: 1,076 additions & 0 deletions modules/nf-core/spoligotyper/.conda-lock/linux_arm64-bd-872d67a3849f499b_1.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions modules/nf-core/spoligotyper/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::spoligotyper=0.9.0
42 changes: 42 additions & 0 deletions modules/nf-core/spoligotyper/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
process SPOLIGOTYPER {
tag "${meta.id}"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/18/18627f630e2f90d14aa45effad5909fb77092cb48534b7d677f91f029c65d2de/data'
: 'community.wave.seqera.io/library/spoligotyper:0.9.0--679a58efe8efff70'}"

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

output:
tuple val(meta), path("${prefix}_spoligotyping.txt") , emit: tsv
tuple val(meta), path("${prefix}_spoligotyping.json") , emit: json
tuple val(meta), path("${prefix}_spoligotyping.pdf") , emit: pdf, optional: true
tuple val(meta), path("${prefix}_spoligotyping_mqc.json"), emit: multiqc
tuple val("${task.process}"), val('spoligotyper'), eval("spoligotyper --version | sed 's/spoligotyper //'"), emit: versions_spoligotyper, topic: versions

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
// Reads (single-end or paired-end) or an assembly: spoligotyper detects the file type
def input = reads instanceof List && reads.size() == 2 ? "-r1 \"${reads[0]}\" -r2 \"${reads[1]}\"" : "-r1 \"${reads}\""
"""
spoligotyper \\
$args \\
$input \\
--sample "${prefix}" \\
--output . \\
--threads $task.cpus
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch "${prefix}_spoligotyping.txt" "${prefix}_spoligotyping.json" "${prefix}_spoligotyping.pdf" "${prefix}_spoligotyping_mqc.json"
"""
}
135 changes: 135 additions & 0 deletions modules/nf-core/spoligotyper/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: spoligotyper
description: In silico spoligotyping, species check and lineage of Mycobacterium tuberculosis complex samples
keywords:
- Mycobacterium tuberculosis
- Mycobacterium bovis
- spoligotyping
- genotyping
- lineage
tools:
- spoligotyper:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool is missing args_id: "$args".

description: |
In silico spoligotyping of Mycobacterium tuberculosis complex samples from reads or assemblies, with a
species check (regions of difference) and the lineage (SNP barcode), and a PDF report for quality assurance
homepage: https://github.com/duceppemo/spoligotyper
documentation: https://github.com/duceppemo/spoligotyper/wiki
tool_dev_url: https://github.com/duceppemo/spoligotyper
doi: "10.5281/zenodo.22926160"
licence:
- "MIT"
identifier: ""
args_id: "$args"

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- reads:
type: file
description: Single-end or paired-end reads (fastq), or an assembly (fasta), gzipped or not
pattern: "*.{fastq,fq,fasta,fa,fna,fas}{,.gz}"
ontologies:
- edam: http://edamontology.org/format_1930 # FASTQ
- edam: http://edamontology.org/format_1929 # FASTA
output:
tsv:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "${prefix}_spoligotyping.txt":
type: file
description: Tab-separated table with the spoligotype, species, lineage and warnings
pattern: "*_spoligotyping.txt"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
json:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "${prefix}_spoligotyping.json":
type: file
description: All the results and run information
pattern: "*_spoligotyping.json"
ontologies:
- edam: http://edamontology.org/format_3464 # JSON
pdf:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "${prefix}_spoligotyping.pdf":
type: file
description: Optional. PDF report for quality assurance (not written with --no-pdf)
pattern: "*_spoligotyping.pdf"
ontologies:
- edam: http://edamontology.org/format_3508 # PDF
multiqc:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "${prefix}_spoligotyping_mqc.json":
type: file
description: MultiQC custom content table
pattern: "*_spoligotyping_mqc.json"
ontologies:
- edam: http://edamontology.org/format_3464 # JSON
versions_spoligotyper:
- - ${task.process}:
type: string
description: The process the versions were collected from
- spoligotyper:
type: string
description: The tool name
- "spoligotyper --version | sed 's/spoligotyper //'":
type: eval
description: The version of the tool

topics:
versions:
- - ${task.process}:
type: string
description: The process the versions were collected from
- spoligotyper:
type: string
description: The tool name
- "spoligotyper --version | sed 's/spoligotyper //'":
type: eval
description: The version of the tool

authors:
- "@duceppemo"
maintainers:
- "@duceppemo"
containers:
docker:
linux/amd64:
name: community.wave.seqera.io/library/spoligotyper:0.9.0--679a58efe8efff70
build_id: bd-679a58efe8efff70_1
scan_id: sc-0c292160a28f85ac_1
linux/arm64:
name: community.wave.seqera.io/library/spoligotyper:0.9.0--872d67a3849f499b
build_id: bd-872d67a3849f499b_1
scan_id: sc-448dd396d71a4062_1
singularity:
linux/arm64:
name: oras://community.wave.seqera.io/library/spoligotyper:0.9.0--964817015cdc198a
build_id: bd-964817015cdc198a_1
https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d7/d75cbca42d0b437d193d5f9e54428ca9302f3c9cfcf8f472b2bf972d08948433/data
linux/amd64:
name: oras://community.wave.seqera.io/library/spoligotyper:0.9.0--a133deb816fb42d2
build_id: bd-a133deb816fb42d2_1
https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/18/18627f630e2f90d14aa45effad5909fb77092cb48534b7d677f91f029c65d2de/data
conda:
linux/amd64:
lock_file: modules/nf-core/spoligotyper/.conda-lock/linux_amd64-bd-679a58efe8efff70_1.txt
linux/arm64:
lock_file: modules/nf-core/spoligotyper/.conda-lock/linux_arm64-bd-872d67a3849f499b_1.txt
81 changes: 81 additions & 0 deletions modules/nf-core/spoligotyper/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "spoligotyper"

// nf-core test data has no M. tuberculosis complex genome: these tests check that the module runs and
// writes its outputs ("MTBC not detected" is the expected result).
test("sarscov2 - fasta") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put a bare assert process.success before assertAll(...), as in the nf-core template (same for the other two tests).

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
// Stable checks for the unstable channels: json and pdf embed run timestamps
{ assert path(process.out.tsv[0][1]).text.contains('MTBC not detected') },
{ assert path(process.out.json[0][1]).text.contains('MTBC not detected') },
{ assert file(process.out.pdf[0][1]).length() > 0 },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["json", "pdf"])).match() }
)
}
}

test("sarscov2 - paired-end fastq") {
when {
process {
"""
input[0] = [
[ id:'test', single_end:false ],
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
"""
}
}
then {
assertAll(
{ assert process.success },
// Stable checks for the unstable channels: json and pdf embed run timestamps
{ assert path(process.out.tsv[0][1]).text.contains('fastq') },
{ assert path(process.out.json[0][1]).text.contains('fastq') },
{ assert file(process.out.pdf[0][1]).length() > 0 },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["json", "pdf"])).match() }
)
}
}

test("sarscov2 - fasta - stub") {
options "-stub"
when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
}
Loading
Loading