mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-11 04:33:10 +00:00
906577873b
* New functions.nf * Convert code to create versions.yml * Update meta.yml * update output channel * Fix more meta.yml * Manually update remaining modules * remove superflous echo * Fix misformatted meta.yml files * Fix yaml, was list instead of dict * fix version for bcftools Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
62 lines
2.1 KiB
Text
62 lines
2.1 KiB
Text
// Import generic module functions
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
|
|
|
params.options = [:]
|
|
options = initOptions(params.options)
|
|
|
|
process BBMAP_ALIGN {
|
|
tag "$meta.id"
|
|
label 'process_medium'
|
|
publishDir "${params.outdir}",
|
|
mode: params.publish_dir_mode,
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
|
|
|
conda (params.enable_conda ? "bioconda::bbmap=38.92 bioconda::samtools=1.13 pigz=2.6" : null)
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
container "https://depot.galaxyproject.org/singularity/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0"
|
|
} else {
|
|
container "quay.io/biocontainers/mulled-v2-008daec56b7aaf3f162d7866758142b9f889d690:f5f55fc5623bb7b3f725e8d2f86bedacfd879510-0"
|
|
}
|
|
|
|
input:
|
|
tuple val(meta), path(fastq)
|
|
path ref
|
|
|
|
output:
|
|
tuple val(meta), path("*.bam"), emit: bam
|
|
path "versions.yml" , emit: version
|
|
|
|
script:
|
|
def software = getSoftwareName(task.process)
|
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
|
|
|
input = meta.single_end ? "in=${fastq}" : "in=${fastq[0]} in2=${fastq[1]}"
|
|
|
|
// Set the db variable to reflect the three possible types of reference input: 1) directory
|
|
// named 'ref', 2) directory named something else (containg a 'ref' subdir) or 3) a sequence
|
|
// file in fasta format
|
|
if ( ref.isDirectory() ) {
|
|
if ( ref ==~ /(.\/)?ref\/?/ ) {
|
|
db = ''
|
|
} else {
|
|
db = "path=${ref}"
|
|
}
|
|
} else {
|
|
db = "ref=${ref}"
|
|
}
|
|
|
|
"""
|
|
bbmap.sh \\
|
|
$db \\
|
|
$input \\
|
|
out=${prefix}.bam \\
|
|
$options.args \\
|
|
threads=$task.cpus \\
|
|
-Xmx${task.memory.toGiga()}g
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
${getProcessName(task.process)}:
|
|
${getSoftwareName(task.process)}: \$(bbversion.sh)
|
|
END_VERSIONS
|
|
"""
|
|
}
|