Registry / data / pybigtools

pybigtools

JSON →
library0.2.5pypypi✓ verified 86d ago

Python bindings to the Bigtools Rust library for high-performance BigWig and BigBed I/O. Version 0.2.5 (latest) focuses on reading and writing genomic interval files with performance comparable to the Rust implementation. Release cadence is irregular; the library is actively maintained.

pip install pybigtools
INSTALL
IMPORT
SIG · PYBIGTOOLS
P
pybigtools
datapythonv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

open
from pybigtools import open
import pybigtools
Direct import of the 'open' function is required; the module itself is not callable.
BigWig
from pybigtools import BigWig
from pybigtools import bigwig
Class name is BigWig, not lowercase bigwig.
BigBed
from pybigtools import BigBed
from pybigtools import bigbed
Class name is BigBed, not lowercase bigbed.

Open a BigWig file, list chromosomes, and fetch values over a region.

from pybigtools import open with open('example.bw') as bw: print(bw.chroms) vals = bw.fetch('chr1', 1000000, 1000100) print(vals)
Debug
Known issues
breakingIn pybigtools v0.1.x, the main function was named 'read_bigwig' instead of 'open'. Code written for v0.1.x must be updated.
fix
Replace 'read_bigwig' with 'open' from pybigtools.
affects: <0.2.0
gotchaThe 'open' function does not auto-detect file type; you must use the correct class (BigWig or BigBed) or rely on the context manager which returns a generic object with common methods. Manually constructing BigWig or BigBed objects is preferred for type safety.
fix
Use 'from pybigtools import BigWig, BigBed' and instantiate directly: 'bw = BigWig('file.bw')' to get BigWig-specific methods.
affects: all
gotchaFile handles must be closed explicitly or used with 'with' statement; resources are not freed on garbage collection alone.
fix
Always use 'with open(...) as f:' or call '.close()' on the object.
affects: all
Errors
Common errors & fixes
AttributeError: module 'pybigtools' has no attribute 'read_bigwig'
API changed from read_bigwig to open in v0.2.0.
fix
Use 'from pybigtools import open' and call 'open(filename)'.
TypeError: 'Bytes' object cannot be interpreted as an integer
Fetch returns values as bytes; expecting int list.
fix
Use '.tolist()' or specify dtype; ensure the region coordinates are correct.
Upgrade
Version history
0.2.5latest on PyPI · released Feb 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pybigtools — pip install pybigtools · libregistry