skillfed

bx-python

Tools for manipulating biological data, particularly multiple sequence alignments

bx-python v0.14.0 145.7K downloads/30d#11,122 on PyPI161
Permissive license MIT Active released

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

uv

uv add bx-python

poetry

poetry add bx-python

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Bio-InformaticsTopic :: Software Development :: Libraries :: Python Modules

Tags

genome sequence alignment toolsmultiple sequence alignment parserbioinformatics interval indexingMAF AXT LAV format readergenomic data structure librarybiological sequence analysisgenome scale alignment processing
bioinformaticsgenomicssequence-alignment

More Python Modules packages