nf-core_modules/modules/bamtools/split/main.nf

42 lines
1.4 KiB
Text
Raw Normal View History

2021-10-12 12:43:08 +00:00
// 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)}:
Update module: `bamtools/split` (#885) * 👌 IMPROVE: Add some pacbio test files * 🐛 FIX: Add Pacbio index to test_data.config * 👌 IMPROVE: Re add 10000 data test * 👌 IMPROVE: Add some pbindex * 🐛 FIX: Add pbi extension to files * 📦 NEW: Add galgal6 chr30 test data * 📦 NEW: Add bamtools module * 👌 IMPROVE: Ignore test data * 👌 IMPROVE: Update to last templates version * 👌 IMPROVE: Update module to last template version * 👌 IMPROVE: Update module to last template version * 👌 IMPROVE: Final version of test datasets config * 👌 IMPROVE: Remove useless index + Fix Typos * 👌 IMPROVE: Add some pacbio test files * 🐛 FIX: Add Pacbio index to test_data.config * 👌 IMPROVE: Re add 10000 data test * 👌 IMPROVE: Add some pbindex * 🐛 FIX: Add pbi extension to files * 📦 NEW: Add galgal6 chr30 test data * 📦 NEW: Add bamtools module * 👌 IMPROVE: Ignore test data * 👌 IMPROVE: Update to last templates version * 👌 IMPROVE: Update module to last template version * 👌 IMPROVE: Update module to last template version * 👌 IMPROVE: Final version of test datasets config * 👌 IMPROVE: Remove useless index + Fix Typos * 👌 IMPROVE: Update with new versions.yml file * 🐛 FIX: Update meta.yml + correct typos * Update modules/bamtools/split/meta.yml Add bam, split, chunk tags Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> * 🐛 FIX: Correct meta.yml * 🐛 FIX: Grab software name using ${getSoftwareName(task.process)} * 🐛 FIX: Update test.yml Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
2021-10-23 18:39:27 +00:00
${getSoftwareName(task.process)}: \$( bamtools --version | grep -e 'bamtools' | sed 's/^.*bamtools //' )
2021-10-12 12:43:08 +00:00
END_VERSIONS
"""
}