2022-07-12 09:39:26 +00:00
|
|
|
process MOTUS_MERGE {
|
2022-09-16 06:36:34 +00:00
|
|
|
tag "$meta.id"
|
2022-10-05 10:24:18 +00:00
|
|
|
label 'process_single'
|
2022-07-12 09:39:26 +00:00
|
|
|
|
2022-12-23 16:23:05 +00:00
|
|
|
conda "bioconda::motus=3.0.3"
|
2022-07-12 09:39:26 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-12-12 14:42:01 +00:00
|
|
|
'https://depot.galaxyproject.org/singularity/motus:3.0.3--pyhdfd78af_0':
|
|
|
|
'quay.io/biocontainers/motus:3.0.3--pyhdfd78af_0' }"
|
2022-07-12 09:39:26 +00:00
|
|
|
|
|
|
|
input:
|
2022-09-16 06:36:34 +00:00
|
|
|
tuple val(meta), path(input)
|
2022-07-12 09:39:26 +00:00
|
|
|
path db // to stop docker saying it can't find it... would have to have the module in upstream steps anyway
|
|
|
|
path profile_version_yml, stageAs: 'profile_version.yml'
|
|
|
|
|
|
|
|
output:
|
2022-09-16 06:36:34 +00:00
|
|
|
tuple val(meta), path("*.txt") , optional: true, emit: txt
|
|
|
|
tuple val(meta), path("*.biom"), optional: true, emit: biom
|
2022-07-12 09:39:26 +00:00
|
|
|
path "versions.yml" , emit: versions
|
|
|
|
|
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
|
|
|
script:
|
|
|
|
def args = task.ext.args ?: ''
|
2022-09-16 06:36:34 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2022-07-12 09:39:26 +00:00
|
|
|
def cmd_input = input.size() > 1 ? "-i ${input.join(',')}" : input.isDirectory() ? "-d ${input}" : "-i ${input}"
|
2022-09-16 06:36:34 +00:00
|
|
|
def suffix = task.ext.args?.contains("-B") ? "biom" : "txt"
|
2022-07-12 09:39:26 +00:00
|
|
|
"""
|
|
|
|
motus \\
|
|
|
|
merge \\
|
|
|
|
-db $db \\
|
|
|
|
${cmd_input} \\
|
|
|
|
$args \\
|
2022-09-16 06:36:34 +00:00
|
|
|
-o ${prefix}.${suffix}
|
2022-07-12 09:39:26 +00:00
|
|
|
|
|
|
|
## Take version from the mOTUs/profile module output, as cannot reconstruct
|
|
|
|
## version without having database staged in this directory.
|
|
|
|
VERSION=\$(cat ${profile_version_yml} | grep '/*motus:.*' | sed 's/.*otus: //g')
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
|
|
|
motus: \$VERSION
|
|
|
|
END_VERSIONS
|
|
|
|
"""
|
|
|
|
}
|