samtools/samtools logo

samtools/samtools

Free

Tools (written in C using htslib) for manipulating next-generation sequencing data

FreeFree tier
Type
Open Source

About samtools/samtools

Samtools is a suite of programs for manipulating next-generation sequencing data, written in C using the htslib library. It provides a wide range of tools for working with SAM, BAM, and CRAM alignment formats, including sorting, indexing, merging, duplicate marking, depth calculation, variant calling (mpileup), consensus calling, filtering, and statistical analysis. Originally part of a larger package, it now operates as a core component alongside htslib and bcftools. Samtools is the de facto standard for processing high-throughput sequencing data in bioinformatics pipelines.

Key Features

SAM, BAM, and CRAM format support
mpileup for SNP/indel variant calling
Sorting and indexing of alignment files
Duplicate marking and removal (bam_markdup, bam_rmdup)
Read merging, splitting, and reheader operations
Depth and coverage calculation (bam2depth, coverage)
Consensus generation and pileup
Filtering, statistical analysis, and quality metrics (stats, bam_stat)
Conversion between SAM, BAM, CRAM, and FASTQ formats
Integration with htslib and bcftools for extended functionality

Pros & Cons

Pros
  • Comprehensive and mature suite covering almost all common NGS manipulation tasks
  • Industry-standard tool with widespread adoption in bioinformatics pipelines
  • Efficient C implementation with low memory footprint
  • Tight integration with htslib and bcftools for seamless workflows
  • Actively maintained open-source project with large community
Cons
  • Command-line interface only, no graphical user interface
  • Requires familiarity with bioinformatics file formats and command-line tools
  • Some operations (e.g., mpileup) can be computationally intensive on large datasets
  • Documentation may be sparse for advanced use cases

Best For

Processing and analyzing whole-genome and exome sequencing dataPreparing alignment files for downstream variant detectionQuality control and validation of NGS alignmentsExtracting consensus sequences from pileup dataGenome-wide depth estimation and coverage analysisRead deduplication for PCR-free libraries

FAQ

What formats does samtools support?
Samtools primarily works with SAM, BAM, and CRAM alignment formats, as well as FASTA references and FASTQ for conversion.
How do I install samtools?
Samtools can be built from source using autoconf and autoconf, or installed via package managers like conda, apt, and Homebrew. Precompiled binaries are available for major platforms.
How should I cite samtools?
Samtools should be cited by referencing the original paper: Li et al. (2009) The Sequence Alignment/Map format and SAMtools. Bioinformatics, 25(16), 2078-2079.