{"id":13737962,"url":"https://github.com/althonos/pronto","last_synced_at":"2025-05-16T18:11:02.498Z","repository":{"id":37548578,"uuid":"62424052","full_name":"althonos/pronto","owner":"althonos","description":"A Python frontend to (Open Biomedical) Ontologies.","archived":false,"fork":false,"pushed_at":"2025-03-20T04:30:08.000Z","size":10625,"stargazers_count":236,"open_issues_count":34,"forks_count":48,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-14T14:09:27.867Z","etag":null,"topics":["bioinformatics","obo","obo-graphs","obofoundry","ontology","owl","parser","python","semantic-web"],"latest_commit_sha":null,"homepage":"https://pronto.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/althonos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-01T23:02:01.000Z","updated_at":"2025-04-29T10:33:51.000Z","dependencies_parsed_at":"2023-02-16T03:46:11.412Z","dependency_job_id":"2830589b-6e3d-4522-8172-a2ef352fa6d7","html_url":"https://github.com/althonos/pronto","commit_stats":{"total_commits":819,"total_committers":16,"mean_commits":51.1875,"dds":"0.46886446886446886","last_synced_commit":"9e11c06e71c24685404fc1d0d3a560f4e2cdd3de"},"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althonos%2Fpronto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althonos%2Fpronto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althonos%2Fpronto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althonos%2Fpronto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/althonos","download_url":"https://codeload.github.com/althonos/pronto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582907,"owners_count":22095518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioinformatics","obo","obo-graphs","obofoundry","ontology","owl","parser","python","semantic-web"],"created_at":"2024-08-03T03:02:07.276Z","updated_at":"2025-05-16T18:11:02.461Z","avatar_url":"https://github.com/althonos.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# `pronto` [![Stars](https://img.shields.io/github/stars/althonos/pronto.svg?style=social\u0026maxAge=3600\u0026label=Star)](https://github.com/althonos/pronto/stargazers)\n\n*A Python frontend to ontologies.*\n\n[![Actions](https://img.shields.io/github/actions/workflow/status/althonos/pronto/test.yml?branch=master\u0026logo=github\u0026style=flat-square\u0026maxAge=300)](https://github.com/althonos/pronto/actions)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\u0026maxAge=2678400)](https://choosealicense.com/licenses/mit/)\n[![Source](https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=2678400\u0026style=flat-square)](https://github.com/althonos/pronto/)\n[![Docs](https://img.shields.io/readthedocs/pronto?style=flat-square\u0026maxAge=3600)](http://pronto.readthedocs.io/en/stable/?badge=stable)\n[![Coverage](https://img.shields.io/codecov/c/gh/althonos/pronto?style=flat-square\u0026maxAge=3600)](https://codecov.io/gh/althonos/pronto/)\n[![Sanity](https://img.shields.io/codacy/grade/157b5fd24e5648ea80580f28399e79a4.svg?style=flat-square\u0026maxAge=3600)](https://codacy.com/app/althonos/pronto)\n[![PyPI](https://img.shields.io/pypi/v/pronto.svg?style=flat-square\u0026maxAge=3600)](https://pypi.python.org/pypi/pronto)\n[![Bioconda](https://img.shields.io/conda/vn/bioconda/pronto?style=flat-square\u0026maxAge=3600)](https://anaconda.org/bioconda/pronto)\n[![Versions](https://img.shields.io/pypi/pyversions/pronto.svg?style=flat-square\u0026maxAge=3600)](https://pypi.org/project/pronto/#files)\n[![Wheel](https://img.shields.io/pypi/wheel/pronto?style=flat-square\u0026maxAge=3600)](https://pypi.org/project/pronto/#files)\n[![Changelog](https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400\u0026style=flat-square)](https://github.com/althonos/pronto/blob/master/CHANGELOG.md)\n[![GitHub issues](https://img.shields.io/github/issues/althonos/pronto.svg?style=flat-square\u0026maxAge=600)](https://github.com/althonos/pronto/issues)\n[![DOI](https://img.shields.io/badge/doi-10.5281%2Fzenodo.595572-purple?style=flat-square\u0026maxAge=2678400)](https://doi.org/10.5281/zenodo.595572)\n[![Downloads](https://img.shields.io/pypi/dm/pronto?style=flat-square\u0026color=303f9f\u0026maxAge=86400\u0026label=downloads)](https://pepy.tech/project/pronto)\n\n## 🚩 Table of Contents\n\n- [Overview](#%EF%B8%8F-overview)\n- [Supported Languages](#%EF%B8%8F-supported-languages)\n- [Installing](#-installing)\n- [Examples](#-examples)\n- [API Reference](#-api-reference)\n- [License](#-license)\n\n## 🗺️ Overview\n\nPronto is a Python library to parse, browse, create, and export\nontologies, supporting several ontology languages and formats. It\nimplement the specifications of the\n[Open Biomedical Ontologies 1.4](http://owlcollab.github.io/oboformat/doc/obo-syntax.html)\nin the form of an safe high-level interface. *If you're only interested in\nparsing OBO or OBO Graphs document, you may wish to consider\n[`fastobo`](https://pypi.org/project/fastobo) instead.*\n\n\n## 🏳️ Supported Languages\n\n- [Open Biomedical Ontologies 1.4](http://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html).\n  *Because this format is fairly new, not all OBO ontologies can be parsed at the\n  moment. See the [OBO Foundry roadmap](https://github.com/orgs/fastobo/projects/2)\n  listing the compliant ontologies, and don't hesitate to contact their developers\n  to push adoption forward.*\n- [OBO Graphs](https://github.com/geneontology/obographs) in [JSON](http://json.org/)\n  format. *The format is not yet stabilized to the results may change from file\n  to file.*\n- [Ontology Web Language 2](https://www.w3.org/TR/owl2-overview/)\n  in [RDF/XML format](https://www.w3.org/TR/2012/REC-owl2-mapping-to-rdf-20121211/).\n  *OWL2 ontologies are reverse translated to OBO using the mapping defined in the\n  [OBO 1.4 Semantics](http://owlcollab.github.io/oboformat/doc/obo-syntax.html).*\n\n## 🔧 Installing\n\n\nInstalling with `pip` is the easiest:\n```console\n# pip install pronto          # if you have the admin rights\n$ pip install pronto --user   # install it in a user-site directory\n```\n\nThere is also a `conda` recipe in the `bioconda` channel:\n```console\n$ conda install -c bioconda pronto\n```\n\nFinally, a development version can be installed from GitHub\nusing `setuptools`, provided you have the right dependencies\ninstalled already:\n```console\n$ git clone https://github.com/althonos/pronto\n$ cd pronto\n# python setup.py install\n```\n\n## 💡 Examples\n\nIf you're only reading ontologies, you'll only use the `Ontology`\nclass, which is the main entry point.\n\n```python\n\u003e\u003e\u003e from pronto import Ontology\n```\n\nIt can be instantiated from a path to an ontology in one of the supported\nformats, even if the file is compressed:\n```python\n\u003e\u003e\u003e go = Ontology(\"tests/data/go.obo.gz\")\n```\n\nLoading a file from a persistent URL is also supported, although you may also\nwant to use the `Ontology.from_obo_library` method if you're using persistent\nURLs a lot:\n```python\n\u003e\u003e\u003e cl = Ontology(\"http://purl.obolibrary.org/obo/cl.obo\")\n\u003e\u003e\u003e stato = Ontology.from_obo_library(\"stato.owl\")\n```\n\n### 🏷️ Get a term by accession\n\n`Ontology` objects can be used as mappings to access any entity\nthey contain from their identifier in compact form:\n```python\n\u003e\u003e\u003e cl['CL:0002116']\nTerm('CL:0002116', name='B220-low CD38-positive unswitched memory B cell')\n```\n\nNote that when loading an OWL ontology, URIs will be compacted to CURIEs\nwhenever possible:\n\n```python\n\u003e\u003e\u003e aeo = Ontology.from_obo_library(\"aeo.owl\")\n\u003e\u003e\u003e aeo[\"AEO:0000078\"]\nTerm('AEO:0000078', name='lumen of tube')\n```\n\n### 🖊️ Create a new term from scratch\n\nWe can load an ontology, and edit it locally. Here, we add a new protein class\nto the Protein Ontology.\n```python\n\u003e\u003e\u003e pr = Ontology.from_obo_library(\"pr.obo\")\n\u003e\u003e\u003e brh = ms.create_term(\"PR:XXXXXXXX\")\n\u003e\u003e\u003e brh.name = \"Bacteriorhodopsin\"\n\u003e\u003e\u003e brh.superclasses().add(pr[\"PR:000001094\"])  # is a rhodopsin-like G-protein\n\u003e\u003e\u003e brh.disjoint_from.add(pr[\"PR:000036194\"])   # disjoint from eukaryotic proteins\n```\n\n### ✏️ Convert an OWL ontology to OBO format\n\nThe `Ontology.dump` method can be used to serialize an ontology to any of the\nsupported formats (currently OBO and OBO JSON):\n```python\n\u003e\u003e\u003e edam = Ontology(\"http://edamontology.org/EDAM.owl\")\n\u003e\u003e\u003e with open(\"edam.obo\", \"wb\") as f:\n...     edam.dump(f, format=\"obo\")\n```\n\n### 🌿 Find ontology terms without subclasses\n\nThe `terms` method of `Ontology` instances can be used to\niterate over all the terms in the ontology (including the\nones that are imported). We can then use the `is_leaf`\nmethod of `Term` objects to check is the term is a leaf in the\nclass inclusion graph.\n\n```python\n\u003e\u003e\u003e ms = Ontology(\"ms.obo\")\n\u003e\u003e\u003e for term in ms.terms():\n...     if term.is_leaf():\n...         print(term.id)\nMS:0000000\nMS:1000001\n...\n```\n\n### 🤫 Silence warnings\n\n`pronto` is explicit about the parts of the code that are doing \nnon-standard assumptions, or missing capabilities to handle certain\nconstructs. It does so by raising warnings with the `warnings` module, \nwhich can get quite verbose. \n\nIf you are fine with the inconsistencies, you can manually disable \nwarning reports in your consumer code with the `filterwarnings` function:\n\n```python\nimport warnings\nimport pronto\nwarnings.filterwarnings(\"ignore\", category=pronto.warnings.ProntoWarning)\n```\n\n\u003c!-- ### 🤝 Merging several ontologies --\u003e\n\n## 📖 API Reference\n\nA complete API reference can be found in the\n[online documentation](https://pronto.readthedocs.io/en/latest/api.html), or\ndirectly from the command line using `pydoc`:\n```console\n$ pydoc pronto.Ontology\n```\n\n## 📜 License\n\nThis library is provided under the open-source\n[MIT license](https://choosealicense.com/licenses/mit/).\nPlease cite this library if you are using it in a scientific\ncontext using the following DOI:\n[**10.5281/zenodo.595572**](https://doi.org/10.5281/zenodo.595572)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falthonos%2Fpronto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falthonos%2Fpronto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falthonos%2Fpronto/lists"}