annotate 0.4.2/modules/seqsero2/main.nf @ 143:620bffa66bbb tip

planemo upload
author kkonganti
date Thu, 11 Jul 2024 14:48:07 -0400
parents 52045ea4679d
children
rev   line source
kkonganti@105 1 process SEQSERO2 {
kkonganti@105 2 tag "$meta.id"
kkonganti@105 3 label 'process_low'
kkonganti@105 4
kkonganti@105 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}seqsero2${params.fs}1.2.1" : null)
kkonganti@105 6 conda (params.enable_conda ? "bioconda::seqsero2=1.2.1" : null)
kkonganti@105 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@105 8 'https://depot.galaxyproject.org/singularity/seqsero2:1.2.1--py_0' :
kkonganti@105 9 'quay.io/biocontainers/seqsero2:1.2.1--py_0' }"
kkonganti@105 10
kkonganti@105 11 input:
kkonganti@105 12 tuple val(meta), path(reads_or_asm)
kkonganti@105 13
kkonganti@105 14 output:
kkonganti@105 15 path("${meta.id}${params.fs}*")
kkonganti@105 16 tuple val(meta), path("${meta.id}${params.fs}*_result.tsv"), emit: serotyped
kkonganti@105 17 path "versions.yml" , emit: versions
kkonganti@105 18
kkonganti@105 19 when:
kkonganti@105 20 (task.ext.when == null || task.ext.when) && reads_or_asm.size() > 0
kkonganti@105 21
kkonganti@105 22 script:
kkonganti@105 23 def args = task.ext.args ?: ''
kkonganti@105 24 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@105 25 """
kkonganti@105 26 SeqSero2_package.py \\
kkonganti@105 27 $args \\
kkonganti@105 28 -d $prefix \\
kkonganti@105 29 -n $prefix \\
kkonganti@105 30 -p $task.cpus \\
kkonganti@105 31 -i $reads_or_asm
kkonganti@105 32
kkonganti@105 33 mv ${prefix}${params.fs}SeqSero_log.txt ${prefix}${params.fs}${prefix}.SeqSero_log.txt
kkonganti@105 34 mv ${prefix}${params.fs}SeqSero_result.txt ${prefix}${params.fs}${prefix}.SeqSero_result.txt
kkonganti@105 35 mv ${prefix}${params.fs}SeqSero_result.tsv ${prefix}${params.fs}${prefix}.SeqSero_result.tsv
kkonganti@105 36
kkonganti@105 37 cat <<-END_VERSIONS > versions.yml
kkonganti@105 38 "${task.process}":
kkonganti@105 39 seqsero2: \$( echo \$( SeqSero2_package.py --version 2>&1) | sed 's/^.*SeqSero2_package.py //' )
kkonganti@105 40 END_VERSIONS
kkonganti@105 41 """
kkonganti@105 42 }