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
12 changes: 1 addition & 11 deletions modules/nf-core/metamaps/classify/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ process METAMAPS_CLASSIFY {
tuple val(meta), path("*classification_res.EM.contigCoverage") , emit: contig_coverage
tuple val(meta), path("*classification_res.EM.lengthAndIdentitiesPerMappingUnit") , emit: length_and_id
tuple val(meta), path("*classification_res.EM.reads2Taxon.krona") , emit: krona
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('metamaps'), eval("metamaps | sed -n 's/.*MetaMaps v //p'"), emit: versions_metamaps, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -34,11 +34,6 @@ process METAMAPS_CLASSIFY {
--mappings ${classification_res} \\
--threads ${task.cpus} \\
--DB ${database_folder}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //')
END_VERSIONS
"""

stub:
Expand All @@ -51,11 +46,6 @@ process METAMAPS_CLASSIFY {
touch ${prefix}_classification_res.EM.contigCoverage
touch ${prefix}_classification_res.EM.lengthAndIdentitiesPerMappingUnit
touch ${prefix}_classification_res.EM.reads2Taxon.krona

cat <<-END_VERSIONS > versions.yml
"${task.process}":
metamaps: \$(metamaps | sed -n 2p | sed 's/^.*MetaMaps v //')
END_VERSIONS
"""

}
31 changes: 24 additions & 7 deletions modules/nf-core/metamaps/classify/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ tools:
documentation: https://github.com/DiltheyLab/MetaMaps/blob/master/README.md
tool_dev_url: https://github.com/DiltheyLab/MetaMaps
doi: "10.1038/s41467-019-10934-2"
licence: ["Public Domain"]
licence:
- "Public Domain"
identifier: biotools:metamaps

input:
Expand Down Expand Up @@ -123,13 +124,29 @@ output:
description: Taxon ID assignment of reads in Krona format
pattern: "*.{classification_res.EM.reads2Taxon.krona}"
ontologies: []
versions_metamaps:
- - ${task.process}:
type: string
description: The name of the process
- metamaps:
type: string
description: The name of the tool
- metamaps | sed -n 's/.*MetaMaps v //p':
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- metamaps:
type: string
description: The name of the tool
- metamaps | sed -n 's/.*MetaMaps v //p':
type: eval
description: The expression to obtain the version of the tool

authors:
- "@henningonsbring"
- "@sofstam"
104 changes: 35 additions & 69 deletions modules/nf-core/metamaps/classify/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ nextflow_process {

name "Test Process METAMAPS_CLASSIFY"
script "../main.nf"
config "./nextflow.config"
process "METAMAPS_CLASSIFY"

tag "modules"
Expand All @@ -11,52 +12,49 @@ nextflow_process {
tag "metamaps/classify"
tag "untar"

test("sarscov2_nanopore_classify") {
setup {
run("UNTAR") {
config "./nextflow.config"
script "../../../untar/main.nf"
process {
"""
input[0] = [
[],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true)
]
"""
}
setup {
run("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = [
[],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true)
]
"""
}
run("METAMAPS_MAPDIRECTLY") {
script "../../../metamaps/mapdirectly/main.nf"
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
}
run("METAMAPS_MAPDIRECTLY") {
script "../../../metamaps/mapdirectly/main.nf"
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test_2.fastq.gz', checkIfExists: true)
]
input[1] = UNTAR.out.untar.map{ it[1] }
"""
}
]
input[1] = UNTAR.out.untar.map{ it[1] }
"""
}
}
}

test("sarscov2_nanopore_classify") {
when {
process {
"""
classification_folder = METAMAPS_MAPDIRECTLY.out.classification_res
.join(METAMAPS_MAPDIRECTLY.out.meta_file)
.join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths)
.join(METAMAPS_MAPDIRECTLY.out.para_file)
input[0] = classification_folder
input[0] = METAMAPS_MAPDIRECTLY.out.classification_res
.join(METAMAPS_MAPDIRECTLY.out.meta_file)
.join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths)
.join(METAMAPS_MAPDIRECTLY.out.para_file)
input[1] = UNTAR.out.untar.map{ it[1] }
"""
}
}



then {
assertAll(
assertAll(
{ assert process.success },
{ assert snapshot ( sanitizeOutput(process.out) ).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

Expand All @@ -66,55 +64,23 @@ nextflow_process {

options "-stub"

setup {
run("UNTAR") {
config "./nextflow.config"
script "../../../untar/main.nf"
process {
"""
input[0] = [
[],file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/metamaps_db.tar.gz', checkIfExists: true)
]
"""
}
}
run("METAMAPS_MAPDIRECTLY") {
script "../../../metamaps/mapdirectly/main.nf"
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/nanopore/fastq/test_2.fastq.gz', checkIfExists: true)
]
input[1] = UNTAR.out.untar.map{ it[1] }
"""
}
}
}

when {
process {
"""
classification_folder = METAMAPS_MAPDIRECTLY.out.classification_res
.join(METAMAPS_MAPDIRECTLY.out.meta_file)
.join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths)
.join(METAMAPS_MAPDIRECTLY.out.para_file)
input[0] = classification_folder
input[0] = METAMAPS_MAPDIRECTLY.out.classification_res
.join(METAMAPS_MAPDIRECTLY.out.meta_file)
.join(METAMAPS_MAPDIRECTLY.out.meta_unmappedreadsLengths)
.join(METAMAPS_MAPDIRECTLY.out.para_file)
input[1] = UNTAR.out.untar.map{ it[1] }
"""
}
}



then {
assertAll(
assertAll(
{ assert process.success },
{ assert snapshot ( sanitizeOutput(process.out) ).match() }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}


}
Loading
Loading