BAMWhat
A fast Rust CLI that tells you all you need to know about an unfamiliar BAM, SAM, or CRAM file.
It extracts header metadata, inventories optional tags, measures alignment
characteristics, and infers the likely assay, sequencing technology, reference
build, and aligner. For Oxford Nanopore data, it reports the Dorado basecaller
version from a Dorado @PG VN field, with an explicit version in @RG DS as
a fallback.
The default fast path reads only 100,000 records and uses bounded memory.
Build
Install a current stable Rust toolchain from https://rustup.rs, then:
cargo build --release
./target/release/bamwhat --help
HTSlib compilation requires a C compiler and common compression development libraries. On Debian or Ubuntu:
sudo apt install build-essential pkg-config libssl-dev zlib1g-dev \
libbz2-dev liblzma-dev libcurl4-openssl-dev
Install
pip it!
pip install bamwhat
Use
bamwhat sample.bam
bamwhat sample.bam --json
bamwhat sample.bam --sample 1000000 --threads 4
bamwhat sample.bam --full --json > passport.json
The wheel contains the compiled Rust executable; invoking bamwhat does not
start a Python interpreter. For a local packaging test, run pip install ..
The JSON schema remains versioned separately from the application and is
currently 1.1. The dorado_versions array contains each detected version
and whether it came from @PG VN or @RG DS.
basecall_model=...@v4.3.0 in @RG DS identifies the basecalling model
version, not the Dorado application version, and is deliberately not reported
as a Dorado version.
Performance
- Native HTSlib BAM/SAM/CRAM decoding through
rust-htslib - Optional multithreaded BGZF decompression with
--threads - Bounded-memory streaming
- Early termination after the configured sample
- Release profile uses thin LTO, one codegen unit, and stripped symbols
The current fast path samples the beginning of the alignment stream. A future release can add indexed stratified sampling without changing the report schema.
Test
cargo test
cargo clippy --all-targets -- -D warnings
cargo fmt --check
License
MIT
Metadata
Release files for bamwhat 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bamwhat-0.2.3.tar.gz | 19.6 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bamwhat-0.2.3-py3-none-manylinux_2_38_x86_64.whl | Python 3 | none | Linux glibc 2.38+ x86-64 | Details |
| bamwhat-0.2.3-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 6.7 MB
Release files / bamwhat-0.2.3.tar.gz
| Download URL | bamwhat-0.2.3.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7366a00128653290b87f8cb63e2e92af05b8c10361b7a33ccc480316abbaf6ef
|
|
BLAKE2b-256 checksum How to use checksums |
87697ad3fa4efa6827214c208380e36a37caad166a303a05a142027769532043
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logRelease files / bamwhat-0.2.3-py3-none-manylinux_2_38_x86_64.whl
| Download URL | bamwhat-0.2.3-py3-none-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Linux glibc 2.38+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
9a45d26c2152435bf4c7c10bfa8d68fffe1a0178a658596a7f35b2ab9b9ade6e
|
|
BLAKE2b-256 checksum How to use checksums |
3ef6294cf377b1ba2ef1d03242834bbe912b214d0d160929f4c41d1c1360af60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency logRelease files / bamwhat-0.2.3-py3-none-macosx_11_0_arm64.whl
| Download URL | bamwhat-0.2.3-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
db96e47d655a7325e6e87edfdb66273c4d330bde1cde4f4081f4ccb9ba02ca21
|
|
BLAKE2b-256 checksum How to use checksums |
8c02fac97255a4f0b927df4b702890beeb69fe76076a141b6e88e631e02b271c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 27, 2026.
Transparency log