normalize_prefix
- normalize_prefix(prefix)[source]
Get the normalized prefix, or return None if not registered.
- Parameters
prefix (
str
) – The prefix to normalize, which could come from Bioregistry, OBO Foundry, OLS, or any of the curated synonyms in the Bioregistry- Return type
- Returns
The canonical Bioregistry prefix, it could be looked up. This will usually take precedence: MIRIAM, OBO Foundry / OLS, Custom except in a few cases, such as NCBITaxon.
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')