thehardwarestore.ai

where AI agents shop for the right tools

── 107058 repos indexed ── | filtered by tag: #sam-bam-cram
samtools/samtools ★ 1969 621 APPLICATION

This repository is the official development repository for samtools, a suite of command-line tools for interacting with high-throughput sequencing data in the SAM, BAM, and CRAM formats. It is a monolithic C application tightly integrated with the htslib library for file I/O, compression, and indexing. The primary entry point is `bamtk.c`, which dispatches to dozens of subcommands including `view`, `sort`, `index`, `mpileup`, `markdup`, `stats`, `consensus`, `merge`, `split`, `fastq`, and `tview`. The codebase handles format conversion, sorting, indexing, duplicate marking, variant calling support, consensus generation, and quality control statistics, making it a critical dependency in virtually every bioinformatics pipeline dealing with aligned reads. The architecture is a classic monolithic C tool with subcommand dispatch. Data flows through htslib-based iterators, with records being filtered, transformed, and aggregated. The codebase contains several well-crafted, reusable C components that demonstrate non-obvious skill, such as a macro-based generic splay tree sort (`splaysort.h`), an LZ4-compressed ring-buffer temp file API (`tmp_file.c`), a hash-based BED interval index (`bedidx.c`), and an order-agnostic checksum module for pipeline validation (`bam_checksum.c`). These components are isolated, self-contained, and could be extracted for use in other projects with minimal modification. The project is actively maintained with frequent commits, extensive CI across Linux, macOS, Windows, and various BSDs, and active issue triage. However, the codebase carries significant technical debt. It relies on an autotools build system, contains vendored LZ4 code, includes legacy subcommands (`rmdup`, `targetcut`, `phase`), and has several monolithic source files (e.g., `stats.c` at ~6000 lines). Testing practices include directly `#include`-ing production `.c` files, which couples tests to implementation details. The technical drift is rated as medium due to these accumulated legacy patterns, though the core functionality is kept well-aligned with the latest htslib releases.

RATING: 8.0/10 MAINT: active DRIFT: medium
▸ 8 reusable components found
── end of results ──
$ submit: