get_preferred_prefix

get_preferred_prefix(prefix: str) str | None[source]

Get the preferred prefix (e.g., with stylization) if it exists.

Parameters:

prefix – The prefix to lookup.

Returns:

The preferred prefix, if annotated in the Bioregistry or OBO Foundry.

No preferred prefix annotation, defaults to normalized prefix

>>> get_preferred_prefix("rhea")
None

Preferred prefix defined in the Bioregistry

>>> get_preferred_prefix("wb")
'WormBase'

Preferred prefix defined in the OBO Foundry

>>> get_preferred_prefix("fbbt")
'FBbt'

Preferred prefix from the OBO Foundry overridden by the Bioregistry (see also https://github.com/OBOFoundry/OBOFoundry.github.io/issues/1559)

>>> get_preferred_prefix("dpo")
'DPO'