diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:51:50 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 15:51:50 +0000 |
| commit | 7300eee8b33fffcebb6eaa0093226b3ad9b2a88c (patch) | |
| tree | c5758c9e4f962e966d8ec4a0fa426495a00b3ac0 /python-bioregistry.spec | |
| parent | 1b92a1550646884250559707f2353b25a30f27ed (diff) | |
automatic import of python-bioregistry
Diffstat (limited to 'python-bioregistry.spec')
| -rw-r--r-- | python-bioregistry.spec | 1577 |
1 files changed, 1577 insertions, 0 deletions
diff --git a/python-bioregistry.spec b/python-bioregistry.spec new file mode 100644 index 0000000..78eefcf --- /dev/null +++ b/python-bioregistry.spec @@ -0,0 +1,1577 @@ +%global _empty_manifest_terminate_build 0 +Name: python-bioregistry +Version: 0.8.7 +Release: 1 +Summary: Integrated registry of biological databases and nomenclatures +License: MIT +URL: https://github.com/biopragmatics/bioregistry +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/52/05/e708199fc77bf3634c93289269c9f9e29ad30f2393760326b8ca7200aa9d/bioregistry-0.8.7.tar.gz +BuildArch: noarch + +Requires: python3-requests +Requires: python3-tqdm +Requires: python3-pystow +Requires: python3-click +Requires: python3-more-click +Requires: python3-pydantic +Requires: python3-curies +Requires: python3-pyyaml +Requires: python3-beautifulsoup4 +Requires: python3-tabulate +Requires: python3-defusedxml +Requires: python3-class-resolver +Requires: python3-fairsharing-client +Requires: python3-matplotlib +Requires: python3-matplotlib-venn +Requires: python3-seaborn +Requires: python3-pandas +Requires: python3-jinja2 +Requires: python3-sphinx +Requires: python3-sphinx-rtd-theme +Requires: python3-sphinx-click +Requires: python3-sphinx-autodoc-typehints +Requires: python3-sphinx-automodapi +Requires: python3-autodoc-pydantic +Requires: python3-pyyaml +Requires: python3-rdflib +Requires: python3-rdflib-jsonld +Requires: python3-ndex2 +Requires: python3-more-itertools +Requires: python3-click-default-group +Requires: python3-pandas +Requires: python3-tabulate +Requires: python3-pyyaml +Requires: python3-jinja2 +Requires: python3-coverage +Requires: python3-pytest +Requires: python3-more-itertools +Requires: python3-pyyaml +Requires: python3-rdflib +Requires: python3-rdflib-jsonld +Requires: python3-rdflib-endpoint +Requires: python3-flask +Requires: python3-flasgger +Requires: python3-fastapi +Requires: python3-uvicorn +Requires: python3-bootstrap-flask +Requires: python3-markdown + +%description +<p align="center"> + <img src="https://github.com/biopragmatics/bioregistry/raw/main/docs/source/logo.png" height="150"> +</p> + +<h1 align="center"> + Bioregistry +</h1> + +<p align="center"> + <a href="https://github.com/biopragmatics/bioregistry/actions?query=workflow%3ATests"> + <img alt="Tests" src="https://github.com/biopragmatics/bioregistry/workflows/Tests/badge.svg" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI" src="https://img.shields.io/pypi/v/bioregistry" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/bioregistry" /> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/LICENSE"> + <img alt="PyPI - License" src="https://img.shields.io/pypi/l/bioregistry" /> + </a> + <a href='https://bioregistry.readthedocs.io/en/latest/?badge=latest'> + <img src='https://readthedocs.org/projects/bioregistry/badge/?version=latest' alt='Documentation Status' /> + </a> + <a href="https://zenodo.org/badge/latestdoi/319481281"> + <img src="https://zenodo.org/badge/319481281.svg" alt="DOI"> + </a> + <a href="https://github.com/psf/black"> + <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/.github/CODE_OF_CONDUCT.md"> + <img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" /> + </a> +</p> + +<p align="center"> + A community-driven integrative meta-registry of life science databases, ontologies, and other resources. + <br />More information <a href="https://bioregistry.io/summary">here</a>. +</p> + +The Bioregistry can be accessed, searched, and queried through its associated website at +https://bioregistry.io. + +### π₯ Download + +The underlying data of the Bioregistry can be downloaded (or edited) directly +from [here](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/). +Several exports to YAML, TSV, and RDF, including consensus views over the +registry, are built on a nightly basis and can be downloaded via the +[`exports/`](https://github.com/biopragmatics/bioregistry/tree/main/exports) directory. + +The manually curated portions of these data are available under the +[CC0 1.0 Universal License](https://creativecommons.org/publicdomain/zero/1.0/). +Aggregated data are redistributed under their original licenses. + +## π Contributing + +Contributions are both welcomed and encouraged. Contribution guidelines for new +prefix requests, record edits, record removals, and code updates are available +in [CONTRIBUTING.md](docs/CONTRIBUTING.md). + +The most simple contribution is to submit an issue: + +- Submit a new prefix using the [issue template](https://github.com/biopragmatics/bioregistry/issues/new?assignees=cthoyt&labels=New%2CPrefix&template=new-prefix.yml&title=Add+prefix+%5BX%5D). A new pull request will be generated automatically for you. +- Update an existing record using one of the [existing issue templates](https://github.com/biopragmatics/bioregistry/issues/new/choose) (e.g., for updating a record's regular expression, merging two prefixes). +- For any updates that don't have a corresponding template, feel free to start with a [blank issue](https://github.com/biopragmatics/bioregistry/issues/new). + +If you want to make a direct contribution, feel free to make edits directly to +the [bioregistry.json](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/bioregistry.json) +file either through the GitHub interface or locally by [forking the repository](https://github.com/biopragmatics/bioregistry/blob/main/docs/CONTRIBUTING.md#code-contribution). + +If you want to make a contribution but don't know where to start, you can check +[this list](https://biopragmatics.github.io/bioregistry/curation/) of curation +To-Do's that's automatically generated daily, including more detailed +information on how to contribute. + +## βοΈ Governance + +The Bioregistry is maintained by a Review Team and Core Development team +whose memberships and duties are described in the +[Project Governance](docs/GOVERNANCE.md). + +## π§Ή Maintenance + +### π« Health Report + +The Bioregistry runs some automated tests weekly to check that various metadata haven't gone stale. For example, +it checks that the homepages are still available and that each provider URL is still able to resolve. + +It has a dedicated [dashboard](https://biopragmatics.github.io/bioregistry/health) that is not part of the main +Bioregistry site. + +### β»οΈ Update + +The database is automatically updated daily thanks to scheduled workflows in GitHub Actions. The workflow's +configuration can be found [here](https://github.com/biopragmatics/bioregistry/blob/main/.github/workflows/update.yml) +and the last run can be seen [here](https://github.com/biopragmatics/bioregistry/actions?query=workflow%3A%22Update+Data%22). +Further, a [changelog](https://github.com/biopragmatics/bioregistry/commits?author=actions-user) can be recapitulated from the +commits of the GitHub Actions bot. + +If you want to manually update the database, run the following: + +```shell +$ tox -e update +``` + +Make sure that you have valid environment variables or `pystow` configurations +for `BIOPORTAL_API_KEY`, `ECOPORTAL_API_KEY`, `AGROPORTAL_API_KEY`, +`FAIRSHARING_LOGIN`, and `FAIRSHARING_PASSWORD`. + +## π Installation + +The Bioregistry can be installed from [PyPI](https://pypi.org/project/bioregistry/) with: + +```shell +$ pip install bioregistry +``` + +It can be installed in development mode for local curation with: + +```shell +$ git clone https://github.com/biopragmatics/bioregistry.git +$ cd bioregistry +$ pip install --editable . +``` + +Build the docs locally with `tox -e ldocs` then view by opening +`docs/build/html/index.html`. + +## πͺ Usage + +### Normalizing Prefixes + +The Bioregistry can be used to normalize prefixes across MIRIAM and all the (very plentiful) variants that pop up in +ontologies in OBO Foundry and the OLS with the `normalize_prefix()` function. + +```python +from bioregistry import normalize_prefix + +# Doesn't affect canonical prefixes +assert 'ncbitaxon' == normalize_prefix('ncbitaxon') + +# This works for uppercased prefixes, like: +assert 'chebi' == normalize_prefix("CHEBI") + +# This works for mixed case prefixes like +assert 'fbbt' == normalize_prefix("FBbt") + +# This works for synonym prefixes, like: +assert 'ncbitaxon' == normalize_prefix('taxonomy') + +# This works for common mistaken prefixes, like: +assert 'pubchem.compound' == normalize_prefix('pubchem') + +# This works for prefixes that are often written many ways, like: +assert 'eccode' == normalize_prefix('ec-code') +assert 'eccode' == normalize_prefix('EC_CODE') + +# If a prefix is not registered, it gives back `None` +assert normalize_prefix('not a real key') is None +``` + +### Parsing CURIEs + +The Bioregistry supports parsing a CURIE into a pair of normalized prefix +and identifier using the `parse_curie()` function: + +```python +from bioregistry import parse_curie + +# Obvious for canonical CURIEs +assert ('chebi', '1234') == parse_curie('chebi:1234') + +# Normalize mixed case prefixes +assert ('fbbt', '00007294') == parse_curie('FBbt:00007294') + +# Normalize common mistaken prefixes +assert ('pubchem.compound', '1234') == parse_curie('pubchem:1234') + +# Remove the redundant prefix and normalize +assert ('go', '1234') == parse_curie('GO:GO:1234') +``` + +This will also apply the same normalization rules for prefixes from the previous +section on normalizing prefixes for the remaining examples. + +### Normalizing CURIEs + +The Bioregistry supports converting a CURIE to a canonical CURIE by normalizing +the prefix and removing redundant namespaces embedded in LUIs with the +`normalize_curie()` function. + +```python +from bioregistry import normalize_curie + +# Idempotent to canonical CURIEs +assert 'chebi:1234' == normalize_curie('chebi:1234') + +# Normalize common mistaken prefixes +assert 'pubchem.compound:1234' == normalize_curie('pubchem:1234') + +# Normalize mixed case prefixes +assert 'fbbt:1234' == normalize_curie('FBbt:1234') + +# Remove the redundant prefix and normalize +assert 'go:1234' == normalize_curie('GO:GO:1234') +``` + +### Parsing IRIs + +The Bioregistry can be used to parse CURIEs from IRIs due to its vast registry of provider URL +strings and additional programmatic logic implemented with Python. It can parse OBO Library PURLs, +IRIs from the OLS and identifiers.org, IRIs from the Bioregistry website, and any other IRIs +from well-formed providers registered in the Bioregistry. The `parse_iri()` function +gets a pre-parsed CURIE, while the `curie_from_iri()` function makes a canonical CURIE +from the pre-parsed CURIE. + +```python +from bioregistry import curie_from_iri, parse_iri + +# First-party IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') + +# OBO Library PURL +assert ('chebi', '24867') == parse_iri('http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('http://purl.obolibrary.org/obo/CHEBI_24867') + +# OLS IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') + +# Identifiers.org IRIs (with varying usage of HTTP(s) and colon/slash separator +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI/24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI/24867') + +# Bioregistry IRI +assert ('chebi', '24867') == parse_iri('https://bioregistry.io/chebi:24867') +``` + +In general, the Bioregistry knows how to parse both the http and https variants +of any given URI: + +```python +from bioregistry import parse_iri + +assert ('neuronames', '268') == parse_iri("http://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +assert ('neuronames', '268') == parse_iri("https://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +``` + +### Generating IRIs + +You can generate an IRI from either a CURIE or a pre-parsed CURIE +(i.e., a 2-tuple of a prefix and identifier) with the `get_iri()` function. +By default, it uses the following priorities: + +1. Custom prefix map (`custom`) +2. First-party IRI (`default`) +3. Identifiers.org / MIRIAM (`miriam`) +4. Ontology Lookup Service (`ols`) +5. OBO PURL (`obofoundry`) +6. Name-to-Thing (`n2t`) +7. BioPortal (`bioportal`) + +```python +from bioregistry import get_iri + +assert get_iri("chebi", "24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +assert get_iri("chebi:24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +``` + +It's possible to change the default priority list by passing an alternate +sequence of metaprefixes to the `priority` keyword (see above). For example, if +you're working with OBO ontologies, you might want to make OBO PURLs the highest +priority and when OBO PURLs can't be generated, default to something else: + +```python +from bioregistry import get_iri + +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +assert get_iri("chebi:24867", priority=priority) == 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("hgnc:1234", priority=priority) == 'https://bioregistry.io/hgnc:1234' +``` + +Even deeper, you can add (or override) any of the Bioregistry's default prefix +map with the `prefix_map` keyword: + +```python +from bioregistry import get_iri + +prefix_map = { + "myprefix": "https://example.org/myprefix/", + "chebi": "https://example.org/chebi/", +} +assert get_iri("chebi:24867", prefix_map=prefix_map) == 'https://example.org/chebi/24867' +assert get_iri("myprefix:1234", prefix_map=prefix_map) == 'https://example.org/myprefix/1234' +``` + +A custom prefix map can be supplied in combination with a priority list, using +the `"custom"` key for changing the priority of the custom prefix map. + +```python +from bioregistry import get_iri + +prefix_map = {"lipidmaps": "https://example.org/lipidmaps/"} +priority = ["obofoundry", "custom", "default", "bioregistry"] +assert get_iri("chebi:24867", prefix_map=prefix_map, priority=priority) == \ + 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("lipidmaps:1234", prefix_map=prefix_map, priority=priority) == \ + 'https://example.org/lipidmaps/1234' +``` + +Alternatively, there are direct functions for generating IRIs for different +registries: + +```python +import bioregistry as br + +# Bioregistry IRI +assert br.get_bioregistry_iri('chebi', '24867') == 'https://bioregistry.io/chebi:24867' + +# Default Provider +assert br.get_default_iri('chebi', '24867') == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' + +# OBO Library +assert br.get_obofoundry_iri('chebi', '24867') == 'http://purl.obolibrary.org/obo/CHEBI_24867' + +# OLS IRI +assert br.get_ols_iri('chebi', '24867') == + 'https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Bioportal IRI +assert br.get_bioportal_iri('chebi', '24867') == \ + 'https://bioportal.bioontology.org/ontologies/CHEBI/?p=classes&conceptid=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Identifiers.org IRI +assert br.get_identifiers_org_iri('chebi', '24867') == 'https://identifiers.org/CHEBI:24867' + +# Name-to-Thing IRI +assert br.get_n2t_iri('chebi', '24867') == 'https://n2t.net/chebi:24867' +``` + +Each of these functions could also return `None` if there isn't a provider available or if the prefix +can't be mapped to the various resources. + +### Prefix Map + +The Bioregistry can be used to generate prefix maps with various flavors +depending on your context. Prioritization works the same way as when generating +IRIs. + +```python +from bioregistry import get_prefix_map + +# Standard +prefix_map = get_prefix_map() + +# Prioritize OBO prefixes over bioregistry +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +prefix_map = get_prefix_map(uri_prefix_priority=priority) + +# Provide custom remapping that doesn't have prioritization logic +remapping = {"chebi": "CHEBI"} +prefix_map = get_prefix_map(remapping=remapping) +``` + +### Getting Metadata + +The pattern for an entry in the Bioregistry can be looked up quickly with `get_pattern()` if +it exists. It prefers the custom curated, then MIRIAM, then Wikidata pattern. + +```python +import bioregistry + +assert '^GO:\\d{7}$' == bioregistry.get_pattern('go') +``` + +Entries in the Bioregistry can be checked for deprecation with the `is_deprecated()` function. MIRIAM and OBO Foundry +don't often agree - OBO Foundry takes precedence since it seems to be updated more often. + +```python +import bioregistry + +assert bioregistry.is_deprecated('nmr') +assert not bioregistry.is_deprecated('efo') +``` + +Entries in the Bioregistry can be looked up with the `get_resource()` function. + +```python +import bioregistry + +entry = bioregistry.get_resource('taxonomy') +# there are lots of mysteries to discover in this dictionary! +``` + +The full Bioregistry can be read in a Python project using: + +```python +import bioregistry + +registry = bioregistry.read_registry() +``` + +### πΈοΈ Resolver App + +After installation with the `[web]` extras, the Bioregistry web application +can be run with the following code: + +```shell +$ python -m pip install bioregistry[web] +$ bioregistry web +``` + +to run a web app that functions like Identifiers.org, but backed by the Bioregistry. +A public instance of this app is hosted by the [INDRA Lab](https://indralab.github.io) at +https://bioregistry.io. + +## π Attribution + +### βοΈ License + +The code in this repository is licensed under the +[MIT License](https://github.com/biopragmatics/bioregistry/blob/main/LICENSE). + +### π Badge + +If you use the Bioregistry in your code, support us by including our +badge in your project's README.md: + +```markdown +[](https://github.com/biopragmatics/bioregistry) +``` + +If your README uses reStructuredText (.rst), use this instead: + +``` +.. image:: https://img.shields.io/static/v1?label=Powered%20by&message=Bioregistry&color=BA274A&style=flat&logo=image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAEnAAABJwGNvPDMAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACi9JREFUWIWtmXl41MUZxz/z291sstmQO9mQG0ISwHBtOOSwgpUQhApWgUfEowKigKI81actypaqFbWPVkGFFKU0Vgs+YgvhEAoqEUESrnDlEEhCbkLYJtlkk9399Y/N/rKbzQXt96+Zed+Z9/t7Z+adeecnuA1s5yFVSGrLOAf2qTiEEYlUZKIAfYdKE7KoBLkQSc4XgkPfXxz/owmT41ZtiVtR3j94eqxQq5aDeASIvkVb12RBtt0mb5xZsvfa/5XgnqTMcI3Eq7IQjwM+7jJJo8YvNhK/qDBUOl8A7JZWWqqu01Jeg6Pd1nW4NuBjjax6eWrRruv/M8EDqTMflmXeB0Jcbb6RIRhmTCJ0ymgC0wYjadTd9nW0tWMu+In63NNU7c3FWtvgJpXrZVlakVGU8/ltEcwzGjU3miI/ABa72vwTB5K45AEi7x2PUEl9fZsHZLuDmgPHuLJpJ82lle6iTSH6mpXp+fnt/Sa4yzhbp22yfwFkgnMaBy17kPhFmQh1997qLxztNkq35XB505fINtf0iz1WvfTQ7Pxdlj4Jdnjuny5yvpEhjHh7FQOGD/YyZi4owS86HJ+QQMDpJaBf3jUXlHD21+8q0y4LDppV/vfNO7+jzV3Pa6SOac0E8I8fSPonpm7JAVR+eRhzwU/Ofj+e49tpT/HdtGXcyLvQJ8HAtCTGfmJCF2dwfpTMz4NszX/uqqdyr+xPyVwoEK+C03PGrDX4GkJ7NBJ+txH/hCgAit7cRlNxOY62dmzmZgwzJvZJUh2gI/xnRmoOHsfe3AqQ/kho0qXs+pLzLh3FgwdT54YKxLsAQq0mbf1zHuTsltZejemHJSrlgGGDPGTXc09zdM5qTi59jZbKOg+Zb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4CsAS1k1J54wYS4o6arWaaS8hvLP998yuZtnisl7wuROLkdjsKzqqtfL45FjB8gzwZnIJy6dS8Jjs3p8ausvHG3tXN26mytZO5W8Rcjsbg1Qze/X45ELHY9I7wHLXG26+CgSl8zFkDGh3zdkF2S7nep9PzhzmnK3FEGwUWOwrJr6zTdeL529EnRhf3LmfCHEBkBZiNrwIAwZkwi9a5Qzh9D6dNvXYW3jZkEJ9UdOOYPwdY/gXgdiufuGuC2C4Hy3kWXrOhmeBLQeA6jV6GLC8Y0KR613Hn+2phZaK69jqah1P/hdsCKLLIfGtnbG+f3eyfHtEHTh38mzom2SY4WQWQjE9tnBE+XIZKuQNrqCcH9wSwRdMGGSJiTnpatwTJOFMIKcgvPVX/kNIcM1gSgC8iTZfii3aEL+7fyG+C+6O8izl1GE5gAAAABJRU5ErkJggg== + :target: https://github.com/biopragmatics/bioregistry + :alt: Powered by the Bioregistry +``` + +It looks like this: [](https://github.com/biopragmatics/bioregistry) + +### π Citation + +> [Unifying the identification of biomedical entities with the Bioregistry](https://bioregistry.io/doi:10.1038/s41597-022-01807-3) +> <br />Hoyt, C. T., Balk, M., Callahan, T. J., Domingo-Fernandez, D., Haendel, M. A., Hegde, H. B., Himmelstein, D. S., Karis, K., Kunze, J., Lubiana, T., Matentzoglu, N., McMurry, J., Moxon, S., Mungall, C. J., Rutz, A., Unni, D. R., Willighagen, E., Winston, D., and Gyori, B. M. (2022) +> <br />*Nature Scientific Data*, s41597-022-01807-3 + +```bibtex +@article{Hoyt2022Bioregistry, + author = {Hoyt, Charles Tapley and Balk, Meghan and Callahan, Tiffany J and Domingo-Fern{\'{a}}ndez, Daniel and Haendel, Melissa A and Hegde, Harshad B and Himmelstein, Daniel S and Karis, Klas and Kunze, John and Lubiana, Tiago and Matentzoglu, Nicolas and McMurry, Julie and Moxon, Sierra and Mungall, Christopher J and Rutz, Adriano and Unni, Deepak R and Willighagen, Egon and Winston, Donald and Gyori, Benjamin M}, + doi = {10.1038/s41597-022-01807-3}, + issn = {2052-4463}, + journal = {Sci. Data}, + number = {1}, + pages = {714}, + title = {{Unifying the identification of biomedical entities with the Bioregistry}}, + url = {https://doi.org/10.1038/s41597-022-01807-3}, + volume = {9}, + year = {2022} +} +``` + +Talks on the Bioregistry: + +- [Future Curation in the Bioregistry](https://bit.ly/wpci2022-bioregistry-maintenance) (WPCI, December 2022) +- [The Bioregistry - Governance and Review Team](https://bit.ly/wpci2022-bioregistry-governance) (WPCI, December 2022) +- [Development, Maintenance, and Expansion of the Bioregistry](https://bit.ly/sorger-lab-bioregistry-2022) + (Sorger Lab Meeting, October 2022) +- [The Bioregistry, CURIEs, and OBO Community Health](https://bit.ly/icbo2022-cth) (ICBO 2022 (September)) +- [Introduction to the Bioregistry](https://bit.ly/bioregistry-short-talk) (Sorger Lab Meeting, July 2021) + +### π Support + +The Bioregistry was developed by the [INDRA Lab](https://indralab.github.io), a part of the +[Laboratory of Systems Pharmacology](https://hits.harvard.edu/the-program/laboratory-of-systems-pharmacology/about/) +and the [Harvard Program in Therapeutic Science (HiTS)](https://hits.harvard.edu) +at [Harvard Medical School](https://hms.harvard.edu/). + +### π° Funding + +The development of the Bioregistry is funded by the DARPA Young Faculty Award W911NF2010255 (PI: Benjamin M. Gyori). + + +%package -n python3-bioregistry +Summary: Integrated registry of biological databases and nomenclatures +Provides: python-bioregistry +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-bioregistry +<p align="center"> + <img src="https://github.com/biopragmatics/bioregistry/raw/main/docs/source/logo.png" height="150"> +</p> + +<h1 align="center"> + Bioregistry +</h1> + +<p align="center"> + <a href="https://github.com/biopragmatics/bioregistry/actions?query=workflow%3ATests"> + <img alt="Tests" src="https://github.com/biopragmatics/bioregistry/workflows/Tests/badge.svg" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI" src="https://img.shields.io/pypi/v/bioregistry" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/bioregistry" /> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/LICENSE"> + <img alt="PyPI - License" src="https://img.shields.io/pypi/l/bioregistry" /> + </a> + <a href='https://bioregistry.readthedocs.io/en/latest/?badge=latest'> + <img src='https://readthedocs.org/projects/bioregistry/badge/?version=latest' alt='Documentation Status' /> + </a> + <a href="https://zenodo.org/badge/latestdoi/319481281"> + <img src="https://zenodo.org/badge/319481281.svg" alt="DOI"> + </a> + <a href="https://github.com/psf/black"> + <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/.github/CODE_OF_CONDUCT.md"> + <img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" /> + </a> +</p> + +<p align="center"> + A community-driven integrative meta-registry of life science databases, ontologies, and other resources. + <br />More information <a href="https://bioregistry.io/summary">here</a>. +</p> + +The Bioregistry can be accessed, searched, and queried through its associated website at +https://bioregistry.io. + +### π₯ Download + +The underlying data of the Bioregistry can be downloaded (or edited) directly +from [here](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/). +Several exports to YAML, TSV, and RDF, including consensus views over the +registry, are built on a nightly basis and can be downloaded via the +[`exports/`](https://github.com/biopragmatics/bioregistry/tree/main/exports) directory. + +The manually curated portions of these data are available under the +[CC0 1.0 Universal License](https://creativecommons.org/publicdomain/zero/1.0/). +Aggregated data are redistributed under their original licenses. + +## π Contributing + +Contributions are both welcomed and encouraged. Contribution guidelines for new +prefix requests, record edits, record removals, and code updates are available +in [CONTRIBUTING.md](docs/CONTRIBUTING.md). + +The most simple contribution is to submit an issue: + +- Submit a new prefix using the [issue template](https://github.com/biopragmatics/bioregistry/issues/new?assignees=cthoyt&labels=New%2CPrefix&template=new-prefix.yml&title=Add+prefix+%5BX%5D). A new pull request will be generated automatically for you. +- Update an existing record using one of the [existing issue templates](https://github.com/biopragmatics/bioregistry/issues/new/choose) (e.g., for updating a record's regular expression, merging two prefixes). +- For any updates that don't have a corresponding template, feel free to start with a [blank issue](https://github.com/biopragmatics/bioregistry/issues/new). + +If you want to make a direct contribution, feel free to make edits directly to +the [bioregistry.json](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/bioregistry.json) +file either through the GitHub interface or locally by [forking the repository](https://github.com/biopragmatics/bioregistry/blob/main/docs/CONTRIBUTING.md#code-contribution). + +If you want to make a contribution but don't know where to start, you can check +[this list](https://biopragmatics.github.io/bioregistry/curation/) of curation +To-Do's that's automatically generated daily, including more detailed +information on how to contribute. + +## βοΈ Governance + +The Bioregistry is maintained by a Review Team and Core Development team +whose memberships and duties are described in the +[Project Governance](docs/GOVERNANCE.md). + +## π§Ή Maintenance + +### π« Health Report + +The Bioregistry runs some automated tests weekly to check that various metadata haven't gone stale. For example, +it checks that the homepages are still available and that each provider URL is still able to resolve. + +It has a dedicated [dashboard](https://biopragmatics.github.io/bioregistry/health) that is not part of the main +Bioregistry site. + +### β»οΈ Update + +The database is automatically updated daily thanks to scheduled workflows in GitHub Actions. The workflow's +configuration can be found [here](https://github.com/biopragmatics/bioregistry/blob/main/.github/workflows/update.yml) +and the last run can be seen [here](https://github.com/biopragmatics/bioregistry/actions?query=workflow%3A%22Update+Data%22). +Further, a [changelog](https://github.com/biopragmatics/bioregistry/commits?author=actions-user) can be recapitulated from the +commits of the GitHub Actions bot. + +If you want to manually update the database, run the following: + +```shell +$ tox -e update +``` + +Make sure that you have valid environment variables or `pystow` configurations +for `BIOPORTAL_API_KEY`, `ECOPORTAL_API_KEY`, `AGROPORTAL_API_KEY`, +`FAIRSHARING_LOGIN`, and `FAIRSHARING_PASSWORD`. + +## π Installation + +The Bioregistry can be installed from [PyPI](https://pypi.org/project/bioregistry/) with: + +```shell +$ pip install bioregistry +``` + +It can be installed in development mode for local curation with: + +```shell +$ git clone https://github.com/biopragmatics/bioregistry.git +$ cd bioregistry +$ pip install --editable . +``` + +Build the docs locally with `tox -e ldocs` then view by opening +`docs/build/html/index.html`. + +## πͺ Usage + +### Normalizing Prefixes + +The Bioregistry can be used to normalize prefixes across MIRIAM and all the (very plentiful) variants that pop up in +ontologies in OBO Foundry and the OLS with the `normalize_prefix()` function. + +```python +from bioregistry import normalize_prefix + +# Doesn't affect canonical prefixes +assert 'ncbitaxon' == normalize_prefix('ncbitaxon') + +# This works for uppercased prefixes, like: +assert 'chebi' == normalize_prefix("CHEBI") + +# This works for mixed case prefixes like +assert 'fbbt' == normalize_prefix("FBbt") + +# This works for synonym prefixes, like: +assert 'ncbitaxon' == normalize_prefix('taxonomy') + +# This works for common mistaken prefixes, like: +assert 'pubchem.compound' == normalize_prefix('pubchem') + +# This works for prefixes that are often written many ways, like: +assert 'eccode' == normalize_prefix('ec-code') +assert 'eccode' == normalize_prefix('EC_CODE') + +# If a prefix is not registered, it gives back `None` +assert normalize_prefix('not a real key') is None +``` + +### Parsing CURIEs + +The Bioregistry supports parsing a CURIE into a pair of normalized prefix +and identifier using the `parse_curie()` function: + +```python +from bioregistry import parse_curie + +# Obvious for canonical CURIEs +assert ('chebi', '1234') == parse_curie('chebi:1234') + +# Normalize mixed case prefixes +assert ('fbbt', '00007294') == parse_curie('FBbt:00007294') + +# Normalize common mistaken prefixes +assert ('pubchem.compound', '1234') == parse_curie('pubchem:1234') + +# Remove the redundant prefix and normalize +assert ('go', '1234') == parse_curie('GO:GO:1234') +``` + +This will also apply the same normalization rules for prefixes from the previous +section on normalizing prefixes for the remaining examples. + +### Normalizing CURIEs + +The Bioregistry supports converting a CURIE to a canonical CURIE by normalizing +the prefix and removing redundant namespaces embedded in LUIs with the +`normalize_curie()` function. + +```python +from bioregistry import normalize_curie + +# Idempotent to canonical CURIEs +assert 'chebi:1234' == normalize_curie('chebi:1234') + +# Normalize common mistaken prefixes +assert 'pubchem.compound:1234' == normalize_curie('pubchem:1234') + +# Normalize mixed case prefixes +assert 'fbbt:1234' == normalize_curie('FBbt:1234') + +# Remove the redundant prefix and normalize +assert 'go:1234' == normalize_curie('GO:GO:1234') +``` + +### Parsing IRIs + +The Bioregistry can be used to parse CURIEs from IRIs due to its vast registry of provider URL +strings and additional programmatic logic implemented with Python. It can parse OBO Library PURLs, +IRIs from the OLS and identifiers.org, IRIs from the Bioregistry website, and any other IRIs +from well-formed providers registered in the Bioregistry. The `parse_iri()` function +gets a pre-parsed CURIE, while the `curie_from_iri()` function makes a canonical CURIE +from the pre-parsed CURIE. + +```python +from bioregistry import curie_from_iri, parse_iri + +# First-party IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') + +# OBO Library PURL +assert ('chebi', '24867') == parse_iri('http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('http://purl.obolibrary.org/obo/CHEBI_24867') + +# OLS IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') + +# Identifiers.org IRIs (with varying usage of HTTP(s) and colon/slash separator +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI/24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI/24867') + +# Bioregistry IRI +assert ('chebi', '24867') == parse_iri('https://bioregistry.io/chebi:24867') +``` + +In general, the Bioregistry knows how to parse both the http and https variants +of any given URI: + +```python +from bioregistry import parse_iri + +assert ('neuronames', '268') == parse_iri("http://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +assert ('neuronames', '268') == parse_iri("https://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +``` + +### Generating IRIs + +You can generate an IRI from either a CURIE or a pre-parsed CURIE +(i.e., a 2-tuple of a prefix and identifier) with the `get_iri()` function. +By default, it uses the following priorities: + +1. Custom prefix map (`custom`) +2. First-party IRI (`default`) +3. Identifiers.org / MIRIAM (`miriam`) +4. Ontology Lookup Service (`ols`) +5. OBO PURL (`obofoundry`) +6. Name-to-Thing (`n2t`) +7. BioPortal (`bioportal`) + +```python +from bioregistry import get_iri + +assert get_iri("chebi", "24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +assert get_iri("chebi:24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +``` + +It's possible to change the default priority list by passing an alternate +sequence of metaprefixes to the `priority` keyword (see above). For example, if +you're working with OBO ontologies, you might want to make OBO PURLs the highest +priority and when OBO PURLs can't be generated, default to something else: + +```python +from bioregistry import get_iri + +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +assert get_iri("chebi:24867", priority=priority) == 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("hgnc:1234", priority=priority) == 'https://bioregistry.io/hgnc:1234' +``` + +Even deeper, you can add (or override) any of the Bioregistry's default prefix +map with the `prefix_map` keyword: + +```python +from bioregistry import get_iri + +prefix_map = { + "myprefix": "https://example.org/myprefix/", + "chebi": "https://example.org/chebi/", +} +assert get_iri("chebi:24867", prefix_map=prefix_map) == 'https://example.org/chebi/24867' +assert get_iri("myprefix:1234", prefix_map=prefix_map) == 'https://example.org/myprefix/1234' +``` + +A custom prefix map can be supplied in combination with a priority list, using +the `"custom"` key for changing the priority of the custom prefix map. + +```python +from bioregistry import get_iri + +prefix_map = {"lipidmaps": "https://example.org/lipidmaps/"} +priority = ["obofoundry", "custom", "default", "bioregistry"] +assert get_iri("chebi:24867", prefix_map=prefix_map, priority=priority) == \ + 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("lipidmaps:1234", prefix_map=prefix_map, priority=priority) == \ + 'https://example.org/lipidmaps/1234' +``` + +Alternatively, there are direct functions for generating IRIs for different +registries: + +```python +import bioregistry as br + +# Bioregistry IRI +assert br.get_bioregistry_iri('chebi', '24867') == 'https://bioregistry.io/chebi:24867' + +# Default Provider +assert br.get_default_iri('chebi', '24867') == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' + +# OBO Library +assert br.get_obofoundry_iri('chebi', '24867') == 'http://purl.obolibrary.org/obo/CHEBI_24867' + +# OLS IRI +assert br.get_ols_iri('chebi', '24867') == + 'https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Bioportal IRI +assert br.get_bioportal_iri('chebi', '24867') == \ + 'https://bioportal.bioontology.org/ontologies/CHEBI/?p=classes&conceptid=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Identifiers.org IRI +assert br.get_identifiers_org_iri('chebi', '24867') == 'https://identifiers.org/CHEBI:24867' + +# Name-to-Thing IRI +assert br.get_n2t_iri('chebi', '24867') == 'https://n2t.net/chebi:24867' +``` + +Each of these functions could also return `None` if there isn't a provider available or if the prefix +can't be mapped to the various resources. + +### Prefix Map + +The Bioregistry can be used to generate prefix maps with various flavors +depending on your context. Prioritization works the same way as when generating +IRIs. + +```python +from bioregistry import get_prefix_map + +# Standard +prefix_map = get_prefix_map() + +# Prioritize OBO prefixes over bioregistry +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +prefix_map = get_prefix_map(uri_prefix_priority=priority) + +# Provide custom remapping that doesn't have prioritization logic +remapping = {"chebi": "CHEBI"} +prefix_map = get_prefix_map(remapping=remapping) +``` + +### Getting Metadata + +The pattern for an entry in the Bioregistry can be looked up quickly with `get_pattern()` if +it exists. It prefers the custom curated, then MIRIAM, then Wikidata pattern. + +```python +import bioregistry + +assert '^GO:\\d{7}$' == bioregistry.get_pattern('go') +``` + +Entries in the Bioregistry can be checked for deprecation with the `is_deprecated()` function. MIRIAM and OBO Foundry +don't often agree - OBO Foundry takes precedence since it seems to be updated more often. + +```python +import bioregistry + +assert bioregistry.is_deprecated('nmr') +assert not bioregistry.is_deprecated('efo') +``` + +Entries in the Bioregistry can be looked up with the `get_resource()` function. + +```python +import bioregistry + +entry = bioregistry.get_resource('taxonomy') +# there are lots of mysteries to discover in this dictionary! +``` + +The full Bioregistry can be read in a Python project using: + +```python +import bioregistry + +registry = bioregistry.read_registry() +``` + +### πΈοΈ Resolver App + +After installation with the `[web]` extras, the Bioregistry web application +can be run with the following code: + +```shell +$ python -m pip install bioregistry[web] +$ bioregistry web +``` + +to run a web app that functions like Identifiers.org, but backed by the Bioregistry. +A public instance of this app is hosted by the [INDRA Lab](https://indralab.github.io) at +https://bioregistry.io. + +## π Attribution + +### βοΈ License + +The code in this repository is licensed under the +[MIT License](https://github.com/biopragmatics/bioregistry/blob/main/LICENSE). + +### π Badge + +If you use the Bioregistry in your code, support us by including our +badge in your project's README.md: + +```markdown +[](https://github.com/biopragmatics/bioregistry) +``` + +If your README uses reStructuredText (.rst), use this instead: + +``` +.. image:: https://img.shields.io/static/v1?label=Powered%20by&message=Bioregistry&color=BA274A&style=flat&logo=image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAEnAAABJwGNvPDMAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACi9JREFUWIWtmXl41MUZxz/z291sstmQO9mQG0ISwHBtOOSwgpUQhApWgUfEowKigKI81actypaqFbWPVkGFFKU0Vgs+YgvhEAoqEUESrnDlEEhCbkLYJtlkk9399Y/N/rKbzQXt96+Zed+Z9/t7Z+adeecnuA1s5yFVSGrLOAf2qTiEEYlUZKIAfYdKE7KoBLkQSc4XgkPfXxz/owmT41ZtiVtR3j94eqxQq5aDeASIvkVb12RBtt0mb5xZsvfa/5XgnqTMcI3Eq7IQjwM+7jJJo8YvNhK/qDBUOl8A7JZW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ElNIHOtWaztNJ4qZQBqfFKLg3OMz135rNY624ClB0tHJcomTA5ZMGnANbaBmoOHPMy5hvZebNuLCoj71frXIN0i9pDJzj24IsIlUTCo7NI3/KyQg5ArfMleEyKBzmA6r1HO8eV+dSEySEB2G3yRpwZP1c2f+n1GjB07RIlcwNoKi7j3G839EhQF2cg6fmHmbznPRKevJ/GorIedV1wtLVzJesrV9WqQtoIHRfWjreSjwGar1ZRui3Ho7PfwHBGb3jRg6S1roGeoIuNJGBIPKV/zSF31irOrn4HXAu9B1zduhtLecelQxZZ9xTtrgC342Df8IwQyaYqBMKEWo0xaw1BI4d4DNJSWcfF32fRWnuD5NWPEDZ5lIe8NDuHq1v+ha2xGdkho4szYJg1hbj501EH6OgJ5oIS8hf/oWPm5HqNrE51vdt4nC/7k+9bIIT8GYA2Ipixn5jwjQrrZsju0XT5GubTRfiEBqFPisUvOrzPPi0VdeQ9YcJ63bWmxbzphTk7XHKvA/DrlJkfAU+Bcy2N+fA3vZK0WVoxny4idOKIfn+IO7lTz7zRObWCjdMv7VnhruOV9dws9F8u4CsAS1k1J54wYS4o6arWaaS8hvLP998yuZtnisl7wuROLkdjsKzqqtfL45FjB8gzwZnIJy6dS8Jjs3p8ausvHG3tXN26mytZO5W8Rcjsbg1Qze/X45ELHY9I7wHLXG26+CgSl8zFkDGh3zdkF2S7nep9PzhzmnK3FEGwUWOwrJr6zTdeL529EnRhf3LmfCHEBkBZiNrwIAwZkwi9a5Qzh9D6dNvXYW3jZkEJ9UdOOYPwdY/gXgdiufuGuC2C4Hy3kWXrOhmeBLQeA6jV6GLC8Y0KR613Hn+2phZaK69jqah1P/hdsCKLLIfGtnbG+f3eyfHtEHTh38mzom2SY4WQWQjE9tnBE+XIZKuQNrqCcH9wSwRdMGGSJiTnpatwTJOFMIKcgvPVX/kNIcM1gSgC8iTZfii3aEL+7fyG+C+6O8izl1GE5gAAAABJRU5ErkJggg== + :target: https://github.com/biopragmatics/bioregistry + :alt: Powered by the Bioregistry +``` + +It looks like this: [](https://github.com/biopragmatics/bioregistry) + +### π Citation + +> [Unifying the identification of biomedical entities with the Bioregistry](https://bioregistry.io/doi:10.1038/s41597-022-01807-3) +> <br />Hoyt, C. T., Balk, M., Callahan, T. J., Domingo-Fernandez, D., Haendel, M. A., Hegde, H. B., Himmelstein, D. S., Karis, K., Kunze, J., Lubiana, T., Matentzoglu, N., McMurry, J., Moxon, S., Mungall, C. J., Rutz, A., Unni, D. R., Willighagen, E., Winston, D., and Gyori, B. M. (2022) +> <br />*Nature Scientific Data*, s41597-022-01807-3 + +```bibtex +@article{Hoyt2022Bioregistry, + author = {Hoyt, Charles Tapley and Balk, Meghan and Callahan, Tiffany J and Domingo-Fern{\'{a}}ndez, Daniel and Haendel, Melissa A and Hegde, Harshad B and Himmelstein, Daniel S and Karis, Klas and Kunze, John and Lubiana, Tiago and Matentzoglu, Nicolas and McMurry, Julie and Moxon, Sierra and Mungall, Christopher J and Rutz, Adriano and Unni, Deepak R and Willighagen, Egon and Winston, Donald and Gyori, Benjamin M}, + doi = {10.1038/s41597-022-01807-3}, + issn = {2052-4463}, + journal = {Sci. Data}, + number = {1}, + pages = {714}, + title = {{Unifying the identification of biomedical entities with the Bioregistry}}, + url = {https://doi.org/10.1038/s41597-022-01807-3}, + volume = {9}, + year = {2022} +} +``` + +Talks on the Bioregistry: + +- [Future Curation in the Bioregistry](https://bit.ly/wpci2022-bioregistry-maintenance) (WPCI, December 2022) +- [The Bioregistry - Governance and Review Team](https://bit.ly/wpci2022-bioregistry-governance) (WPCI, December 2022) +- [Development, Maintenance, and Expansion of the Bioregistry](https://bit.ly/sorger-lab-bioregistry-2022) + (Sorger Lab Meeting, October 2022) +- [The Bioregistry, CURIEs, and OBO Community Health](https://bit.ly/icbo2022-cth) (ICBO 2022 (September)) +- [Introduction to the Bioregistry](https://bit.ly/bioregistry-short-talk) (Sorger Lab Meeting, July 2021) + +### π Support + +The Bioregistry was developed by the [INDRA Lab](https://indralab.github.io), a part of the +[Laboratory of Systems Pharmacology](https://hits.harvard.edu/the-program/laboratory-of-systems-pharmacology/about/) +and the [Harvard Program in Therapeutic Science (HiTS)](https://hits.harvard.edu) +at [Harvard Medical School](https://hms.harvard.edu/). + +### π° Funding + +The development of the Bioregistry is funded by the DARPA Young Faculty Award W911NF2010255 (PI: Benjamin M. Gyori). + + +%package help +Summary: Development documents and examples for bioregistry +Provides: python3-bioregistry-doc +%description help +<p align="center"> + <img src="https://github.com/biopragmatics/bioregistry/raw/main/docs/source/logo.png" height="150"> +</p> + +<h1 align="center"> + Bioregistry +</h1> + +<p align="center"> + <a href="https://github.com/biopragmatics/bioregistry/actions?query=workflow%3ATests"> + <img alt="Tests" src="https://github.com/biopragmatics/bioregistry/workflows/Tests/badge.svg" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI" src="https://img.shields.io/pypi/v/bioregistry" /> + </a> + <a href="https://pypi.org/project/bioregistry"> + <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/bioregistry" /> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/LICENSE"> + <img alt="PyPI - License" src="https://img.shields.io/pypi/l/bioregistry" /> + </a> + <a href='https://bioregistry.readthedocs.io/en/latest/?badge=latest'> + <img src='https://readthedocs.org/projects/bioregistry/badge/?version=latest' alt='Documentation Status' /> + </a> + <a href="https://zenodo.org/badge/latestdoi/319481281"> + <img src="https://zenodo.org/badge/319481281.svg" alt="DOI"> + </a> + <a href="https://github.com/psf/black"> + <img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"> + </a> + <a href="https://github.com/biopragmatics/bioregistry/blob/main/.github/CODE_OF_CONDUCT.md"> + <img alt="Contributor Covenant" src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" /> + </a> +</p> + +<p align="center"> + A community-driven integrative meta-registry of life science databases, ontologies, and other resources. + <br />More information <a href="https://bioregistry.io/summary">here</a>. +</p> + +The Bioregistry can be accessed, searched, and queried through its associated website at +https://bioregistry.io. + +### π₯ Download + +The underlying data of the Bioregistry can be downloaded (or edited) directly +from [here](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/). +Several exports to YAML, TSV, and RDF, including consensus views over the +registry, are built on a nightly basis and can be downloaded via the +[`exports/`](https://github.com/biopragmatics/bioregistry/tree/main/exports) directory. + +The manually curated portions of these data are available under the +[CC0 1.0 Universal License](https://creativecommons.org/publicdomain/zero/1.0/). +Aggregated data are redistributed under their original licenses. + +## π Contributing + +Contributions are both welcomed and encouraged. Contribution guidelines for new +prefix requests, record edits, record removals, and code updates are available +in [CONTRIBUTING.md](docs/CONTRIBUTING.md). + +The most simple contribution is to submit an issue: + +- Submit a new prefix using the [issue template](https://github.com/biopragmatics/bioregistry/issues/new?assignees=cthoyt&labels=New%2CPrefix&template=new-prefix.yml&title=Add+prefix+%5BX%5D). A new pull request will be generated automatically for you. +- Update an existing record using one of the [existing issue templates](https://github.com/biopragmatics/bioregistry/issues/new/choose) (e.g., for updating a record's regular expression, merging two prefixes). +- For any updates that don't have a corresponding template, feel free to start with a [blank issue](https://github.com/biopragmatics/bioregistry/issues/new). + +If you want to make a direct contribution, feel free to make edits directly to +the [bioregistry.json](https://github.com/biopragmatics/bioregistry/blob/main/src/bioregistry/data/bioregistry.json) +file either through the GitHub interface or locally by [forking the repository](https://github.com/biopragmatics/bioregistry/blob/main/docs/CONTRIBUTING.md#code-contribution). + +If you want to make a contribution but don't know where to start, you can check +[this list](https://biopragmatics.github.io/bioregistry/curation/) of curation +To-Do's that's automatically generated daily, including more detailed +information on how to contribute. + +## βοΈ Governance + +The Bioregistry is maintained by a Review Team and Core Development team +whose memberships and duties are described in the +[Project Governance](docs/GOVERNANCE.md). + +## π§Ή Maintenance + +### π« Health Report + +The Bioregistry runs some automated tests weekly to check that various metadata haven't gone stale. For example, +it checks that the homepages are still available and that each provider URL is still able to resolve. + +It has a dedicated [dashboard](https://biopragmatics.github.io/bioregistry/health) that is not part of the main +Bioregistry site. + +### β»οΈ Update + +The database is automatically updated daily thanks to scheduled workflows in GitHub Actions. The workflow's +configuration can be found [here](https://github.com/biopragmatics/bioregistry/blob/main/.github/workflows/update.yml) +and the last run can be seen [here](https://github.com/biopragmatics/bioregistry/actions?query=workflow%3A%22Update+Data%22). +Further, a [changelog](https://github.com/biopragmatics/bioregistry/commits?author=actions-user) can be recapitulated from the +commits of the GitHub Actions bot. + +If you want to manually update the database, run the following: + +```shell +$ tox -e update +``` + +Make sure that you have valid environment variables or `pystow` configurations +for `BIOPORTAL_API_KEY`, `ECOPORTAL_API_KEY`, `AGROPORTAL_API_KEY`, +`FAIRSHARING_LOGIN`, and `FAIRSHARING_PASSWORD`. + +## π Installation + +The Bioregistry can be installed from [PyPI](https://pypi.org/project/bioregistry/) with: + +```shell +$ pip install bioregistry +``` + +It can be installed in development mode for local curation with: + +```shell +$ git clone https://github.com/biopragmatics/bioregistry.git +$ cd bioregistry +$ pip install --editable . +``` + +Build the docs locally with `tox -e ldocs` then view by opening +`docs/build/html/index.html`. + +## πͺ Usage + +### Normalizing Prefixes + +The Bioregistry can be used to normalize prefixes across MIRIAM and all the (very plentiful) variants that pop up in +ontologies in OBO Foundry and the OLS with the `normalize_prefix()` function. + +```python +from bioregistry import normalize_prefix + +# Doesn't affect canonical prefixes +assert 'ncbitaxon' == normalize_prefix('ncbitaxon') + +# This works for uppercased prefixes, like: +assert 'chebi' == normalize_prefix("CHEBI") + +# This works for mixed case prefixes like +assert 'fbbt' == normalize_prefix("FBbt") + +# This works for synonym prefixes, like: +assert 'ncbitaxon' == normalize_prefix('taxonomy') + +# This works for common mistaken prefixes, like: +assert 'pubchem.compound' == normalize_prefix('pubchem') + +# This works for prefixes that are often written many ways, like: +assert 'eccode' == normalize_prefix('ec-code') +assert 'eccode' == normalize_prefix('EC_CODE') + +# If a prefix is not registered, it gives back `None` +assert normalize_prefix('not a real key') is None +``` + +### Parsing CURIEs + +The Bioregistry supports parsing a CURIE into a pair of normalized prefix +and identifier using the `parse_curie()` function: + +```python +from bioregistry import parse_curie + +# Obvious for canonical CURIEs +assert ('chebi', '1234') == parse_curie('chebi:1234') + +# Normalize mixed case prefixes +assert ('fbbt', '00007294') == parse_curie('FBbt:00007294') + +# Normalize common mistaken prefixes +assert ('pubchem.compound', '1234') == parse_curie('pubchem:1234') + +# Remove the redundant prefix and normalize +assert ('go', '1234') == parse_curie('GO:GO:1234') +``` + +This will also apply the same normalization rules for prefixes from the previous +section on normalizing prefixes for the remaining examples. + +### Normalizing CURIEs + +The Bioregistry supports converting a CURIE to a canonical CURIE by normalizing +the prefix and removing redundant namespaces embedded in LUIs with the +`normalize_curie()` function. + +```python +from bioregistry import normalize_curie + +# Idempotent to canonical CURIEs +assert 'chebi:1234' == normalize_curie('chebi:1234') + +# Normalize common mistaken prefixes +assert 'pubchem.compound:1234' == normalize_curie('pubchem:1234') + +# Normalize mixed case prefixes +assert 'fbbt:1234' == normalize_curie('FBbt:1234') + +# Remove the redundant prefix and normalize +assert 'go:1234' == normalize_curie('GO:GO:1234') +``` + +### Parsing IRIs + +The Bioregistry can be used to parse CURIEs from IRIs due to its vast registry of provider URL +strings and additional programmatic logic implemented with Python. It can parse OBO Library PURLs, +IRIs from the OLS and identifiers.org, IRIs from the Bioregistry website, and any other IRIs +from well-formed providers registered in the Bioregistry. The `parse_iri()` function +gets a pre-parsed CURIE, while the `curie_from_iri()` function makes a canonical CURIE +from the pre-parsed CURIE. + +```python +from bioregistry import curie_from_iri, parse_iri + +# First-party IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867') + +# OBO Library PURL +assert ('chebi', '24867') == parse_iri('http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('http://purl.obolibrary.org/obo/CHEBI_24867') + +# OLS IRI +assert ('chebi', '24867') == parse_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') +assert 'chebi:24867' == curie_from_iri('https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867') + +# Identifiers.org IRIs (with varying usage of HTTP(s) and colon/slash separator +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI:24867') +assert ('chebi', '24867') == parse_iri('https://identifiers.org/CHEBI/24867') +assert ('chebi', '24867') == parse_iri('http://identifiers.org/CHEBI/24867') + +# Bioregistry IRI +assert ('chebi', '24867') == parse_iri('https://bioregistry.io/chebi:24867') +``` + +In general, the Bioregistry knows how to parse both the http and https variants +of any given URI: + +```python +from bioregistry import parse_iri + +assert ('neuronames', '268') == parse_iri("http://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +assert ('neuronames', '268') == parse_iri("https://braininfo.rprc.washington.edu/centraldirectory.aspx?ID=268") +``` + +### Generating IRIs + +You can generate an IRI from either a CURIE or a pre-parsed CURIE +(i.e., a 2-tuple of a prefix and identifier) with the `get_iri()` function. +By default, it uses the following priorities: + +1. Custom prefix map (`custom`) +2. First-party IRI (`default`) +3. Identifiers.org / MIRIAM (`miriam`) +4. Ontology Lookup Service (`ols`) +5. OBO PURL (`obofoundry`) +6. Name-to-Thing (`n2t`) +7. BioPortal (`bioportal`) + +```python +from bioregistry import get_iri + +assert get_iri("chebi", "24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +assert get_iri("chebi:24867") == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' +``` + +It's possible to change the default priority list by passing an alternate +sequence of metaprefixes to the `priority` keyword (see above). For example, if +you're working with OBO ontologies, you might want to make OBO PURLs the highest +priority and when OBO PURLs can't be generated, default to something else: + +```python +from bioregistry import get_iri + +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +assert get_iri("chebi:24867", priority=priority) == 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("hgnc:1234", priority=priority) == 'https://bioregistry.io/hgnc:1234' +``` + +Even deeper, you can add (or override) any of the Bioregistry's default prefix +map with the `prefix_map` keyword: + +```python +from bioregistry import get_iri + +prefix_map = { + "myprefix": "https://example.org/myprefix/", + "chebi": "https://example.org/chebi/", +} +assert get_iri("chebi:24867", prefix_map=prefix_map) == 'https://example.org/chebi/24867' +assert get_iri("myprefix:1234", prefix_map=prefix_map) == 'https://example.org/myprefix/1234' +``` + +A custom prefix map can be supplied in combination with a priority list, using +the `"custom"` key for changing the priority of the custom prefix map. + +```python +from bioregistry import get_iri + +prefix_map = {"lipidmaps": "https://example.org/lipidmaps/"} +priority = ["obofoundry", "custom", "default", "bioregistry"] +assert get_iri("chebi:24867", prefix_map=prefix_map, priority=priority) == \ + 'http://purl.obolibrary.org/obo/CHEBI_24867' +assert get_iri("lipidmaps:1234", prefix_map=prefix_map, priority=priority) == \ + 'https://example.org/lipidmaps/1234' +``` + +Alternatively, there are direct functions for generating IRIs for different +registries: + +```python +import bioregistry as br + +# Bioregistry IRI +assert br.get_bioregistry_iri('chebi', '24867') == 'https://bioregistry.io/chebi:24867' + +# Default Provider +assert br.get_default_iri('chebi', '24867') == 'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=CHEBI:24867' + +# OBO Library +assert br.get_obofoundry_iri('chebi', '24867') == 'http://purl.obolibrary.org/obo/CHEBI_24867' + +# OLS IRI +assert br.get_ols_iri('chebi', '24867') == + 'https://www.ebi.ac.uk/ols/ontologies/chebi/terms?iri=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Bioportal IRI +assert br.get_bioportal_iri('chebi', '24867') == \ + 'https://bioportal.bioontology.org/ontologies/CHEBI/?p=classes&conceptid=http://purl.obolibrary.org/obo/CHEBI_24867' + +# Identifiers.org IRI +assert br.get_identifiers_org_iri('chebi', '24867') == 'https://identifiers.org/CHEBI:24867' + +# Name-to-Thing IRI +assert br.get_n2t_iri('chebi', '24867') == 'https://n2t.net/chebi:24867' +``` + +Each of these functions could also return `None` if there isn't a provider available or if the prefix +can't be mapped to the various resources. + +### Prefix Map + +The Bioregistry can be used to generate prefix maps with various flavors +depending on your context. Prioritization works the same way as when generating +IRIs. + +```python +from bioregistry import get_prefix_map + +# Standard +prefix_map = get_prefix_map() + +# Prioritize OBO prefixes over bioregistry +priority = ["obofoundry", "default", "miriam", "ols", "n2t", "bioportal"] +prefix_map = get_prefix_map(uri_prefix_priority=priority) + +# Provide custom remapping that doesn't have prioritization logic +remapping = {"chebi": "CHEBI"} +prefix_map = get_prefix_map(remapping=remapping) +``` + +### Getting Metadata + +The pattern for an entry in the Bioregistry can be looked up quickly with `get_pattern()` if +it exists. It prefers the custom curated, then MIRIAM, then Wikidata pattern. + +```python +import bioregistry + +assert '^GO:\\d{7}$' == bioregistry.get_pattern('go') +``` + +Entries in the Bioregistry can be checked for deprecation with the `is_deprecated()` function. MIRIAM and OBO Foundry +don't often agree - OBO Foundry takes precedence since it seems to be updated more often. + +```python +import bioregistry + +assert bioregistry.is_deprecated('nmr') +assert not bioregistry.is_deprecated('efo') +``` + +Entries in the Bioregistry can be looked up with the `get_resource()` function. + +```python +import bioregistry + +entry = bioregistry.get_resource('taxonomy') +# there are lots of mysteries to discover in this dictionary! +``` + +The full Bioregistry can be read in a Python project using: + +```python +import bioregistry + +registry = bioregistry.read_registry() +``` + +### πΈοΈ Resolver App + +After installation with the `[web]` extras, the Bioregistry web application +can be run with the following code: + +```shell +$ python -m pip install bioregistry[web] +$ bioregistry web +``` + +to run a web app that functions like Identifiers.org, but backed by the Bioregistry. +A public instance of this app is hosted by the [INDRA Lab](https://indralab.github.io) at +https://bioregistry.io. + +## π Attribution + +### βοΈ License + +The code in this repository is licensed under the +[MIT License](https://github.com/biopragmatics/bioregistry/blob/main/LICENSE). + +### π Badge + +If you use the Bioregistry in your code, support us by including our +badge in your project's README.md: + +```markdown +[](https://github.com/biopragmatics/bioregistry) +``` + +If your README uses reStructuredText (.rst), use this instead: + +``` +.. image:: https://img.shields.io/static/v1?label=Powered%20by&message=Bioregistry&color=BA274A&style=flat&logo=image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAEnAAABJwGNvPDMAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAACi9JREFUWIWtmXl41MUZxz/z291sstmQO9mQG0ISwHBtOOSwgpUQhApWgUfEowKigKI81actypaqFbWPVkGFFKU0Vgs+YgvhEAoqEUESrnDlEEhCbkLYJtlkk9399Y/N/rKbzQXt96+Zed+Z9/t7Z+adeecnuA1s5yFVSGrLOAf2qTiEEYlUZKIAfYdKE7KoBLkQSc4XgkPfXxz/owmT41ZtiVtR3j94eqxQq5aDeASIvkVb12RBtt0mb5xZsvfa/5XgnqTMcI3Eq7IQjwM+7jJJo8YvNhK/qDBUOl8A7JZWWqqu01Jeg6Pd1nW4NuBjjax6eWrRruv/M8EDqTMflmXeB0Jcbb6RIRhmTCJ0ymgC0wYjadTd9nW0tWMu+In63NNU7c3FWtvgJpXrZVlakVGU8/ltEcwzGjU3miI/ABa72vwTB5K45AEi7x2PUEl9fZsHZLuDmgPHuLJpJ82lle6iTSH6mpXp+fnt/Sa4yzhbp22yfwFkgnMaBy17kPhFmQh1997qLxztNkq35XB505fINtf0iz1WvfTQ7Pxdlj4Jdnjuny5yvpEhjHh7FQOGD/YyZi4owS86HJ+QQMDpJaBf3jUXlHD21+8q0y4LDppV/vfNO7+jzV3Pa6SOac0E8I8fSPonpm7JAVR+eRhzwU/Ofj+e49tpT/HdtGXcyLvQJ8HAtCTGfmJCF2dwfpTMz4NszX/uqqdyr+xPyVwoEK+C03PGrDX4GkJ7NBJ+txH/hCgAit7cRlNxOY62dmzmZgwzJvZJUh2gI/xnRmoOHsfe3AqQ/kho0qXs+pLzLh3FgwdT54YKxLsAQq0mbf1zHuTsltZejemHJSrlgGGDPGTX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WCjdMv7VnhruOV9dws9F8u4CsAS1k1J54wYS4o6arWaaS8hvLP998yuZtnisl7wuROLkdjsKzqqtfL45FjB8gzwZnIJy6dS8Jjs3p8ausvHG3tXN26mytZO5W8Rcjsbg1Qze/X45ELHY9I7wHLXG26+CgSl8zFkDGh3zdkF2S7nep9PzhzmnK3FEGwUWOwrJr6zTdeL529EnRhf3LmfCHEBkBZiNrwIAwZkwi9a5Qzh9D6dNvXYW3jZkEJ9UdOOYPwdY/gXgdiufuGuC2C4Hy3kWXrOhmeBLQeA6jV6GLC8Y0KR613Hn+2phZaK69jqah1P/hdsCKLLIfGtnbG+f3eyfHtEHTh38mzom2SY4WQWQjE9tnBE+XIZKuQNrqCcH9wSwRdMGGSJiTnpatwTJOFMIKcgvPVX/kNIcM1gSgC8iTZfii3aEL+7fyG+C+6O8izl1GE5gAAAABJRU5ErkJggg== + :target: https://github.com/biopragmatics/bioregistry + :alt: Powered by the Bioregistry +``` + +It looks like this: [](https://github.com/biopragmatics/bioregistry) + +### π Citation + +> [Unifying the identification of biomedical entities with the Bioregistry](https://bioregistry.io/doi:10.1038/s41597-022-01807-3) +> <br />Hoyt, C. T., Balk, M., Callahan, T. J., Domingo-Fernandez, D., Haendel, M. A., Hegde, H. B., Himmelstein, D. S., Karis, K., Kunze, J., Lubiana, T., Matentzoglu, N., McMurry, J., Moxon, S., Mungall, C. J., Rutz, A., Unni, D. R., Willighagen, E., Winston, D., and Gyori, B. M. (2022) +> <br />*Nature Scientific Data*, s41597-022-01807-3 + +```bibtex +@article{Hoyt2022Bioregistry, + author = {Hoyt, Charles Tapley and Balk, Meghan and Callahan, Tiffany J and Domingo-Fern{\'{a}}ndez, Daniel and Haendel, Melissa A and Hegde, Harshad B and Himmelstein, Daniel S and Karis, Klas and Kunze, John and Lubiana, Tiago and Matentzoglu, Nicolas and McMurry, Julie and Moxon, Sierra and Mungall, Christopher J and Rutz, Adriano and Unni, Deepak R and Willighagen, Egon and Winston, Donald and Gyori, Benjamin M}, + doi = {10.1038/s41597-022-01807-3}, + issn = {2052-4463}, + journal = {Sci. Data}, + number = {1}, + pages = {714}, + title = {{Unifying the identification of biomedical entities with the Bioregistry}}, + url = {https://doi.org/10.1038/s41597-022-01807-3}, + volume = {9}, + year = {2022} +} +``` + +Talks on the Bioregistry: + +- [Future Curation in the Bioregistry](https://bit.ly/wpci2022-bioregistry-maintenance) (WPCI, December 2022) +- [The Bioregistry - Governance and Review Team](https://bit.ly/wpci2022-bioregistry-governance) (WPCI, December 2022) +- [Development, Maintenance, and Expansion of the Bioregistry](https://bit.ly/sorger-lab-bioregistry-2022) + (Sorger Lab Meeting, October 2022) +- [The Bioregistry, CURIEs, and OBO Community Health](https://bit.ly/icbo2022-cth) (ICBO 2022 (September)) +- [Introduction to the Bioregistry](https://bit.ly/bioregistry-short-talk) (Sorger Lab Meeting, July 2021) + +### π Support + +The Bioregistry was developed by the [INDRA Lab](https://indralab.github.io), a part of the +[Laboratory of Systems Pharmacology](https://hits.harvard.edu/the-program/laboratory-of-systems-pharmacology/about/) +and the [Harvard Program in Therapeutic Science (HiTS)](https://hits.harvard.edu) +at [Harvard Medical School](https://hms.harvard.edu/). + +### π° Funding + +The development of the Bioregistry is funded by the DARPA Young Faculty Award W911NF2010255 (PI: Benjamin M. Gyori). + + +%prep +%autosetup -n bioregistry-0.8.7 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-bioregistry -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 0.8.7-1 +- Package Spec generated |
