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