Reference

A python package for handling and generating OBO.

Functions

build_ontology(prefix, *[, terms, ...])

Build an ontology from parts.

default_reference(prefix, identifier[, name])

Create a CURIE for an "unqualified" reference.

ensure_path(prefix, *parts, url[, version, ...])

Download a file if it doesn't exist.

from_obo_path(path[, prefix, strict, ...])

Get the OBO graph from a path.

from_obonet(graph, *[, strict, version, ...])

Get all the terms from a OBO graph.

get_alts_to_id(prefix, **kwargs)

Get alternative id to primary id mapping.

get_ancestors(prefix[, identifier])

Get all the ancestors (parents) of the term as CURIEs.

get_children(prefix[, identifier])

Get all the descendants (children) of the term as CURIEs.

get_definition(prefix[, identifier])

Get the definition for an entity.

get_descendants(prefix[, identifier])

Get all the descendants (children) of the term as CURIEs.

get_edges(prefix, **kwargs)

Get a list of edge triples.

get_edges_df(prefix, **kwargs)

Get a dataframe of edges triples.

get_filtered_properties_df(prefix, prop, ...)

Extract a single property for each term.

get_filtered_properties_mapping(prefix, ...)

Extract a single property for each term as a dictionary.

get_filtered_properties_multimapping(prefix, ...)

Extract multiple properties for each term as a dictionary.

get_filtered_relations_df(prefix, relation, ...)

Get all the given relation.

get_filtered_xrefs(prefix, xref_prefix, *[, ...])

Get xrefs to a given target.

get_graph(prefix, **kwargs)

Get the relation graph.

get_graph_embeddings_df(prefix, *[, method, ...])

Get graph machine learning embeddings.

get_grounder(prefixes, *[, grounder_cls, ...])

Get a grounder for the given prefix(es).

get_hierarchy(prefix, *[, extra_relations, ...])

Get hierarchy of parents as a directed graph.

get_id_definition_mapping(prefix, **kwargs)

Get a mapping of descriptions.

get_id_multirelations_mapping(prefix, ...)

Get the OBO file and output a synonym dictionary.

get_id_name_mapping(prefix, **kwargs)

Get an identifier to name mapping for the OBO file.

get_id_species_mapping(prefix, **kwargs)

Get an identifier to species mapping.

get_id_synonyms_mapping(prefix, **kwargs)

Get the OBO file and output a synonym dictionary.

get_id_to_alts(prefix, **kwargs)

Get alternate identifiers.

get_ids(prefix, **kwargs)

Get the set of identifiers for this prefix.

get_literal_mappings(prefix, *[, skip_obsolete])

Get literal mappings.

get_literal_mappings_df(prefix, **kwargs)

Get a literal mappings dataframe.

get_literal_mappings_subset(prefix, ancestors, *)

Get a subset of literal mappings under the given ancestors.

get_literal_properties(prefix, **kwargs)

Get a list of literal property triples.

get_literal_properties_df(prefix, **kwargs)

Get a dataframe of literal property quads.

get_mappings_df(prefix, **kwargs)

Get semantic mappings from a source as an SSSOM dataframe.

get_metadata(prefix, **kwargs)

Get metadata for the ontology.

get_name(prefix[, identifier, ...])

Get the name for an entity.

get_name_by_curie(curie, /, *[, ...])

Get the name for a CURIE, if possible.

get_name_id_mapping(prefix, **kwargs)

Get a name to identifier mapping for the OBO file.

get_object_properties(prefix, **kwargs)

Get a list of object property triples.

get_object_properties_df(prefix, **kwargs)

Get a dataframe of object property triples.

get_obsolete(prefix, **kwargs)

Get the set of obsolete local unique identifiers.

get_ontology(prefix, *[, force, ...])

Get the OBO for a given graph.

get_primary_curie(prefix[, identifier])

Get the primary curie for an entity.

get_primary_identifier(prefix[, identifier])

Get the primary identifier for an entity.

get_primary_reference(prefix[, identifier])

Get the primary reference for an entity.

get_properties(prefix, identifier, prop, ...)

Extract a set of properties for the given entity.

get_properties_df(prefix, **kwargs)

Extract properties.

get_property(prefix, identifier, prop, **kwargs)

Extract a single property for the given entity.

get_references(prefix, **kwargs)

Get the set of identifiers for this prefix.

get_relation(prefix, source_identifier, ...)

Get the target identifier corresponding to the given relationship from the source prefix/identifier pair.

get_relation_mapping(prefix, relation, ...)

Get relations from identifiers in the source prefix to target prefix with the given relation.

get_relations_df(prefix, *[, wide])

Get all relations from the OBO.

get_scispacy_entities(prefix, **kwargs)

Iterate over entities in a given ontology via pyobo.

get_scispacy_entity_linker(prefix, *[, ...])

Get an entity linker for usage with scispacy.

get_scispacy_knowledgebase(prefix, **kwargs)

Get a lexical index for usage with scispacy.

get_semantic_mapping_metadata(prefix, *[, ...])

Get metadata for a resource.

get_semantic_mappings(prefix[, names])

Get semantic mappings.

get_species(prefix[, identifier])

Get the species.

get_sssom_df(prefix, **kwargs)

Get an SSSOM dataframe, replaced by get_mappings_df().

get_subhierarchy(prefix[, identifier])

Get the subhierarchy for a given node.

get_synonyms(prefix[, identifier])

Get the synonyms for an entity.

get_text_embedding(reference, *[, model])

Get a text embedding for an entity, or return none if no text is available.

get_text_embedding_similarity(reference_1, ...)

