# Install bamtools with Homebrew, apt, MacPorts, Nix

C++ API and command-line toolkit for BAM data. Version 2.5.3 via Homebrew; verified 2026-05-03.

## Install

```sh
sudo av install brew:bamtools
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install bamtools
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bamtools
```

  Evidence: MacPorts ports tree: devel/bamtools/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install bamtools
```

  Evidence: Debian stable package indexes: bamtools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#bamtools
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ba/bamtools/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:bamtools
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/bamtools>
- **Version:** 2.5.3
- **Source summary:** C++ API and command-line toolkit for BAM data
- **Homepage:** <https://github.com/pezmaster31/bamtools>
- **Repository:** <https://github.com/pezmaster31/bamtools>
- **Upstream docs:** <https://github.com/pezmaster31/bamtools/wiki>
- **License:** MIT
- **Source archive:** <https://github.com/pezmaster31/bamtools/archive/refs/tags/v2.5.3.tar.gz>
- **Last updated:** 2026-05-03T16:10:34Z
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- bamtools (cli)
- bamtools (alias)

## Dependencies

- jsoncpp

## Build dependencies

- cmake
- pkgconf

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 2.5.3
- Package-manager updated: 2026-05-03
- Local data: ok
- Upstream repository: https://github.com/pezmaster31/bamtools
- Upstream latest detected: v2.5.3 (current)
## Project history and usage

BamTools is a C++ API and command-line toolkit for working with BAM files, the binary alignment format used throughout high-throughput sequencing workflows. It is a packaging-significant bioinformatics utility because it provides both reusable libraries and small CLI tools for common BAM inspection and transformation jobs.

### Project history

The official repository history begins in April 2009 with an initial import by the BamTools maintainers. The README identifies BamTools as both a programmer's API and an end-user toolkit for BAM files and credits Derek Barnett, Erik Garrison, Gabor Marth, and Michael Stromberg in the 2009-2010 copyright notice.

The README explicitly acknowledges Heng Li's SAMtools as the original C-language BAM API and toolkit, placing BamTools in the second wave of tooling around the SAM/BAM ecosystem: a C++ library and CLI layer for developers and pipeline authors who wanted BAM manipulation without binding directly to SAMtools internals.

BamTools reached the 2.x series by 2011 and has continued to receive maintenance releases, including the 2.5.x line used by modern package managers.

### Adoption history

BamTools became a routine distribution package for bioinformatics environments: the supplied package facts list Homebrew, Debian/Ubuntu, MacPorts, and Nix packages. That adoption matters because genomics pipelines often rely on system packages for reproducible command-line utilities on shared clusters and CI images.

### How it is used

The source tree builds a bamtools toolkit binary with subcommands such as convert, count, coverage, filter, header, index, merge, random, resolve, revert, sort, split, and stats. The same repository also exposes a C++ API for applications that need to read or write BAM data programmatically.

Typical users are bioinformatics developers, sequencing pipeline maintainers, and researchers doing command-line BAM file processing outside larger workflow systems.

### Why package nerds care

For package nerds, BamTools sits at the intersection of library packaging and scientific reproducibility. It is small enough to be a normal Unix package but domain-specific enough that ABI, zlib linkage, and command compatibility matter to downstream genomics stacks.

Its relationship to SAMtools makes it historically useful: SAMtools became the canonical C toolkit, while BamTools offered a C++-oriented alternative that distributions could ship for software expecting the BamTools API.

### Timeline

- 2009: Initial BamTools import appears in the official Git history.
- 2009-2010: README copyright credits the original BamTools authors.
- 2011: v2.0.0 is tagged, establishing the 2.x API/toolkit line.
- 2017: v2.5.1 is tagged in the long-lived 2.5 series.
- 2025: v2.5.3 is tagged as a maintenance release.

### Related projects

- BamTools is directly related to SAMtools and the SAM/BAM file-format ecosystem. It is commonly adjacent to HTSlib/SAMtools-style tooling, alignment pipelines, and downstream genomics packages that consume BAM files.

### Sources

- <https://github.com/pezmaster31/bamtools>
- <https://github.com/pezmaster31/bamtools/blob/master/README>
- <https://github.com/pezmaster31/bamtools/commit/3ba4b5eb3f88fd8f24af8bf83ba218b84faa87ba>
- <https://github.com/pezmaster31/bamtools/wiki>
- input.source_facts.package-manager


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** bamtools
- **Version Scheme:** 0
- **Revision:** 1
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - bamtools - 2.5.2+dfsg-6+b1: normalized package name match | Debian stable package indexes: bamtools from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | toolkit for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Debian apt - libbamtools-dev - 2.5.2+dfsg-6+b1: normalized package name match | Debian stable package indexes: libbamtools-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | C++ API for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Debian apt - libbamtools-doc - 2.5.2+dfsg-6: normalized package name match | Debian stable package indexes: libbamtools-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | docs for dynamic library for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Debian apt - libbamtools2.5.2 - 2.5.2+dfsg-6+b1: normalized package name match | Debian stable package indexes: libbamtools2.5.2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | dynamic library for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Nix - bamtools: normalized package name match | nixpkgs package indexes: pkgs/by-name/ba/bamtools/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - bamtools - 2.5.2+dfsg-4: normalized package name match | Ubuntu 24.04 LTS package indexes: bamtools from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | toolkit for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Ubuntu apt - libbamtools-dev - 2.5.2+dfsg-4: normalized package name match | Ubuntu 24.04 LTS package indexes: libbamtools-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | C++ API for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Ubuntu apt - libbamtools-doc - 2.5.2+dfsg-4: normalized package name match | Ubuntu 24.04 LTS package indexes: libbamtools-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | docs for dynamic library for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- Ubuntu apt - libbamtools2.5.2 - 2.5.2+dfsg-4: normalized package name match | Ubuntu 24.04 LTS package indexes: libbamtools2.5.2 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | dynamic library for manipulating BAM (genome alignment) files | https://github.com/pezmaster31/bamtools/wiki
- MacPorts - bamtools: normalized package name match | MacPorts ports tree: devel/bamtools/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Database and data packages](https://www.automicvault.com/pkg/database-data-tools/) - Matched database, SQL, migration, or data-store metadata.
- [cmake](https://www.automicvault.com/pkg/brew/cmake/) - Build dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [augustus](https://www.automicvault.com/pkg/brew/augustus/) - Popular package that depends on this formula.
- [perbase](https://www.automicvault.com/pkg/brew/perbase/) - Shares av.db curated category or tags: bam, bioinformatics, cli, science.
- [sambamba](https://www.automicvault.com/pkg/brew/sambamba/) - Shares av.db curated category or tags: bam, bioinformatics, cli, science.
- [samtools](https://www.automicvault.com/pkg/brew/samtools/) - Shares av.db curated category or tags: bam, bioinformatics, cli, science.
- [abpoa](https://www.automicvault.com/pkg/brew/abpoa/) - Shares av.db curated category or tags: bioinformatics, cli, science.
- [abricate](https://www.automicvault.com/pkg/brew/abricate/) - Shares av.db curated category or tags: bioinformatics, cli, science.
- [abyss](https://www.automicvault.com/pkg/brew/abyss/) - Shares av.db curated category or tags: bioinformatics, cli, science.
- [adapterremoval](https://www.automicvault.com/pkg/brew/adapterremoval/) - Shares av.db curated category or tags: bioinformatics, cli, science.
- [alevin-fry](https://www.automicvault.com/pkg/brew/alevin-fry/) - Shares av.db curated category or tags: bioinformatics, cli, science.
- [bedops](https://www.automicvault.com/pkg/brew/bedops/) - Local package facts share a topical domain. Shared terms: bioinformatics, cli, data, science.

## Combined YAML source

View the package source record on GitHub. [combined/bamtools.yml](https://github.com/automic-vault/db/blob/main/combined/bamtools.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
