Ontology Databases

ontologies_controller.py

entries_to_remove(entries, the_dict)[source]

This function removes pairs from a given dictionary, based on a list of provided keys.

Parameters
  • entries (list) – list of keys to be deleted from dictionary.

  • the_dict (dict) – dictionary.

Returns

The original dictionary minus the key,value pairs from the provided entries list.

get_extra_entities_rels(ontology_directory)[source]
parse_ontology(ontology, download=True)[source]

Parses and extracts data from a given ontology file(s), and returns a tuple with multiple dictionaries.

Parameters
  • ontology (str) – acronym of the ontology to be parsed (e.g. Disease Ontology:’DO’).

  • download (bool) – wether database is to be downloaded.

Returns

Tuple with three nested dictionaries: terms, relationships between terms, and definitions of the terms. For more information on the returned dictionaries, see the documentation for any ontology parser.

generate_graphFiles(import_directory, ontologies=None, download=True)[source]

This function parses and extracts data from a given list of ontologies. If no ontologies are provided, all availables ontologies are used. Terms, relationships and definitions are saved as .tsv files to be loaded into the graph database.

Parameters
  • import_directory (str) – relative path from current python module to ‘imports’ directory.

  • ontologies (list or None) – list of ontologies to be imported. If None, all available ontologies are imported.

  • download (bool) – wether database is to be downloaded.

Returns

Dictionary of tuples. Each tuple corresponds to a unique label/relationship type, date, time, database, and number of nodes and relationships.