Home / Tools / samtools sort

Back to samtools

Back To Tools

samtools sort [-l level] [-m maxMem] [-o out.bam] [-O format] [-n] [-t tag] [-T tmpprefix] [-@ threads] [in.sam|in.bam|in.cram] Sort alignments by leftmost coordinates, or by read name when -n is used. An appropriate @HD-SO sort order header tag will be added or an existing one updated if necessary. The sorted output is written to standard output by default, or to the specified file (out.bam) when -o is used. This command will also create temporary files tmpprefix.%d.bam as needed when the entire alignment data cannot fit into memory (as controlled via the -m option).
Tool Uses

No tool instances found


No workflows found

  • HL
    Heng Li

    wrote most of the initial source codes of SAMtools and various converters.

  • BH
    Bob Handsaker

    A major contributor to the SAM/BAM specification. He designed and implemented the BGZF format, the underlying indexable compression format for the BAM format. BGZF does not support arithmetic between file offsets.

  • JR
    Jue Ruan

    Designed and implemented the RAZF format, an alternative indexable compression format. RAZF is no longer used by or provided with SAMtools. Source code remains available in older SAMtools 0.1.x releases and from the standalone branch in the repository.

  • CH
    Colin Hercus

    updated to support gapped alignment by novoalign.

  • PD
    Petr Danecek

    contributed the header parsing library sam_header.c and script.