get_relation_mapping
- pyobo.get_relation_mapping(prefix, relation, target_prefix, *, use_tqdm=False, force=False)[source]
Get relations from identifiers in the source prefix to target prefix with the given relation. :rtype:
Mapping
[str
,str
]Warning
Assumes there’s only one version of the property for each term.
Example usage: get homology between HGNC and MGI:
>>> import pyobo >>> human_mapt_hgnc_id = '6893' >>> mouse_mapt_mgi_id = '97180' >>> hgnc_mgi_orthology_mapping = pyobo.get_relation_mapping('hgnc', 'ro:HOM0000017', 'mgi') >>> assert mouse_mapt_mgi_id == hgnc_mgi_orthology_mapping[human_mapt_hgnc_id]