Ontologies Parsers

efoParser.py

parser(ontology_files)[source]

icdParser.py

parser(ICDfile)[source]

Parses and extracts relevant data from ICD-10 files (Classification of Diseases).

Parameters

ICDfile – list of files downloaded from the ontology database and used to generate nodes and relationships to the graph database.

Returns

Three nested dictionaries: terms, relationships between terms, and definitions of the terms.

  • terms: Dictionary where each key is an ontology identifier (str) and the values are lists of names and synonyms (list[str]).

  • relationships: Dictionary of tuples (str). Each tuple contains two ontology identifiers (source and target) and the relationship type between them.

  • definitions: Dictionary with ontology identifiers as keys (str), and definition of the terms as values (str).

oboParser.py

parser(ontology, files)[source]

Multiple ontology database parser. This function parses and extracts relevant data from: Disease Ontology, Tissues, Human Phenotype Ontology, HUPO-PSI and Gene Ontology databases.

Parameters
  • ontology (str) – name of the ontology to be imported (‘Disease’, ‘Tissue’, ‘Phenotype’, ‘Experiment’, ‘Modification’, ‘Molecular_interactions’, ‘Gene_ontology’)

  • files (list) – list of files downloaded from an ontology and used to generate nodes and relationships in the graph database.

Returns

Three nested dictionaries: terms, relationships between terms, and definitions of the terms.

  • terms: Dictionary where each key is an ontology identifier (str) and the values are lists of names and synonyms (list[str]).

  • relationships: Dictionary of tuples (str). Each tuple contains two ontology identifiers (source and target) and the relationship type between them.

  • definitions: Dictionary with ontology identifiers as keys (str), and definition of the terms as values (str).

reflectParser.py

parser(files, filters, qtype=None)[source]

Parses and extracts relevant data from REFLECT ontologies: Disease Ontology, Tissues, STITCH and Gene Ontology databases.

Parameters
  • files (list) – list of files downloaded from an ontology and used to generate nodes and relationships in the graph database.

  • filters (list) – list of ontology identifiers to be ignored.

  • qtype (int) – ontology type code.

Returns

Three nested dictionaries: terms, relationships between terms, and definitions of the terms.

  • terms: Dictionary where each key is an ontology dentifier (str) and the values are lists of names and synonyms (list[str]).

  • relationships: Dictionary of tuples (str). Each tuple contains two ontology identifiers (source and target) and the relationship type between them.

  • definitions: Dictionary with ontology dentifiers as keys (str), and definition of the terms as values (str).

snomedParser.py

parser(files, filters)[source]

Parses and extracts relevant data from SNOMED CT database files.

Parameters
  • files (list) – list of files downloaded from SNOMED CT and used to generate nodes and relationships in the graph database.

  • filters (list) – list of SNOMED CT Identifiers to be ignored.

Returns

Three nested dictionaries: terms, relationships between terms, and definitions of the terms.

  • terms: Dictionary where each key is a SNOMED CT Identifier (str) and the values are lists of names and synonyms (list[str]).

  • relationships: Dictionary of tuples (str). Each tuple contains two SNOMED CT Identifiers (source and target) and the relationship type between them.

  • definitions: Dictionary with SNOMED CT Identifiers as keys (str), and definition of the terms as values (str).

get_inactive_terms(concept_file)[source]
Parameters

concept_file

Return set inactive_terms

inactive terms