comparison 0.5.0/modules/bbtools/bbmerge/main.nf @ 1:365849f031fd

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