{ "info": { "author": "Nezar Abdennur", "author_email": "nabdennur@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics" ], "description": "# pybbi #\n\nPython interface to Jim Kent's big binary file (bbi) \\[[1](#ref1)\\] library from the [UCSC Genome Browser source tree](https://github.com/ucscGenomeBrowser/kent) using Cython.\n\nThis provides read-level access to local and remote bigWig and bigBed files but no write capabilitites. The main feature is fast retrieval of range queries into numpy arrays.\n\n## API ##\n\n### Introspection\n\nThese accept a local file path or URL.\n\n- `bbi.is_bbi(path)` --> `bool`\n- `bbi.is_bigwig(path)` --> `bool`\n- `bbi.is_bigbed(path)` --> `bool`\n- `bbi.chromsizes(path)` --> `OrderedDict`\n- `bbi.zooms(path)` --> `list`\n- `bbi.info(path)` --> `dict`\n\n### Array output\n\nThese accept either a bigWig or bigBed file path / URL. The signal of a bigBed file is the genomic coverage of its intervals.\n\nFor a single range query:\n- `bbi.fetch(path, chrom, start, end, [bins [, missing [, oob, [, summary]]]])` --> 1D numpy array\n\nFor a list of equal-length segments (i.e. to produce a stacked heatmap):\n- `bbi.stackup(path, chroms, starts, ends, [bins [, missing [, oob, [, summary]]]])` --> 2D numpy array\n\n**Summary** querying is supported by specifying the number of `bins` for coarsegraining. The summary statistic can be one of: 'mean', 'min', 'max', 'cov', or 'std'. (default = 'mean').\n\n**Missing** data can be filled with a custom fill value, `missing` (default = 0). \n\n**Out-of-bounds** ranges (i.e. `start` less than zero or `end` greater than the chromosome length) are permitted because of their utility e.g., for generating vertical heatmap stacks centered at specific genomic features. A separate custom fill value, `oob` can be provided for out-of-bounds positions (default = NaN).\n\n### Interval output\n\nAccepts either a bigWig or bigBed file path / URL.\n\n- `bbi.fetch_intervals(path, chrom, start, end)` --> iterator\n\n\nSee the docstrings for complete documentation.\n\n\n## Installation ##\n\nRequires\n- Linux/MacOS\n- C compiler, zlib, pthreads, libpng, openssl, make\n- Python 2.7/3.3+\n- `numpy` and `cython`\n\nOn fresh Ubuntu instance, you'll need `build-essential`, `make`, `libssl-dev`, `libpng16-dev`. It seems to work on the Windows Subsystem for Linux too.\n\n`pybbi` is now on PyPI as a source distribution. It ships with (slightly modified) kent utils source, which it will compile before building the extension module.\n\n```\n$ pip install pybbi\n```\n\nFor development, clone the repo and install in editable mode:\n\n```\n$ git clone https://github.com/nvictus/pybbi.git\n$ cd pybbi\n$ pip install -e .\n```\n\n## Related projects ##\n\n- [libBigWig](https://github.com/dpryan79/libBigWig): Alternative C library for bigWig and bigBed files by Devon Ryan\n- [pyBigWig](https://github.com/dpryan79/pyBigWig): Python bindings for `libBigWig` by the same author\n- [bw-python](https://github.com/brentp/bw-python): Alternative Python wrapper to `libBigWig` by Brent Pederson\n- [bx-python](https://github.com/bxlab/bx-python): Python bioinformatics library from James Taylor's group that includes tools for bbi files.\n\nThis library provides bindings to the reference UCSC bbi library code. Check out [@dpryan79](https://github.com/dpryan79)'s [libBigWig](https://github.com/dpryan79/libBigWig) for an alternative and dedicated C library for big binary files. pyBigWig also provides numpy-based retrieval and bigBed support.\n\n## References ##\n\n[1]: http://bioinformatics.oxfordjournals.org/content/26/17/2204.full\n\n## Troubleshooting ##\n\nOn OSX, you may get errors about missing header files (e.g., `png.h`, `openssl/sha.h`), which even if installed may not be located in standard include locations. Either [create the required symlinks](https://www.anintegratedworld.com/mac-osx-fatal-error-opensslsha-h-file-not-found/) or update the `C_INCLUDE_PATH` environment variable accordingly before installing pybbi.\n\n```bash\nexport C_INCLUDE_PATH=\"/usr/local/include/libpng:/usr/local/opt/openssl/include:$C_INCLUDE_PATH\"\n```\n\n## Notes\n\nUnfortunately, Kent's C source is not well-behaved library code, as it is littered with error calls that call `exit()`. `pybbi` will catch and pre-empt common input errors, but if somehow an internal error does get raised, it will terminate your interpreter instance.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nvictus/pybbi", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pybbi", "package_url": "https://pypi.org/project/pybbi/", "platform": "", "project_url": "https://pypi.org/project/pybbi/", "project_urls": { "Homepage": "https://github.com/nvictus/pybbi" }, "release_url": "https://pypi.org/project/pybbi/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Python bindings to UCSC Big Binary (bigWig/bigBed) file library", "version": "0.2.0" }, "last_serial": 4341169, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "846b979fbb9dde6f0d2f20545aad7f67", "sha256": "841cf9545649a0b6b52c5854a20d71f686981d10b8a2e2e28f569d354369bae9" }, "downloads": -1, "filename": "pybbi-0.1.2.tar.gz", "has_sig": false, "md5_digest": "846b979fbb9dde6f0d2f20545aad7f67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21414889, "upload_time": "2018-09-20T14:21:45", "url": "https://files.pythonhosted.org/packages/33/c7/ec1fcf62bb3b8bd6f2a2e37d8cd163b67234ecbb951f2fbaafc3117bd38a/pybbi-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "029e407cb1d18c020808124b7c48a09d", "sha256": "82ee86f9f930b64f954330d97324da83f7de32254615f133bb2dec56e34067de" }, "downloads": -1, "filename": "pybbi-0.1.3.tar.gz", "has_sig": false, "md5_digest": "029e407cb1d18c020808124b7c48a09d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21416925, "upload_time": "2018-09-20T17:01:10", "url": "https://files.pythonhosted.org/packages/4b/0d/0f5aa4b47fe1296e6d736eb0839b489878ecdcc7c000aa1e3e3d5ee95d9c/pybbi-0.1.3.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "6a8487b6fa31f8ade45e02d180afc1a1", "sha256": "db94e10b3aed3b6d93257965b8061cf05b6cd99387a63dd6cb2245988b2f9e3e" }, "downloads": -1, "filename": "pybbi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6a8487b6fa31f8ade45e02d180afc1a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21417564, "upload_time": "2018-10-04T17:23:01", "url": "https://files.pythonhosted.org/packages/ef/39/d1dab1bd79e118237a8de87c12b7a8c99964c005de5ca31ee4f60683099e/pybbi-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a8487b6fa31f8ade45e02d180afc1a1", "sha256": "db94e10b3aed3b6d93257965b8061cf05b6cd99387a63dd6cb2245988b2f9e3e" }, "downloads": -1, "filename": "pybbi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "6a8487b6fa31f8ade45e02d180afc1a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21417564, "upload_time": "2018-10-04T17:23:01", "url": "https://files.pythonhosted.org/packages/ef/39/d1dab1bd79e118237a8de87c12b7a8c99964c005de5ca31ee4f60683099e/pybbi-0.2.0.tar.gz" } ] }