TCT.node_normalizer

This is a wrapper around the Node Normalizer API.

API docs: https://nodenorm.transltr.io/docs

TCT.node_normalizer.ID_convert_to_preferred_name_nodeNormalizer(id_list)[source]

Convert a list of CURIEs to their preferred names using NodeNorm. Arg:

id_list: list of CURIEs to be converted

Returns:

dic_id_map: dictionary mapping CURIEs to their preferred names

Example:

dic_id_map = ID_convert_to_preferred_name_nodeNormalizer([“NCBIGene:1234”, “NCBIGene:5678”])

TCT.node_normalizer.get_normalized_nodes(query: str | list[str], return_equivalent_identifiers: bool = False, **kwargs)[source]

A wrapper around the get_normalized_nodes api endpoint. Given a CURIE or a list of CURIEs, this returns either a single TranslatorNode or a dict of CURIE ids to TranslatorNodes.

Parameters:
querystr

Query CURIE

return_equivalent_identifiersbool

Whether or not to return a list of equivalent identifiers along with the TranslatorNode. Default: False

**kwargs

Other arguments to get_normalized_nodes (e.g. conflate for gene-protein conflation, drug_chemical_conflate for drug-chemical conflation)

Returns:
If query is a single CURIE, returns a single TranslatorNode.
If query is a list of CURIEs, a dict of CURIE id to TranslatorNode for every node in the query.

Examples

>>> get_normalized_nodes('MESH:D014867', return_equivalent_identifiers=False)
TranslatorNode(curie='CHEBI:15377', label='Water', types=['biolink:SmallMolecule', 'biolink:MolecularEntity', 'biolink:ChemicalEntity', 'biolink:PhysicalEssence', 'biolink:ChemicalOrDrugOrTreatment', 'biolink:ChemicalEntityOrGeneOrGeneProduct', 'biolink:ChemicalEntityOrProteinOrPolypeptide', 'biolink:NamedThing', 'biolink:PhysicalEssenceOrOccurrent'], synonyms=None, curie_synonyms=None)