annotate 0.6.1/modules/bbtools/bbmerge/main.nf @ 12:c5faadb3386f

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:57:15 -0400
parents 749faef1caa9
children
rev   line source
kkonganti@11 1 process BBTOOLS_BBMERGE {
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}bbtools${params.fs}38.94" : null)
kkonganti@11 6 conda (params.enable_conda ? "conda-forge::pbzip2 bioconda::bbmap=38.95" : null)
kkonganti@11 7 container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
kkonganti@11 8 'https://depot.galaxyproject.org/singularity/bbmap:38.95--he522d1c_0' :
kkonganti@11 9 'quay.io/biocontainers/bbmap:38.95--he522d1c_0' }"
kkonganti@11 10
kkonganti@11 11 input:
kkonganti@11 12 tuple val(meta), path(reads)
kkonganti@11 13
kkonganti@11 14 output:
kkonganti@11 15 tuple val(meta), path("*.fastq.gz"), emit: fastq
kkonganti@11 16 tuple val(meta), path("*.log") , emit: log
kkonganti@11 17 path "versions.yml" , emit: versions
kkonganti@11 18
kkonganti@11 19 when:
kkonganti@11 20 !meta.single_end
kkonganti@11 21
kkonganti@11 22 script:
kkonganti@11 23 def args = task.ext.args ?: ''
kkonganti@11 24 def prefix = task.ext.prefix ?: "${meta.id}"
kkonganti@11 25 def in_files = "in1=${reads[0]} in2=${reads[1]}"
kkonganti@11 26 def out_file = "out=${prefix}.bbmerge.fastq.gz"
kkonganti@11 27 def adapters_file = file (meta.adapters)
kkonganti@11 28 def adapters = !("${adapters_file.simpleName}" ==~ 'dummy_file.*') && adapters_file.exits() ? "adapters=${meta.adapters}" : ''
kkonganti@11 29 def args_formatted = args.replaceAll('=\s+', '=')
kkonganti@11 30 """
kkonganti@11 31 bbmerge.sh \\
kkonganti@11 32 -Xmx${task.memory.toGiga()}G \\
kkonganti@11 33 threads=$task.cpus \\
kkonganti@11 34 $args_formatted \\
kkonganti@11 35 $adapters \\
kkonganti@11 36 $in_files \\
kkonganti@11 37 $out_file &> ${prefix}.bbmerge.log
kkonganti@11 38
kkonganti@11 39 cat <<-END_VERSIONS > versions.yml
kkonganti@11 40 "${task.process}":
kkonganti@11 41 bbmerge: \$( bbversion.sh )
kkonganti@11 42 END_VERSIONS
kkonganti@11 43 """
kkonganti@11 44 }