nf-core_modules/modules/gecco/run/main.nf
James A. Fellows Yates 5644df8d43
Update module: Gecco fix to no file generated if no hits found (#1930)
* Make gene and cluster TSVs optional output in case no hits found

* update indicating optional output

* Apply suggestions from code review

Co-authored-by: Jasmin F <73216762+jasmezz@users.noreply.github.com>

Co-authored-by: Jasmin F <73216762+jasmezz@users.noreply.github.com>
2022-07-27 15:19:43 +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") , optional: true, emit: genes
tuple val(meta), path("*.features.tsv") , emit: features
tuple val(meta), path("*.clusters.tsv") , optional: true, 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
"""
}