TCT.translator_metakg

TCT.translator_metakg.add_new_API_for_query(APInames: dict[str, str], metaKG: DataFrame, newAPIname: str, newAPIurl: str, newAPIpredicate: str, newAPIsubject: str, newAPIobject: str)[source]

This function is used to add a new API beyond the current list of APIs for query

Parameters:
APInamesdict

This is the second output of TCT.translator_kpinfo.get_translator_kpinfo().

metaKGpandas.DataFrame

This is the output of get_kp_metadata.

newAPInamestr
newAPIurlstr
newAPIpredicatestr
newAPIsubjectstr
newAPIobjectstr
Returns:

Examples

>>> APInames, metaKG = add_new_API_for_query(APInames, metaKG, "BigGIM_BMG", "http://127.0.0.1:8000/find_path_by_predicate", "Gene-physically_interacts_with-gene", "Gene", "Gene")
TCT.translator_metakg.add_plover_API(APInames: dict[str, str], metaKG: DataFrame)[source]

This function is used to add the Plover APIs developed by the CATRAX team to the APInames and metaKG.

Current APIs include : CATRAX BigGIM DrugResponse Performance Phase, CATRAX Pharmacogenomics, Clinical Trials, Drug Approvals, Multiomics, Microbiome, and RTX KG2.

Parameters:
APInamesdict

This is the second output of TCT.translator_kpinfo.get_translator_kpinfo(). This is a dict of API name to API URL.

metaKGpandas.DataFrame

This is the output of get_kp_metadata.

Examples

>>> APInames, metaKG = add_plover_API(APInames, metaKG)
TCT.translator_metakg.get_KP_metadata(APInames: dict[str, str]) DataFrame[source]

This function is used to get the metadata of the KPs in the APInames dictionary.

Parameters:
APInamesdict

This is the second output of TCT.translator_kpinfo.get_translator_kpinfo(). This is a dict of API name to API URL.

Returns:
metaKGpandas.DataFrame

This is a dataframe that represents the meta KG for the KPs in the APInames input - columns include [TODO].

Examples

>>> metaKG = TCT.get_KP_metadata(APInames) 
>>> All_predicates = list(set(metaKG['Predicate']))
All_categories = list((set(list(set(metaKG['Subject']))+list(set(metaKG['Object'])))))