nf-core_modules/modules/mykrobe/predict/main.nf
Robert A. Petit III 6d6e3a018f
add module for mykrobe predict and genotyphi parse (#1818)
* add module for mykrobe predict and genotyphi parse

* Update meta.yml

Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
2022-09-26 15:18:04 +01:00

41 lines
1.2 KiB
Text

process MYKROBE_PREDICT {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::mykrobe=0.11.0" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mykrobe:0.11.0--py39h2add14b_1':
'quay.io/biocontainers/mykrobe:0.11.0--py39h2add14b_1' }"
input:
tuple val(meta), path(seqs)
val species
output:
tuple val(meta), path("${prefix}.csv") , emit: csv
tuple val(meta), path("${prefix}.json"), emit: json
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
mykrobe \\
predict \\
$args \\
--species $species \\
--threads $task.cpus \\
--sample $prefix \\
--format json_and_csv \\
--output ${prefix} \\
--seq $seqs
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mykrobe: \$(echo \$(mykrobe --version 2>&1) | sed 's/^.*mykrobe v//' )
END_VERSIONS
"""
}