{"id":27270,"library":"pybigtools","title":"pybigtools","description":"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.","status":"active","version":"0.2.5","language":"python","source_language":"en","source_url":"https://github.com/dekkerlab/pybigtools","tags":["bioinformatics","genomics","bigwig","bigbed","rust","high-performance"],"install":[{"cmd":"pip install pybigtools","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import of the 'open' function is required; the module itself is not callable.","wrong":"import pybigtools","symbol":"open","correct":"from pybigtools import open"},{"note":"Class name is BigWig, not lowercase bigwig.","wrong":"from pybigtools import bigwig","symbol":"BigWig","correct":"from pybigtools import BigWig"},{"note":"Class name is BigBed, not lowercase bigbed.","wrong":"from pybigtools import bigbed","symbol":"BigBed","correct":"from pybigtools import BigBed"}],"quickstart":{"code":"from pybigtools import open\n\nwith open('example.bw') as bw:\n    print(bw.chroms)\n    vals = bw.fetch('chr1', 1000000, 1000100)\n    print(vals)","lang":"python","description":"Open a BigWig file, list chromosomes, and fetch values over a region."},"warnings":[{"fix":"Replace 'read_bigwig' with 'open' from pybigtools.","message":"In pybigtools v0.1.x, the main function was named 'read_bigwig' instead of 'open'. Code written for v0.1.x must be updated.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Use 'from pybigtools import BigWig, BigBed' and instantiate directly: 'bw = BigWig('file.bw')' to get BigWig-specific methods.","message":"The '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.","severity":"gotcha","affected_versions":"all"},{"fix":"Always use 'with open(...) as f:' or call '.close()' on the object.","message":"File handles must be closed explicitly or used with 'with' statement; resources are not freed on garbage collection alone.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pybigtools import open' and call 'open(filename)'.","cause":"API changed from read_bigwig to open in v0.2.0.","error":"AttributeError: module 'pybigtools' has no attribute 'read_bigwig'"},{"fix":"Use '.tolist()' or specify dtype; ensure the region coordinates are correct.","cause":"Fetch returns values as bytes; expecting int list.","error":"TypeError: 'Bytes' object cannot be interpreted as an integer"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}