Grounding and name standardization (indra.ontology.standardize
)
- indra.ontology.standardize.get_standard_agent(name, db_refs, ontology=None, ns_order=None, **kwargs)[source]
Get a standard agent based on the name, db_refs, and a any other kwargs.
- namestr
The name of the agent that may not be standardized.
- db_refsdict
A dict of db refs that may not be standardized, i.e., may be missing an available UP ID corresponding to an existing HGNC ID.
- ontologyOptional[indra.ontology.IndraOntology]
An IndraOntology object, if not provided, the default BioOntology is used.
- ns_orderOptional[list]
A list of namespaces which are in order of priority with higher priority namespaces appearing earlier in the list.
- kwargs :
Keyword arguments to pass to
Agent.__init__()
.
- Returns
A standard agent
- Return type
- indra.ontology.standardize.get_standard_name(db_refs, ontology=None, ns_order=None)[source]
Return a standardized name for a given db refs dict.
- Parameters
db_refs (dict) – A dict of db refs that may not be standardized, i.e., may be missing an available UP ID corresponding to an existing HGNC ID.
ontology (Optional[indra.ontology.IndraOntology]) – An IndraOntology object, if not provided, the default BioOntology is used.
ns_order (Optional[list]) – A list of namespaces which are in order of priority with higher priority namespaces appearing earlier in the list.
- Returns
The standard name based on the db refs, None if not available.
- Return type
str or None
- indra.ontology.standardize.standardize_agent_name(agent, standardize_refs=True, ontology=None, ns_order=None)[source]
Standardize the name of an Agent based on grounding information.
The priority of which namespace is used as the bases for the standard name depends on
- Parameters
agent (indra.statements.Agent) – An INDRA Agent whose name attribute should be standardized based on grounding information.
standardize_refs (Optional[bool]) – If True, this function assumes that the Agent’s db_refs need to be standardized, e.g., HGNC mapped to UP. Default: True
ontology (Optional[indra.ontology.IndraOntology]) – An IndraOntology object, if not provided, the default BioOntology is used.
ns_order (Optional[list]) – A list of namespaces which are in order of priority with higher priority namespaces appearing earlier in the list.
- Returns
True if a new name was set, False otherwise.
- Return type
- indra.ontology.standardize.standardize_db_refs(db_refs, ontology=None, ns_order=None)[source]
Return a standardized db refs dict for a given db refs dict.
- Parameters
db_refs (dict) – A dict of db refs that may not be standardized, i.e., may be missing an available UP ID corresponding to an existing HGNC ID.
ontology (Optional[indra.ontology.IndraOntology]) – An IndraOntology object, if not provided, the default BioOntology is used.
ns_order (Optional[list]) – A list of namespaces which are in order of priority with higher priority namespaces appearing earlier in the list.
- Returns
The db_refs dict with standardized entries.
- Return type
- indra.ontology.standardize.standardize_name_db_refs(db_refs, ontology=None, ns_order=None)[source]
Return a standardized name and db refs dict for a given db refs dict.
- Parameters
db_refs (dict) – A dict of db refs that may not be standardized, i.e., may be missing an available UP ID corresponding to an existing HGNC ID.
ontology (Optional[indra.ontology.IndraOntology]) – An IndraOntology object, if not provided, the default BioOntology is used.
ns_order (Optional[list]) – A list of namespaces which are in order of priority with higher priority namespaces appearing earlier in the list.
- Returns
str or None – The standard name based on the db refs, None if not available.
dict – The db_refs dict with standardized entries.