annotate 0.7.0/modules/bbtools/bbmerge/main.nf @ 17:0e7a0053e4a6

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