nf-core_modules/modules/mafft/main.nf
Thomas A. Christensen II 841c661cad
Add MAFFT module (#1351)
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>

Co-authored-by: Sateesh <33637490+sateeshperi@users.noreply.github.com>
Co-authored-by: Robert A. Petit III <robbie.petit@gmail.com>
2022-02-28 00:40:24 -07:00

35 lines
959 B
Text

process MAFFT {
tag "$meta.id"
label 'process_high'
conda (params.enable_conda ? "bioconda::mafft=7.490" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mafft:7.490--h779adbc_0':
'quay.io/biocontainers/mafft:7.490--h779adbc_0' }"
input:
tuple val(meta), path(fasta)
output:
tuple val(meta), path("*.fas"), emit: fas
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mafft \\
--thread ${task.cpus} \\
${args} \\
${fasta} \\
> ${prefix}.fas
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mafft: \$(mafft --version 2>&1 | sed 's/^v//' | sed 's/ (.*)//')
END_VERSIONS
"""
}