kkonganti@1: process BBTOOLS_BBMERGE { kkonganti@1: tag "$meta.id" kkonganti@1: label 'process_micro' kkonganti@1: kkonganti@1: module (params.enable_module ? "${params.swmodulepath}${params.fs}bbtools${params.fs}38.94" : null) kkonganti@1: conda (params.enable_conda ? "conda-forge::pbzip2 bioconda::bbmap=38.95" : null) kkonganti@1: container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? kkonganti@1: 'https://depot.galaxyproject.org/singularity/bbmap:38.95--he522d1c_0' : kkonganti@1: 'quay.io/biocontainers/bbmap:38.95--he522d1c_0' }" kkonganti@1: kkonganti@1: input: kkonganti@1: tuple val(meta), path(reads) kkonganti@1: kkonganti@1: output: kkonganti@1: tuple val(meta), path("*.fastq.gz"), emit: fastq kkonganti@1: tuple val(meta), path("*.log") , emit: log kkonganti@1: path "versions.yml" , emit: versions kkonganti@1: kkonganti@1: when: kkonganti@1: !meta.single_end kkonganti@1: kkonganti@1: script: kkonganti@1: def args = task.ext.args ?: '' kkonganti@1: def prefix = task.ext.prefix ?: "${meta.id}" kkonganti@1: def in_files = "in1=${reads[0]} in2=${reads[1]}" kkonganti@1: def out_file = "out=${prefix}.bbmerge.fastq.gz" kkonganti@1: def adapters_file = file (meta.adapters) kkonganti@1: def adapters = !("${adapters_file.simpleName}" ==~ 'dummy_file.*') && adapters_file.exits() ? "adapters=${meta.adapters}" : '' kkonganti@1: def args_formatted = args.replaceAll('=\s+', '=') kkonganti@1: """ kkonganti@1: bbmerge.sh \\ kkonganti@1: -Xmx${task.memory.toGiga()}G \\ kkonganti@1: threads=$task.cpus \\ kkonganti@1: $args_formatted \\ kkonganti@1: $adapters \\ kkonganti@1: $in_files \\ kkonganti@1: $out_file &> ${prefix}.bbmerge.log kkonganti@1: kkonganti@1: cat <<-END_VERSIONS > versions.yml kkonganti@1: "${task.process}": kkonganti@1: bbmerge: \$( bbversion.sh ) kkonganti@1: END_VERSIONS kkonganti@1: """ kkonganti@1: }