mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-13 05:13:09 +00:00
42 lines
1.3 KiB
Text
42 lines
1.3 KiB
Text
|
// Import generic module functions
|
||
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
||
|
|
||
|
params.options = [:]
|
||
|
options = initOptions(params.options)
|
||
|
|
||
|
process BAMTOOLS_SPLIT {
|
||
|
tag "$meta.id"
|
||
|
label 'process_low'
|
||
|
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::bamtools=2.5.1" : null)
|
||
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
||
|
container "https://depot.galaxyproject.org/singularity/bamtools:2.5.1--h9a82719_9"
|
||
|
} else {
|
||
|
container "quay.io/biocontainers/bamtools:2.5.1--h9a82719_9"
|
||
|
}
|
||
|
|
||
|
input:
|
||
|
tuple val(meta), path(bam)
|
||
|
|
||
|
output:
|
||
|
tuple val(meta), path("*.bam"), emit: bam
|
||
|
path "versions.yml" , emit: versions
|
||
|
|
||
|
script:
|
||
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||
|
"""
|
||
|
bamtools \\
|
||
|
split \\
|
||
|
-in $bam \\
|
||
|
$options.args
|
||
|
|
||
|
cat <<-END_VERSIONS > versions.yml
|
||
|
${getProcessName(task.process)}:
|
||
|
bamtools: \$( bamtools --version | grep -e 'bamtools' | sed 's/^.*bamtools //' )
|
||
|
END_VERSIONS
|
||
|
"""
|
||
|
}
|