nf-core_modules/modules/metaphlan3/mergemetaphlantables/main.nf
James A. Fellows Yates 940d7fe9d6
Move MetaPhlAn3 to a subcommand and add mergemetaphlantables (#2026)
* Move MetaPhlAn3 to a subcommand and add mergemetaphlantables

* Add mergemetaphlantables tests

* Add mergemetaphlantables to test config

* Apply suggestions from code review

* Revert now unnecessary input channel name change and now document

* Update modules/metaphlan3/mergemetaphlantables/main.nf

* Require database directory and more details in description
2022-09-07 21:58:03 +02:00

33 lines
955 B
Text

process METAPHLAN3_MERGEMETAPHLANTABLES {
label 'process_single'
conda (params.enable_conda ? 'bioconda::metaphlan=3.0.12' : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/metaphlan:3.0.12--pyhb7b1952_0' :
'quay.io/biocontainers/metaphlan:3.0.12--pyhb7b1952_0' }"
input:
path(profiles)
output:
tuple path("${prefix}.txt") , emit: txt
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "merged_abundance_table"
"""
merge_metaphlan_tables.py \\
$args \\
-o ${prefix}.txt \\
${profiles}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
metaphlan3: \$(metaphlan --version 2>&1 | awk '{print \$3}')
END_VERSIONS
"""
}