pyBigWig is a Python package providing efficient access to bigWig files, leveraging the underlying C library libBigWig. It enables reading genomic data stored in bigWig format and also supports creating and writing new bigWig files. The current version is 0.3.25, with frequent updates addressing bug fixes and build improvements.
pip install pyBigWigVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a simple bigWig file with dummy data, then open it in read mode to extract values, summary statistics, and intervals from specific genomic regions. It also shows the importance of closing the file handles.
Always call `bw.close()` for opened bigWig files. This issue was largely addressed in v0.3.17 but good practice remains.
Ensure the file is opened in read mode (`'r'`, which is the default) for reading, or create a separate `pyBigWig` object for reading if simultaneous read/write-like logic is required.
Update to `pyBigWig` version 0.3.25 or later to ensure correct handling of empty files and files with zero summary values.
Update to `pyBigWig` version 0.3.24 or later, which includes a fix to handle such cases correctly.