Mercurial > repos > kkonganti > cfsan_centriflaken
annotate 0.4.0/modules/megahit/assemble/main.nf @ 101:ce6d9548fe89
"planemo upload"
author | kkonganti |
---|---|
date | Thu, 04 Aug 2022 10:45:55 -0400 |
parents | |
children |
rev | line source |
---|---|
kkonganti@101 | 1 process MEGAHIT_ASSEMBLE { |
kkonganti@101 | 2 tag "$meta.id" |
kkonganti@101 | 3 label 'process_higher' |
kkonganti@101 | 4 |
kkonganti@101 | 5 module (params.enable_module ? "${params.swmodulepath}${params.fs}megahit${params.fs}1.2.9" : null) |
kkonganti@101 | 6 conda (params.enable_conda ? "bioconda::megahit=1.2.9" : null) |
kkonganti@101 | 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? |
kkonganti@101 | 8 'https://depot.galaxyproject.org/singularity/megahit:1.2.9--h2e03b76_1' : |
kkonganti@101 | 9 'quay.io/biocontainers/megahit:1.2.9--h2e03b76_1' }" |
kkonganti@101 | 10 |
kkonganti@101 | 11 input: |
kkonganti@101 | 12 tuple val(meta), path(reads) |
kkonganti@101 | 13 |
kkonganti@101 | 14 output: |
kkonganti@101 | 15 tuple val(meta), path("${meta.id}${params.fs}${meta.id}.contigs.fa"), emit: assembly, optional: true |
kkonganti@101 | 16 path "versions.yml" , emit: versions |
kkonganti@101 | 17 |
kkonganti@101 | 18 when: |
kkonganti@101 | 19 task.ext.when == null || task.ext.when |
kkonganti@101 | 20 |
kkonganti@101 | 21 script: |
kkonganti@101 | 22 def args = task.ext.args ?: '' |
kkonganti@101 | 23 def prefix = task.ext.prefix ?: "${meta.id}" |
kkonganti@101 | 24 def maxmem = task.memory ? "--memory ${task.memory.toBytes()}" : "" |
kkonganti@101 | 25 if (meta.single_end) { |
kkonganti@101 | 26 """ |
kkonganti@101 | 27 megahit \\ |
kkonganti@101 | 28 -r ${reads} \\ |
kkonganti@101 | 29 -t $task.cpus \\ |
kkonganti@101 | 30 $maxmem \\ |
kkonganti@101 | 31 $args \\ |
kkonganti@101 | 32 --out-dir $prefix \\ |
kkonganti@101 | 33 --out-prefix $prefix |
kkonganti@101 | 34 |
kkonganti@101 | 35 cat <<-END_VERSIONS > versions.yml |
kkonganti@101 | 36 "${task.process}": |
kkonganti@101 | 37 megahit: \$(echo \$(megahit -v 2>&1) | sed 's/MEGAHIT v//') |
kkonganti@101 | 38 END_VERSIONS |
kkonganti@101 | 39 """ |
kkonganti@101 | 40 } else { |
kkonganti@101 | 41 """ |
kkonganti@101 | 42 megahit \\ |
kkonganti@101 | 43 -1 ${reads[0]} \\ |
kkonganti@101 | 44 -2 ${reads[1]} \\ |
kkonganti@101 | 45 -t $task.cpus \\ |
kkonganti@101 | 46 $maxmem \\ |
kkonganti@101 | 47 $args \\ |
kkonganti@101 | 48 --out-dir $prefix \\ |
kkonganti@101 | 49 --out-prefix $prefix |
kkonganti@101 | 50 |
kkonganti@101 | 51 cat <<-END_VERSIONS > versions.yml |
kkonganti@101 | 52 "${task.process}": |
kkonganti@101 | 53 megahit: \$(echo \$(megahit -v 2>&1) | sed 's/MEGAHIT v//') |
kkonganti@101 | 54 END_VERSIONS |
kkonganti@101 | 55 """ |
kkonganti@101 | 56 } |
kkonganti@101 | 57 } |