kg_microbe.transform_utils.ontology package

Submodules

kg_microbe.transform_utils.ontology.ontology_transform module

Transform an ontology in Obograph JSON format.

class kg_microbe.transform_utils.ontology.ontology_transform.OntologyTransform(input_dir: Optional[str] = None, output_dir: Optional[str] = None)

Bases: Transform

Parse a raw form of an Ontology into nodes and edges.

parse(name: str, data_file: str, source: str) None

Process the data_file.

If the file is is compressed, decompress it. If the file isn’t in obojson format, convert it first. Args:

name: Name of the ontology data_file: data file to parse source: Source name

Returns:

None.

run(data_file: Optional[str] = None) None

Perform transformations to process an ontology.

Args:

data_file: data file to parse

Returns:

None.

Module contents

Initialize Ontology transform.

class kg_microbe.transform_utils.ontology.OntologyTransform(input_dir: Optional[str] = None, output_dir: Optional[str] = None)

Bases: Transform

Parse a raw form of an Ontology into nodes and edges.

parse(name: str, data_file: str, source: str) None

Process the data_file.

If the file is is compressed, decompress it. If the file isn’t in obojson format, convert it first. Args:

name: Name of the ontology data_file: data file to parse source: Source name

Returns:

None.

run(data_file: Optional[str] = None) None

Perform transformations to process an ontology.

Args:

data_file: data file to parse

Returns:

None.