Skip to content

sort BWA-MEM output directly avoiding intermediate write step #315

@sorelfitzgibbon

Description

@sorelfitzgibbon

I think the current steps:

bwa-mem2 \
      mem \
      -t ${task.cpus} \
      -M \
      ${alt_aware_option} \
      -R \"@RG\\tID:${header.read_group_identifier}.Seq${header.lane}\\tCN:${header.sequencing_center}\\tLB:${header.library_identifier}\\tPL:${header.platform_technology}\\tPU:${header.platform_unit}\\tSM:${header.sample}\" \
      ${ref_fasta} \
      ${read1_fastq} \
      ${read2_fastq} | \
samtools \
      view \
      -@ ${task.cpus} \
      -S \
      -b > \
      ${lane_level_bam}
   """
   }

followed by

samtools sort \
    -@ ${task.cpus} \
    -O bam \
    -o ${bam_output_filename} \
    ${sort_order} \
    ${input_bam}

could be replaced with a single process like this:

bwa-mem2 \
      mem \
      -t ${task.cpus} \
      -M \
      ${alt_aware_option} \
      -R \"@RG\\tID:${header.read_group_identifier}.Seq${header.lane}\\tCN:${header.sequencing_center}\\tLB:${header.library_identifier}\\tPL:${header.platform_technology}\\tPU:${header.platform_unit}\\tSM:${header.sample}\" \
      ${ref_fasta} \
      ${read1_fastq} \
      ${read2_fastq} | \
samtools sort \
     -@ ${task.cpus} \
     -o ${bam_output_filename} \
      -

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions