kg_microbe package
Subpackages
- kg_microbe.transform_utils package
- kg_microbe.utils package
- Submodules
- kg_microbe.utils.biohub_converter module
- kg_microbe.utils.download_utils module
- kg_microbe.utils.nlp_utils module
- kg_microbe.utils.robot_utils module
- kg_microbe.utils.transform_utils module
ItemInDictNotFoundError
TransformError
collapse_uniprot_curie()
data_to_dict()
get_header_items()
get_item_by_priority()
guess_bl_category()
multi_page_table_to_list()
parse_header()
parse_line()
ungzip_to_tempdir()
uniprot_make_name_to_id_mapping()
uniprot_name_to_id()
unzip_to_tempdir()
write_node_edge_item()
- Module contents
Submodules
kg_microbe.download module
Basic download function.
- kg_microbe.download.download(yaml_file: str, output_dir: str, ignore_cache: bool = False) None
Download data files from list of URLs into data directory.
- Args:
yaml_file: A string pointing to the yaml file utilized to facilitate the downloading of data. output_dir: A string pointing to the location to download data to. ignore_cache: Ignore cache and download files even if they exist [false]
- Returns:
None.
kg_microbe.query module
Functions for querying data.
- kg_microbe.query.parse_query_rq(rq_file) dict
Parse a SPARQL query file in grlc rq format.
- Args:
rq_file: sparql query in grlc rq format
Returns: dict with parsed info about sparql query
- kg_microbe.query.parse_query_yaml(yaml_file) dict
Parse a yaml query.
- kg_microbe.query.result_dict_to_tsv(result_dict: dict, outfile: str) None
Convert a result_dict to a TSV for output.
- kg_microbe.query.run_query(query: str, endpoint: str, return_format='json') dict
Run a query.
kg_microbe.transform module
Top-level functions for transforming data.
- kg_microbe.transform.transform(input_dir: str, output_dir: str, sources: Optional[List[str]] = None) None
Call scripts in kg_microbe/transform/[source name]/ to transform data.
KGX can ingest each directly, in either TSV or JSON format. Args:
input_dir: A string pointing to the directory to import data from. output_dir: A string pointing to the directory to output data to. sources: A list of sources to transform.
- Returns:
None.
Module contents
Initialize the KG-Microbe project.
- kg_microbe.download(yaml_file: str, output_dir: str, ignore_cache: bool = False) None
Download data files from list of URLs into data directory.
- Args:
yaml_file: A string pointing to the yaml file utilized to facilitate the downloading of data. output_dir: A string pointing to the location to download data to. ignore_cache: Ignore cache and download files even if they exist [false]
- Returns:
None.
- kg_microbe.transform(input_dir: str, output_dir: str, sources: Optional[List[str]] = None) None
Call scripts in kg_microbe/transform/[source name]/ to transform data.
KGX can ingest each directly, in either TSV or JSON format. Args:
input_dir: A string pointing to the directory to import data from. output_dir: A string pointing to the directory to output data to. sources: A list of sources to transform.
- Returns:
None.