bx-python
Tools for manipulating biological data, particularly multiple sequence alignments
What it is and what it does
bx-python is a bioinformatics library for working with genome-scale sequence alignments and genomic intervals. It provides specialized data structures for reading multiple local alignments in MAF, AXT, and LAV formats, plus efficient in-memory and on-disk indexing for random access to large alignment files. The library also includes interval-based data structures such as binned bitsets (compact chromosome-sized bit arrays) and an intersecter for fast overlap queries that preserve both query and target intervals with their annotations.
The package is designed for rapid prototyping and implementation of genome-scale analyses. It sits between raw sequence data and higher-level analysis pipelines, offering the low-level data manipulation and indexing primitives that genomics workflows need. Dependencies on numpy and pyparsing keep the core lightweight, though building from source requires the liblzo2 compression library.
Use it for:
- Parse and iterate over large MAF alignment files to extract pairwise or multiple sequence alignments for downstream analysis.
- Index genome alignments for random access without loading entire files into memory, especially useful over network filesystems.
- Perform fast interval overlap queries on genomic coordinates while preserving both query and target annotations.
- Build compact representations of genomic features using binned bitsets for memory-efficient chromosome-scale operations.
- Implement custom genome-scale comparative analysis pipelines that require flexible interval and alignment data structures.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
bx-python provides Python classes and utilities for reading, indexing, and analyzing genome-scale sequence alignments and interval data, with specialized support for MAF, AXT, and LAV alignment formats.
Yes, if you work with genome-scale sequence alignments or need efficient interval indexing on genomic data. The package is actively maintained, supports current Python versions, carries no known vulnerabilities, and has a permissive license. Install friction is moderate due to liblzo2 dependency, but pre-built wheels are available for common platforms. Not relevant for non-bioinformatics use cases.
Install
bx-python on PyPI
pip
pip install bx-pythonuv
uv add bx-pythonpoetry
poetry add bx-pythonInstalling bx-python
Before you install
Medium install friction due to compiled dependencies (requires liblzo2-dev system library). Maintenance is active with recent commits and broad wheel coverage across Python 3.9–3.14 and multiple platforms.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install bx-python
import bx.align.maf
reader = bx.align.maf.Reader(open('alignments.maf'))
for alignment in reader:
print(alignment)
Requires liblzo2-dev system library (e.g., apt-get install liblzo2-dev on Debian/Ubuntu) to build from source.
Verify before relying
- Exact performance characteristics for large-scale alignment files or network filesystem access patterns.
- Whether bitset and intersecter implementations are thread-safe or require external synchronization.
- Current state of documentation and examples beyond the repository README.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 2 — numpy, pyparsing |
| Maintenance | actively maintained — 380 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 145,661/month — #11,122 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bx_python-0.14.0-cp310-cp310-macosx_10_9_x86_64.whl; bx_python-0.14.0-cp310-cp310-macosx_11_0_arm64.whl; bx_python-0.14.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bx_python-0.14.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; bx_python-0.14.0-cp310-cp310-musllinux_1_2_aarch64.whl; bx_python-0.14.0-cp310-cp310-musllinux_1_2_x86_64.whl; bx_python-0.14.0-cp311-cp311-macosx_10_9_x86_64.whl; bx_python-0.14.0-cp311-cp311-macosx_11_0_arm64.whl; bx_python-0.14.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bx_python-0.14.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; bx_python-0.14.0-cp311-cp311-musllinux_1_2_aarch64.whl; bx_python-0.14.0-cp311-cp311-musllinux_1_2_x86_64.whl; bx_python-0.14.0-cp312-cp312-macosx_10_13_x86_64.whl; bx_python-0.14.0-cp312-cp312-macosx_11_0_arm64.whl; bx_python-0.14.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; bx_python-0.14.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; bx_python-0.14.0-cp312-cp312-musllinux_1_2_aarch64.whl; bx_python-0.14.0-cp312-cp312-musllinux_1_2_x86_64.whl; bx_python-0.14.0-cp313-cp313-macosx_10_13_x86_64.whl; bx_python-0.14.0-cp313-cp313-macosx_11_0_arm64.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
biotiteBiotite provides a unified Python library for…
permissive · top 5,000 on PyPI
varcodeVarcode loads and analyzes genomic variant…
permissive · top 15,000 on PyPI
biocommons.seqrepoSeqRepo stores and retrieves biological…
permissive · top 15,000 on PyPI
pybedtoolsWraps the BEDTools suite to perform genomic…
permissive · top 15,000 on PyPI
pyrangesPyRanges provides efficient querying and…
permissive · top 15,000 on PyPI
pyensemblPyEnsembl provides a Python interface to query…
permissive · top 15,000 on PyPI
abnumberAbNumber provides Python APIs to number and…
permissive · top 15,000 on PyPI
refgenieRefgenie manages standardized folder structures…
permissive · top 15,000 on PyPI
logomakerLogomaker creates customized sequence…
permissive · top 15,000 on PyPI
pyBigWigA Python C extension for reading and writing…
permissive · top 15,000 on PyPI