Skip to content

Commit efbf86b

Browse files
authored
Use samtools sort to convert to BAM (nf-core#4858)
* samtools sort can output the bam file directly * Added args2 to support giving extra options to samtools sort
1 parent 6ea5109 commit efbf86b

File tree

1 file changed

+3
-2
lines changed
  • modules/nf-core/minimap2/align

1 file changed

+3
-2
lines changed

modules/nf-core/minimap2/align/main.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ process MINIMAP2_ALIGN {
2424
task.ext.when == null || task.ext.when
2525

2626
script:
27-
def args = task.ext.args ?: ''
27+
def args = task.ext.args ?: ''
28+
def args2 = task.ext.args2 ?: ''
2829
def prefix = task.ext.prefix ?: "${meta.id}"
29-
def bam_output = bam_format ? "-a | samtools sort | samtools view -@ ${task.cpus} -b -h -o ${prefix}.bam" : "-o ${prefix}.paf"
30+
def bam_output = bam_format ? "-a | samtools sort -@ ${task.cpus} -o ${prefix}.bam ${args2}" : "-o ${prefix}.paf"
3031
def cigar_paf = cigar_paf_format && !bam_format ? "-c" : ''
3132
def set_cigar_bam = cigar_bam && bam_format ? "-L" : ''
3233
"""

0 commit comments

Comments
 (0)