# 使用 Homebrew, apt, MacPorts, Nix 安装 bamtools

查看 bamtools 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bamtools
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bamtools
```

  证据: 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
```

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:bamtools
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/bamtools>
- **版本:** 2.5.3
- **来源摘要:** C++ API and command-line toolkit for BAM data
- **主页:** <https://github.com/pezmaster31/bamtools>
- **仓库:** <https://github.com/pezmaster31/bamtools>
- **许可证:** MIT
- **源码归档:** <https://github.com/pezmaster31/bamtools/archive/refs/tags/v2.5.3.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- bamtools (cli)
- bamtools (别名)

## 依赖

- jsoncpp

## 构建依赖

- cmake
- pkgconf

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 2.5.3
- 本地数据: OK
- 上游仓库: https://github.com/pezmaster31/bamtools
- 检测到的最新版本: v2.5.3 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

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.

### 项目历史

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.

### 采用历史

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.

### 使用方式

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.

### 为什么软件包爱好者会关心

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.

### 时间线

- 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.

### 来源

- <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


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **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

## 其他软件包管理器记录

- 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


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Database and data packages](https://pkg.so/zh-hans/database-data-tools/) - Matched database, SQL, migration, or data-store metadata.
- [pkgconf](https://pkg.so/zh-hans/brew/pkgconf/) - Build dependency declared by Homebrew.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Build dependency declared by Homebrew.
- [augustus](https://pkg.so/zh-hans/brew/augustus/) - Popular package that depends on this formula.
- [samtools](https://pkg.so/zh-hans/brew/samtools/) - Shares pkgdb curated category or tags: bam, bioinformatics, cli, genomics, science.
- [bedtools](https://pkg.so/zh-hans/brew/bedtools/) - Shares pkgdb curated category or tags: bam, bioinformatics, cli, genomics, science.
- [sambamba](https://pkg.so/zh-hans/brew/sambamba/) - Shares pkgdb curated category or tags: bam, bioinformatics, cli, genomics, science.
- [perbase](https://pkg.so/zh-hans/brew/perbase/) - Shares pkgdb curated category or tags: bam, bioinformatics, cli, genomics, science.
- [mosdepth](https://pkg.so/zh-hans/brew/mosdepth/) - Shares pkgdb curated category or tags: bam, bioinformatics, cli, genomics, science.
- [blast](https://pkg.so/zh-hans/brew/blast/) - Shares pkgdb curated category or tags: bioinformatics, cli, genomics, science.
- [minimap2](https://pkg.so/zh-hans/brew/minimap2/) - Shares pkgdb curated category or tags: bioinformatics, cli, genomics, science.
- [bbtools](https://pkg.so/zh-hans/brew/bbtools/) - Shares pkgdb curated category or tags: bioinformatics, cli, genomics, science.
- [bedops](https://pkg.so/zh-hans/brew/bedops/) - Local package facts share a topical domain. Shared terms: bioinformatics, cli, data, genomics, science.

## Combined YAML source

View the package source record on GitHub. [combined/bamtools.yml](https://github.com/mxcl/pkgdb/blob/main/combined/bamtools.yml)


## 来源

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