annotate 0.1.0/modules/masurca/polish/main.nf @ 10:ddf7a172bf30

"planemo upload"
author kkonganti
date Wed, 29 Nov 2023 10:53:42 -0500
parents d8913a37810a
children
rev   line source
kkonganti@0 1 process MASURCA_POLISH {
kkonganti@0 2 tag "$meta.id"
kkonganti@0 3 label 'process_micro'
kkonganti@0 4
kkonganti@0 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}masurca${params.fs}4.1.0" : null)
kkonganti@0 6 conda (params.enable_conda ? "bioconda::masurca=4.1.0 conda-forge::libgcc-ng" : null)
kkonganti@0 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@0 8 'https://depot.galaxyproject.org/singularity/masurca:4.1.0--pl5321hb5bd705_1' :
kkonganti@0 9 'quay.io/biocontainers/masurca:4.1.0--pl5321hb5bd705_1' }"
kkonganti@0 10
kkonganti@0 11 input:
kkonganti@0 12 tuple val(meta), path(contigs), path(reads)
kkonganti@0 13
kkonganti@0 14 output:
kkonganti@0 15 tuple val(meta), path("${prefix}_contigs.fa"), emit: polished
kkonganti@0 16 path "versions.yml" , emit: versions
kkonganti@0 17
kkonganti@0 18 when:
kkonganti@0 19 task.ext.when == null || task.ext.when
kkonganti@0 20
kkonganti@0 21 script:
kkonganti@0 22 def args = task.ext.args ?: ''
kkonganti@8 23 def memory = (task.memory ? task.memory.toGiga() : 16)
kkonganti@8 24 def mem_per_thread = memory.toGiga().toInteger().div(task.cpus.toInteger()).round(0)
kkonganti@0 25 def all_reads = "${reads.join(' ')}"
kkonganti@0 26 prefix = (task.ext.prefix ?: meta.id)
kkonganti@0 27 """
kkonganti@0 28 polca.sh \\
kkonganti@0 29 -a $contigs \\
kkonganti@0 30 -r '${all_reads}' \\
kkonganti@0 31 -t $task.cpus \\
kkonganti@0 32 -m $mem_per_thread \\
kkonganti@0 33 $args \\
kkonganti@0 34
kkonganti@0 35 mv 'contigs.fa' "${prefix}.contigs.fa"
kkonganti@0 36
kkonganti@0 37 cat <<-END_VERSIONS > versions.yml
kkonganti@0 38 "${task.process}":
kkonganti@0 39 masurca: \$(echo \$(masurca --version 2>&1) | sed 's/^.*version //')
kkonganti@0 40 END_VERSIONS
kkonganti@0 41 """
kkonganti@0 42 }