{ "info": { "author": "Daniel Himmelstein", "author_email": "daniel.himmelstein@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Information Analysis" ], "description": "# obonet: load OBO-formatted ontologies into networkx\n\n[![Build Status](https://travis-ci.org/dhimmel/obonet.svg?branch=master)](https://travis-ci.org/dhimmel/obonet)\n\nRead OBO-formatted ontologies in Python.\n`obonet` is\n\n+ user friendly\n+ no nonsense\n+ pythonic\n+ modern\n+ simple and tested\n+ lightweight\n+ [`networkx`](https://networkx.readthedocs.io/en/stable/overview.html) leveraging\n\nThis Python 3.4+ package loads OBO serialized ontologies into networks.\nThe function `obonet.read_obo()` takes an `.obo` file and returns a [`networkx.MultiDiGraph`](https://networkx.github.io/documentation/stable/reference/classes/multigraph.html) representation of the ontology.\nThe parser was designed for the OBO specification version [1.2](https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_2.html) & [1.4](https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html).\n\n## Usage\n\nThis package is designed and tested on python \u2265 3.4.\nOBO files can be read from a path, URL, or open file handle.\nCompression is inferred from the path's extension.\nSee example usage below:\n\n```python\nimport networkx\nimport obonet\n\n# Read the taxrank ontology\nurl = 'https://github.com/dhimmel/obonet/raw/master/tests/data/taxrank.obo'\ngraph = obonet.read_obo(url)\n\n# Or read the xz-compressed taxrank ontology\nurl = 'https://github.com/dhimmel/obonet/raw/master/tests/data/taxrank.obo.xz'\ngraph = obonet.read_obo(url)\n\n# Number of nodes\nlen(graph)\n\n# Number of edges\ngraph.number_of_edges()\n\n# Check if the ontology is a DAG\nnetworkx.is_directed_acyclic_graph(graph)\n\n# Mapping from term ID to name\nid_to_name = {id_: data.get('name') for id_, data in graph.nodes(data=True)}\nid_to_name['TAXRANK:0000006'] # TAXRANK:0000006 is species\n\n# Find all superterms of species. Note that networkx.descendants gets\n# superterms, while networkx.ancestors returns subterms.\nnetworkx.descendants(graph, 'TAXRANK:0000006')\n```\n\nFor a more detailed tutorial, see the [**Gene Ontology example notebook**](https://github.com/dhimmel/obonet/blob/master/examples/go-obonet.ipynb).\n\n## Installation\n\n[![PyPI](https://img.shields.io/pypi/v/obonet.svg)](https://pypi.org/project/hetio/)\n\nThe recommended approach is to install the latest release from [PyPI](https://pypi.org/project/hetio/) using:\n\n```sh\npip install obonet\n```\n\nHowever, if you'd like to install the most recent version from GitHub, use:\n\n```sh\npip install git+https://github.com/dhimmel/obonet.git#egg=obonet\n```\n\n## Contributing\n\n[![GitHub issues](https://img.shields.io/github/issues/dhimmel/obonet.svg)](https://github.com/dhimmel/obonet/issues)\n\nWe welcome feature suggestions and community contributions.\nCurrently, only reading OBO files is supported.\nPlease open an issue if you're interested in writing OBO files in Python.\n\n## Release instructions\n\nThis section is only relevant for project maintainers.\nTravis CI deployments are used to upload releases to [PyPI](https://pypi.org/project/hetio).\nTo create a new release, do the following:\n\n1. Bump the `__version__` in [`obonet/__init__.py`](https://github.com/dhimmel/obonet/blob/master/obonet/__init__.py).\n\n3. Run the following commands:\n \n ```sh\n TAG=v`python setup.py --version`\n git add obonet/__init__.py\n git commit --message=\"Upgrade to $TAG\"\n git push\n git tag --annotate $TAG --message=\"Upgrade to $TAG\"\n git push --tags\n ```", "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/dhimmel/obonet", "keywords": "obo ontology networkx parser network", "license": "CC0 1.0", "maintainer": "", "maintainer_email": "", "name": "obonet", "package_url": "https://pypi.org/project/obonet/", "platform": "", "project_url": "https://pypi.org/project/obonet/", "project_urls": { "Homepage": "https://github.com/dhimmel/obonet" }, "release_url": "https://pypi.org/project/obonet/0.2.5/", "requires_dist": null, "requires_python": "", "summary": "Parse OBO formatted ontologies into networkx", "version": "0.2.5" }, "last_serial": 4847944, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "86e6891f2084c1aab15225a9106a5b85", "sha256": "145b740a90a76bf317efe4edbd4134430b0fad6b2a6d6d92d8861f82a311806b" }, "downloads": -1, "filename": "obonet-0.2.0-py3.6.egg", "has_sig": false, "md5_digest": "86e6891f2084c1aab15225a9106a5b85", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 9461, "upload_time": "2017-03-26T19:08:51", "url": "https://files.pythonhosted.org/packages/7c/ac/79a0ff3d586b06f33b1068064ff89a2ecb3c1c9795f6b9df161ed77dd23e/obonet-0.2.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "727dd030f6dfebec52f6d198f33f5b83", "sha256": "10f14dc123476e57b0ba37be8362f350ff6d631e76d6a7c4c8669e9a9a749298" }, "downloads": -1, "filename": "obonet-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "727dd030f6dfebec52f6d198f33f5b83", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7721, "upload_time": "2017-03-26T19:08:49", "url": "https://files.pythonhosted.org/packages/d4/6c/08fd1d74ca46aa78b70dec2a083e4165d5046f219f1a018f7a94319a8b0f/obonet-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "216040bc64fe09d0fe7c53dd679606ac", "sha256": "8cbe2b1fa43b757def7ef0b864a9dcaf73fe73349076efefde541528378e2f97" }, "downloads": -1, "filename": "obonet-0.2.0.tar.gz", "has_sig": false, "md5_digest": "216040bc64fe09d0fe7c53dd679606ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5121, "upload_time": "2017-03-26T19:08:53", "url": "https://files.pythonhosted.org/packages/2f/38/f94b60412292b43e4ec3a9866eb721d9032c25984d5d02c6caaed5ce2f93/obonet-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "569ec1cee9d059bd85dd8995df246224", "sha256": "5f77ff6e1e66a6ed1f4782a014d21536230d5ab5fb54370594407a4ab2e4df4b" }, "downloads": -1, "filename": "obonet-0.2.1-py3.6.egg", "has_sig": false, "md5_digest": "569ec1cee9d059bd85dd8995df246224", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 9674, "upload_time": "2017-03-26T21:06:19", "url": "https://files.pythonhosted.org/packages/53/52/58ead98ce5fe48eb8eb5730a4be8323f4a91a2b7af9a2194fc9306dc7352/obonet-0.2.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "13dae743a8460d8cf3cff5586280b796", "sha256": "aeca8a617d0a3eb96ad8ed338669d8408a87de5fe9fe449487e308778ede022c" }, "downloads": -1, "filename": "obonet-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "13dae743a8460d8cf3cff5586280b796", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8138, "upload_time": "2017-03-26T21:06:17", "url": "https://files.pythonhosted.org/packages/03/cc/720970a1beb1db1b59417ea76fe6469ab2c197f300bee3cec2a12e0b5df5/obonet-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "aee088b15144ab49662c4c5b829f6f17", "sha256": "e566b6694c6ad008738eba54745c4145e639c1bcaa9ddfc2600de648496a7c69" }, "downloads": -1, "filename": "obonet-0.2.1.tar.gz", "has_sig": false, "md5_digest": "aee088b15144ab49662c4c5b829f6f17", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5406, "upload_time": "2017-03-26T21:06:21", "url": "https://files.pythonhosted.org/packages/97/f6/91bb5fd8eab322a73c1a1efd6bf1d3a33b70f5499a466d483604133f1844/obonet-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "7c3e51894610c382dc33e8b8b5bc61aa", "sha256": "64995a37b4c6bd8dd343f87b93f2cbe307a993b7dbef7fd3c00dc8cc5eaa5bf3" }, "downloads": -1, "filename": "obonet-0.2.2.tar.gz", "has_sig": false, "md5_digest": "7c3e51894610c382dc33e8b8b5bc61aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5868, "upload_time": "2017-10-30T14:24:11", "url": "https://files.pythonhosted.org/packages/2b/29/dd70839bf7b5480f268d803477e12d46288e42e6498fe0d5f49fca9e3efc/obonet-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "b6917cabe543e37488600cace6b52a2a", "sha256": "a938908e83f5b3fbb56f93c44f93b09c731490e37708d9d5249a035103befcd7" }, "downloads": -1, "filename": "obonet-0.2.3.tar.gz", "has_sig": false, "md5_digest": "b6917cabe543e37488600cace6b52a2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5543, "upload_time": "2018-04-24T17:56:09", "url": "https://files.pythonhosted.org/packages/d4/25/eaa7a7c6d7e65c435c04f8e209f56126a51f9a89a5e8daa984dc562e194a/obonet-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "70fbfed950276cad45fa475d8fd45604", "sha256": "b3632c59c1c9ae40dfe821bc1546552377508e2c2b2ba04990454b582e69fe31" }, "downloads": -1, "filename": "obonet-0.2.4.tar.gz", "has_sig": false, "md5_digest": "70fbfed950276cad45fa475d8fd45604", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5530, "upload_time": "2019-02-20T23:04:11", "url": "https://files.pythonhosted.org/packages/21/cd/c520a3c398deb1659475228d7a313bc90994e4de6a4d9e4b95a131e0456d/obonet-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "4ff298b054ddc90d13f914ef57c4218b", "sha256": "e795f52eeb7f49d61931144de3a714e06d64aba437fa9ead5db3c785c97da361" }, "downloads": -1, "filename": "obonet-0.2.5.tar.gz", "has_sig": false, "md5_digest": "4ff298b054ddc90d13f914ef57c4218b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5542, "upload_time": "2019-02-21T00:26:48", "url": "https://files.pythonhosted.org/packages/b1/21/0f7f98e0953fcc7472c023a0a7cfea35760b7105c44549660346c23907c2/obonet-0.2.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ff298b054ddc90d13f914ef57c4218b", "sha256": "e795f52eeb7f49d61931144de3a714e06d64aba437fa9ead5db3c785c97da361" }, "downloads": -1, "filename": "obonet-0.2.5.tar.gz", "has_sig": false, "md5_digest": "4ff298b054ddc90d13f914ef57c4218b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5542, "upload_time": "2019-02-21T00:26:48", "url": "https://files.pythonhosted.org/packages/b1/21/0f7f98e0953fcc7472c023a0a7cfea35760b7105c44549660346c23907c2/obonet-0.2.5.tar.gz" } ] }