diff 0.6.1/modules/abricate/run/main.nf @ 11:749faef1caa9

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:51:40 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/0.6.1/modules/abricate/run/main.nf	Tue Sep 05 11:51:40 2023 -0400
@@ -0,0 +1,48 @@
+process ABRICATE_RUN {
+    tag "$meta.id"
+    label 'process_micro'
+
+    module (params.enable_module ? "${params.swmodulepath}${params.fs}abricate${params.fs}1.0.1" : null)
+    conda (params.enable_conda ? "conda-forge::perl bioconda::abricate=1.0.1" : null)
+    container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
+        'https://depot.galaxyproject.org/singularity/abricate%3A1.0.1--ha8f3691_1':
+        'quay.io/biocontainers/abricate:1.0.1--ha8f3691_1' }"
+
+    input:
+    tuple val(meta), path(assembly)
+    val abdbs
+
+    output:
+    path "${meta.id}${params.fs}*"
+    tuple val(meta), path("${meta.id}${params.fs}*.ab.txt"), emit: abricated
+    path "versions.yml"                                    , emit: versions
+
+    when:
+    (task.ext.when == null || task.ext.when) && assembly.size() > 0
+
+    script:
+    def args = task.ext.args ?: ''
+    def prefix = task.ext.prefix ?: "${meta.id}"
+    def dbs = abdbs.collect().join('\\n')
+    """
+    newprefix="${prefix}${params.fs}${prefix}"
+
+    if [ ! -d "$prefix" ]; then
+        mkdir "$prefix" || exit 1
+    fi
+
+    echo -e "$dbs" | while read -r db; do
+        abricate \\
+            $assembly \\
+            $args \\
+            --db \$db \\
+            --threads $task.cpus 1> "\${newprefix}.\${db}.ab.txt"
+    done
+
+    cat <<-END_VERSIONS > versions.yml
+    "${task.process}":
+        abricate: \$(echo \$(abricate --version 2>&1) | sed 's/^.*abricate //' )
+        bash: \$( bash --version 2>&1 | sed '1!d; s/^.*version //; s/ (.*\$//' )
+    END_VERSIONS
+    """
+}
\ No newline at end of file