OnToma interface

Main interface class.

class ontoma.interface.OnToma(cache_dir=None, efo_release='latest')

Open Targets ontology mapping wrapper. Please refer to documentation for usage details.

filter_identifiers_by_efo_current(normalised_identifiers)

Returns a subset of the idenfitiers which are in EFO and not marked as obsolete.

find_term(query: str, code: bool = False, suggest: bool = False) → list

For a given query (an ontology identifier or a string), find matches in EFO Open Targets slim.

The algorithm operates in a series of steps. If a given step is successful, the result is returned immediately, and the remaining steps are not executed. If all steps fail to provide a match, None is returned. Note that in general more than one mapping can be returned. This can happen for complex traits which require more than one ontology term to represent them.

If the code flag is specified, it is assumed that the query is an ontology identifier, such as ‘OMIM:615632’, and the following steps are attempted: 1. See if the term is already in EFO OT slim OWL file. 2. Match terms by cross-references (hasDbXref) from the OWL file. 3. Mapping from the manual cross-reference database. 4. Request through OxO with a distance of 2.

If the query is a string, the following steps are attempted: 5. Exact name match from EFO OT slim OWL file. 6. Exact synonym (hasExactSynonym) from the OWL file. 7. Mapping from the manual string-to-ontology database. 8. High confidence mapping from ZOOMA with default parameters.

The following functionality is planned, but not yet implemented. — If the query is a string, and additionally the suggest flag is specified, additional steps are attempted: 9. Inexact synonyms (hasRelatedSynonym) from the OWL file. 10. Any confidence mapping from ZOOMA with default parameters.

Args:
query: Either an ontology identifier, or the disease/phenotype string to be matched to an EFO code. code: Whether to treat the query as an ontology identifier. suggest: Whether to report low quality mappings which are not guaranteed to be contained in EFO OT slim.
Returns:
A list of values dependent on the verbose flag (either strings with ontology identifiers, or a dictionary of additional information). The list will be empty if no hits were identified.
get_label_from_efo(normalised_identifier)
step01_owl_identifier_match(normalised_identifier)

If the term is already present in EFO, return it as is.

step02_owl_db_xref(normalised_identifier)

If there are terms in EFO referenced by the hasDbXref field to the query, return them.

step03_manual_xref(normalised_identifier)

Look for the queried term in the manual ontology-to-ontology mapping list.

step04_oxo_query(normalised_identifier)

Find cross-references using OxO.

step05_owl_name_match(normalised_string)

Find EFO terms which match the string query exactly.

step06_owl_exact_synonym(normalised_string)

Find EFO terms which have the query as an exact synonym.

step07_manual_mapping(normalised_string)

Find the query in the manual string-to-ontology mapping database.

step08_zooma_high_confidence(normalised_string)
step10_zooma_any(normalised_string)