Samtools is a mature, production-grade command-line toolkit for processing high-throughput sequencing alignment data in SAM, BAM, and CRAM formats. It provides dozens of subcommands covering the full NGS workflow: format conversion (view), sorting, indexing, duplicate marking (markdup), mate-pair fixing (fixmate), depth/coverage calculation, variant calling preparation (mpileup), consensus calling, amplicon analysis, and comprehensive statistics (stats/flagstat). The architecture is a single C binary built on the htslib library, with each subcommand implemented as a separate source file dispatched from bamtk.c. The codebase is well-structured with reusable abstractions for pileup iteration, BED interval indexing, temporary file management, and global option handling. It is actively maintained with extensive regression tests, cross-platform CI (Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris), and a large user community in bioinformatics.
htsjdk is a comprehensive Java library for reading, writing, and manipulating high-throughput sequencing (HTS) data formats, including SAM, BAM, CRAM, VCF, BCF, FASTQ, FASTA, BED, and GFF3. It provides format-specific codecs, indexing (BAI, CRAI, CSI, Tabix, tribble), block-compressed I/O (BGZF with libdeflate acceleration), and a plugin-based codec registry (beta package). The library is used by major bioinformatics tools like Picard, GATK, and IGV. It includes extensive CRAM compression support (rANS, FQZComp, range coding, name tokenisation) and versioned codec implementations for CRAM 3.0/3.1 and VCF 4.0-4.3. The architecture follows a layered design: low-level I/O streams, format-specific readers/writers, and a higher-level plugin framework for content-type decoupling. While the codebase is actively maintained and well-tested, it contains some deprecated APIs, experimental beta code, and a few unimplemented code paths, reflecting its long evolution and breadth of format support.