Term

class pyobo.Term(reference, definition=None, provenance=<factory>, relationships=<factory>, properties=<factory>, parents=<factory>, synonyms=<factory>, xrefs=<factory>, xref_types=<factory>, alt_ids=<factory>, namespace=None, is_obsolete=None)[source]

Bases: Referenced

A term in OBO.

Attributes Summary

definition

A description of the entity

is_obsolete

An annotation for obsolescence.

namespace

The sub-namespace within the ontology

Methods Summary

append_alt(alt)

Add an alternative identifier.

append_comment(value)

Add a comment relationship.

append_exact_match(reference)

Append an exact match, also adding an xref.

append_parent(reference)

Add a parent to this entity.

append_property(prop, value)

Append a property.

append_provenance(reference)

Add a provenance reference.

append_relationship(typedef, reference)

Append a relationship.

append_see_also(reference)

Add a see also relationship.

append_synonym(synonym[, type])

Add a synonym.

append_xref(reference)

Append an xref.

auto(prefix, identifier)

Create a term from a reference.

extend_parents(references)

Add a collection of parents to this entity.

extend_relationship(typedef, references)

Append several relationships.

from_curie(curie[, name])

Create a term directly from a CURIE and optional name.

from_triple(prefix, identifier[, name, ...])

Create a term from a reference.

get_properties(prop)

Get properties from the given key.

get_property(prop)

Get a single property of the given key.

get_relationship(typedef)

Get a single relationship of the given type.

get_relationships(typedef)

Get relationships from the given type.

get_species([prefix])

Get the species if it exists.

iterate_obo_lines()

Iterate over the lines to write in an OBO file.

iterate_properties()

Iterate over pairs of property and values.

iterate_relations()

Iterate over pairs of typedefs and targets.

set_species(identifier[, name])

Append the from_species relation.

Attributes Documentation

definition: Optional[str] = None

A description of the entity

is_obsolete: Optional[bool] = None

An annotation for obsolescence. By default, is None, but this means that it is not obsolete.

namespace: Optional[str] = None

The sub-namespace within the ontology

Methods Documentation

append_alt(alt)[source]

Add an alternative identifier.

Return type:

None

append_comment(value)[source]

Add a comment relationship.

Return type:

Term

append_exact_match(reference)[source]

Append an exact match, also adding an xref.

append_parent(reference)[source]

Add a parent to this entity.

Return type:

Term

append_property(prop, value)[source]

Append a property.

Return type:

None

append_provenance(reference)[source]

Add a provenance reference.

Return type:

None

append_relationship(typedef, reference)[source]

Append a relationship.

Return type:

None

append_see_also(reference)[source]

Add a see also relationship.

Return type:

Term

append_synonym(synonym, type=None)[source]

Add a synonym.

Return type:

None

append_xref(reference)[source]

Append an xref.

Return type:

None

classmethod auto(prefix, identifier)[source]

Create a term from a reference.

Return type:

Term

extend_parents(references)[source]

Add a collection of parents to this entity.

Return type:

None

extend_relationship(typedef, references)[source]

Append several relationships.

Return type:

None

classmethod from_curie(curie, name=None)[source]

Create a term directly from a CURIE and optional name.

Return type:

Term

classmethod from_triple(prefix, identifier, name=None, definition=None)[source]

Create a term from a reference.

Return type:

Term

get_properties(prop)[source]

Get properties from the given key.

Return type:

List[str]

get_property(prop)[source]

Get a single property of the given key.

Return type:

Optional[str]

get_relationship(typedef)[source]

Get a single relationship of the given type.

Return type:

Optional[Reference]

get_relationships(typedef)[source]

Get relationships from the given type.

Return type:

List[Reference]

get_species(prefix='NCBITaxon')[source]

Get the species if it exists.

Parameters:

prefix (str) – The prefix to use in case the term has several species annotations.

Return type:

Optional[Reference]

iterate_obo_lines()[source]

Iterate over the lines to write in an OBO file.

Return type:

Iterable[str]

iterate_properties()[source]

Iterate over pairs of property and values.

Return type:

Iterable[Tuple[str, str]]

iterate_relations()[source]

Iterate over pairs of typedefs and targets.

Return type:

Iterable[Tuple[TypeDef, Reference]]

set_species(identifier, name=None)[source]

Append the from_species relation.