nf-core_modules/software/bwa/mem/main.nf
Paolo Di Tommaso 70daf8be30
Minor style improvents
This commit provides a minor refactoring with som
Nextflow code style improvments:
- Replaces `.toGiga()` with `.giga`
- Replaces `tag { foo }` with `tag "$foo"`
- Move publishDir before input declarations. Directives should be
  before the first input. Tho this is not enforced, it may be in
  future versions.
- Replaces input `file` with `path`
- Remove unnecessary parentheses
2020-07-27 12:11:42 +02:00

27 lines
704 B
Text

params.bwa_options = "-M -B 2"
params.sequencer = "ILLUMINA"
process bwa_mem {
tag "$id"
publishDir "${params.outdir}/bwa_mem", mode: 'copy'
//TO-DO: Change container declaration, for now a test container is present in my personal docker acccount
container 'jeremy1805/bwa-mem-img'
input:
tuple val(id), path(reads)
path genomeindex
val indexprefix
output:
tuple path("*.bam"), path("*.bai")
script:
"""
bwa mem -t ${task.cpus} -R "@RG\\tID:${id}\\tLB:${id}\\tSM:${id}\\tPL:${params.sequencer}" \\
${params.bwa_options} ${indexprefix} ${reads} | samtools sort -@8 -O BAM -o ${id}.bam -
samtools index ${id}.bam
"""
}