annotate 0.2.0/modules/spades/assemble/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 SPADES_ASSEMBLE {
kkonganti@11 2 tag "$meta.id"
kkonganti@11 3 label 'process_higher'
kkonganti@11 4
kkonganti@11 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}spades${params.fs}3.15.3" : null)
kkonganti@11 6 conda (params.enable_conda ? 'bioconda::spades=3.15.3' : null)
kkonganti@11 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@11 8 'https://depot.galaxyproject.org/singularity/spades:3.15.3--h95f258a_0' :
kkonganti@11 9 'quay.io/biocontainers/spades:3.15.3--h95f258a_0' }"
kkonganti@11 10
kkonganti@11 11 input:
kkonganti@11 12 tuple val(meta), path(illumina), path(pacbio), path(nanopore)
kkonganti@11 13
kkonganti@11 14 output:
kkonganti@11 15 path "${meta.id}${params.fs}*"
kkonganti@11 16 tuple val(meta), path("${meta.id}${params.fs}scaffolds.fasta"), emit: assembly, optional: true
kkonganti@11 17 tuple val(meta), path("${meta.id}${params.fs}spades.log") , emit: log
kkonganti@11 18 path "versions.yml" , emit: versions
kkonganti@11 19
kkonganti@11 20 when:
kkonganti@11 21 task.ext.when == null || task.ext.when
kkonganti@11 22
kkonganti@11 23 script:
kkonganti@11 24 def args = task.ext.args ?: ''
kkonganti@11 25 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@11 26 def maxmem = task.memory ? "--memory ${task.memory.toGiga()}" : ""
kkonganti@11 27 def illumina_reads = illumina ? ( meta.single_end ? "-s $illumina" : "-1 ${illumina[0]} -2 ${illumina[1]}" ) : ""
kkonganti@11 28 def pacbio_reads = !(pacbio.simpleName ==~ 'dummy_file.*') ? "--pacbio $pacbio" : ""
kkonganti@11 29 def nanopore_reads = !(nanopore.simpleName ==~ 'dummy_file.*') ? "--nanopore $nanopore" : ""
kkonganti@11 30 def custom_hmms = params.spades_hmm ? "--custom-hmms ${params.spades_hmm}" : ""
kkonganti@11 31 """
kkonganti@11 32 spades.py \\
kkonganti@11 33 $args \\
kkonganti@11 34 --threads $task.cpus \\
kkonganti@11 35 $maxmem \\
kkonganti@11 36 $custom_hmms \\
kkonganti@11 37 $illumina_reads \\
kkonganti@11 38 $pacbio_reads \\
kkonganti@11 39 $nanopore_reads \\
kkonganti@11 40 --tmp-dir ${prefix}${params.fs}tmp
kkonganti@11 41 -o ${prefix}
kkonganti@11 42
kkonganti@11 43 cat <<-END_VERSIONS > versions.yml
kkonganti@11 44 "${task.process}":
kkonganti@11 45 spades: \$(spades.py --version 2>&1 | sed 's/^.*SPAdes genome assembler v//; s/ .*\$//')
kkonganti@11 46 END_VERSIONS
kkonganti@11 47 """
kkonganti@11 48 }