annotate 0.2.0/modules/masurca/polish/main.nf @ 15:7c0407ebbdf3

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