samtools/htslib logo

samtools/htslib

Free

C library for high-throughput sequencing data formats

FreeFree tier
Type
Open Source

About samtools/htslib

HTSlib is a unified C library for accessing common file formats used in high-throughput sequencing data, including SAM, CRAM, and VCF. It serves as the core library for samtools and bcftools, enabling efficient reading, writing, and manipulation of sequencing data. HTSlib has minimal dependencies, relying only on zlib, and is compatible with gcc, g++ and clang. It implements a generalized BAM index (CSI format) and includes the popular tabix indexer and bgzip compression utility. The library is widely adopted in bioinformatics and is maintained by the samtools project.

Key Features

Unified C library for SAM, CRAM and VCF file formats
Core library used by samtools and bcftools
Minimal dependencies: only requires zlib
Compatible with gcc, g++ and clang
Implements generalized BAM index (.csi)
Includes tabix indexer and bgzip compression utility

Pros & Cons

Pros
  • Lightweight dependency chain (only zlib required)
  • Widely adopted and trusted in the bioinformatics community
  • Supports multiple common sequencing data formats in one library
  • Includes utility programs (tabix, bgzip) for common tasks
  • Well-documented with a published paper and active maintenance
Cons
  • Not a standalone application; requires C programming knowledge to use directly
  • Steep learning curve for users unfamiliar with sequencing data formats and C development

Best For

Accessing and manipulating high-throughput sequencing data (SAM, CRAM, VCF)Building bioinformatics tools that require reading/writing alignment or variant filesIndexing and compressing sequencing data files with tabix and bgzipAs a foundation for developing custom genomic data processing pipelines

FAQ

What file formats does HTSlib support?
HTSlib supports SAM, CRAM, and VCF formats, which are common in high-throughput sequencing.
Is HTSlib the same as samtools?
No, HTSlib is the core C library used by samtools and bcftools, but it is not a standalone application.