nf-core_modules/modules/gecco/run/main.nf
James A. Fellows Yates 9d7208504d
Add gecco/run module (#1790)
* Add gecco/run module

* Fix container URLs

* Apply suggestions from code review

Co-authored-by: Jasmin F <73216762+jasmezz@users.noreply.github.com>
2022-06-22 13:43:45 +02:00

47 lines
1.4 KiB
Text

process GECCO_RUN {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::gecco=0.9.2" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/gecco:0.9.2--pyhdfd78af_0':
'quay.io/biocontainers/gecco:0.9.2--pyhdfd78af_0' }"
input:
tuple val(meta), path(input), path(hmm)
path model_dir
output:
tuple val(meta), path("*.genes.tsv") , emit: genes
tuple val(meta), path("*.features.tsv") , emit: features
tuple val(meta), path("*.clusters.tsv") , emit: clusters
tuple val(meta), path("*_cluster_*.gbk"), optional: true, emit: gbk
tuple val(meta), path("*.json") , optional: true, emit: json
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}"
def custom_model = model_dir ? "--model ${model_dir}" : ""
def custom_hmm = hmm ? "--hmm ${hmm}" : ""
"""
gecco \\
run \\
$args \\
-j $task.cpus \\
-o ./ \\
-g ${input} \\
$custom_model \\
$custom_hmm
cat <<-END_VERSIONS > versions.yml
"${task.process}":
gecco: \$(echo \$(gecco --version) | cut -f 2 -d ' ' )
END_VERSIONS
"""
}