Get the pairwise similarity.

get_text_embeddings_df(prefix, *[, model])

Get embeddings for all entities in the resource.

get_typedef_df(prefix, **kwargs)

Get an identifier to name mapping for the typedefs in an OBO file.

get_version([with_git_hash])

Get the PyOBO version string, including a git hash.

get_xref(prefix, identifier, new_prefix, *)

Get the xref with the new prefix if a direct path exists.

get_xrefs(prefix, xref_prefix, *[, flip])

Get xrefs to a given target.

get_xrefs_df(prefix, **kwargs)

Get all xrefs.

ground()

Normalize a string given the prefix's labels and synonyms.

has_ancestor(reference, ancestor, /[, direction])

Check that the first identifier has the second as an ancestor.

has_nomenclature_plugin(prefix)

Check if there's a plugin for converting the prefix.

is_descendent(reference, ancestor, /, **kwargs)

Check if the refeference is a descendant of the ancestor.

iter_nomenclature_plugins()

Get all modules in the PyOBO sources.

run_nomenclature_plugin(prefix[, version])

Get a converted PyOBO source.

Classes

Annotation(predicate, value)

A tuple representing a predicate-object pair.

Obo([date, data_version, force])

An OBO document.

Reference

alias of NormalizedNamableReference

Synonym(name[, specificity, type, ...])

A synonym with optional specificity and references.

SynonymTypeDef(reference[, specificity])

A type definition for synonyms in OBO.

Term(reference[, definition, relationships, ...])

A term in OBO.

TypeDef(reference[, is_anonymous, ...])

A type definition in OBO.

Class Inheritance Diagram

digraph inheritance451d83a020 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [URL="https://docs.python.org/3/library/abc.html#abc.ABC",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Helper class that provides a standard way to create an ABC using"]; "Annotation" [URL="api/pyobo.Annotation.html#pyobo.Annotation",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A tuple representing a predicate-object pair."]; "BaseModel" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="!!! abstract \"Usage Documentation\""]; "HasReferencesMixin" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A class that can report on the references it contains."]; "ABC" -> "HasReferencesMixin" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NamableReference" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A reference, maybe with a name."]; "Reference" -> "NamableReference" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NormalizedNamableReference" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Extends :class:`curies.NamableReference` to normalize the prefix against the Bioregistry."]; "NormalizedReference" -> "NormalizedNamableReference" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NamableReference" -> "NormalizedNamableReference" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NormalizedReference" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Extends :class:`curies.Reference` to normalize the prefix against the Bioregistry."]; "Reference" -> "NormalizedReference" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Obo" [URL="api/pyobo.Obo.html#pyobo.Obo",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An OBO document."]; "Reference" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A reference to an entity in a given identifier space."]; "BaseModel" -> "Reference" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Referenced" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A class that contains a reference."]; "Stanza" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="A high-level class for stanzas."]; "Referenced" -> "Stanza" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasReferencesMixin" -> "Stanza" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Synonym" [URL="api/pyobo.Synonym.html#pyobo.Synonym",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A synonym with optional specificity and references."]; "HasReferencesMixin" -> "Synonym" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SynonymTypeDef" [URL="api/pyobo.SynonymTypeDef.html#pyobo.SynonymTypeDef",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A type definition for synonyms in OBO."]; "Referenced" -> "SynonymTypeDef" [arrowsize=0.5,style="setlinewidth(0.5)"]; "HasReferencesMixin" -> "SynonymTypeDef" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Term" [URL="api/pyobo.Term.html#pyobo.Term",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A term in OBO."]; "Stanza" -> "Term" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TypeDef" [URL="api/pyobo.TypeDef.html#pyobo.TypeDef",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A type definition in OBO."]; "Stanza" -> "TypeDef" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Constants for PyOBO.

Functions

check_should_cache(data)

Determine whether caching should be done based on generic keyword arguments.

check_should_force(data)

Determine whether caching should be forced based on generic keyword arguments.

check_should_use_tqdm(data)

Determine whether caching should be done based on generic keyword arguments.

get_semantic_mapping_metadata(prefix, *[, ...])

Get metadata for a resource.

Classes

DatabaseKwargs

Keyword arguments for database CLI functions.

GetOntologyKwargs

Represents the optional keyword arguments passed to pyobo.get_ontology().

IterHelperHelperDict

Represents arguments needed when iterating over all ontologies.

OntologyPathPack(format, path, rdf_format)

A format and path tuple.

SlimGetOntologyKwargs

Keyword arguments for database CLI functions.

Class Inheritance Diagram

digraph inheritance08d028eaaa { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "DatabaseKwargs" [URL="api/pyobo.constants.DatabaseKwargs.html#pyobo.constants.DatabaseKwargs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Keyword arguments for database CLI functions."]; "GetOntologyKwargs" [URL="api/pyobo.constants.GetOntologyKwargs.html#pyobo.constants.GetOntologyKwargs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Represents the optional keyword arguments passed to :func:`pyobo.get_ontology`."]; "IterHelperHelperDict" [URL="api/pyobo.constants.IterHelperHelperDict.html#pyobo.constants.IterHelperHelperDict",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Represents arguments needed when iterating over all ontologies."]; "OntologyPathPack" [URL="api/pyobo.constants.OntologyPathPack.html#pyobo.constants.OntologyPathPack",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A format and path tuple."]; "SlimGetOntologyKwargs" [URL="api/pyobo.constants.SlimGetOntologyKwargs.html#pyobo.constants.SlimGetOntologyKwargs",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Keyword arguments for database CLI functions."]; }