miriam_standardize_identifier
- miriam_standardize_identifier(prefix: str, identifier: str) str | None [source]
Normalize the identifier with the appropriate banana.
- Parameters:
prefix – The prefix in the CURIE
identifier – The identifier in the CURIE
- Returns:
A normalize identifier, possibly with banana/redundant prefix added. Returns none if the prefix doesn’t map to MIRIAM.
Examples with explicitly annotated bananas:
>>> import bioregistry as br >>> assert "VariO" == br.get_banana('vario') >>> miriam_standardize_identifier('vario', '0376') 'VariO:0376' >>> miriam_standardize_identifier('vario', 'VariO:0376') 'VariO:0376'
Examples with bananas from OBO: >>> import bioregistry as br >>> assert “GO” == br.get_banana(‘go’) >>> miriam_standardize_identifier(‘go’, ‘0000001’) ‘GO:0000001’ >>> miriam_standardize_identifier(‘go’, ‘GO:0000001’) ‘GO:0000001’ >>> assert “VariO” == br.get_banana(‘vario’) >>> miriam_standardize_identifier(‘vario’, ‘0000001’) ‘VariO:0000001’ >>> miriam_standardize_identifier(‘vario’, ‘VariO:0000001’) ‘VariO:0000001’
Examples from OBO Foundry: >>> miriam_standardize_identifier(‘chebi’, ‘1234’) ‘CHEBI:1234’ >>> miriam_standardize_identifier(‘chebi’, ‘CHEBI:1234’) ‘CHEBI:1234’
Examples outside of OBO: >>> miriam_standardize_identifier(‘mgi’, ‘6017782’) ‘MGI:6017782’ >>> miriam_standardize_identifier(‘mgi’, ‘MGI:6017782’) ‘MGI:6017782’
>>> miriam_standardize_identifier('swisslipid', '000000341') 'SLM:000000341' >>> miriam_standardize_identifier('swisslipid', 'SLM:000000341') 'SLM:000000341'
Special cases with underscore-delimited bananas >>> miriam_standardize_identifier(‘cellosaurus’, ‘0001’) ‘CVCL_0001’ >>> miriam_standardize_identifier(‘cellosaurus’, ‘CVCL_0001’) ‘CVCL_0001’ >>> miriam_standardize_identifier(‘ro’, ‘0000001’) ‘RO_0000001’ >>> miriam_standardize_identifier(‘ro’, ‘RO_0000001’) ‘RO_0000001’ >>> miriam_standardize_identifier(‘geogeo’, ‘000000001’) ‘GEO_000000001’ >>> miriam_standardize_identifier(‘geogeo’, ‘GEO_000000001’) ‘GEO_000000001’ >>> miriam_standardize_identifier(‘biomodels.kisao’, ‘0000057’) ‘KISAO_0000057’ >>> miriam_standardize_identifier(‘biomodels.kisao’, ‘KISAO_0000057’) ‘KISAO_0000057’
Standard:
>>> import bioregistry as br >>> assert br.get_banana('pdb') is None >>> assert not br.get_namespace_in_lui('pdb') >>> miriam_standardize_identifier('pdb', '00000020') '00000020'