Term

Frame

AbstractEntityFrame

class fastobo.term.TermFrame(AbstractEntityFrame)
__add__(value, /)

Return self+value.

__delitem__(key, /)

Delete self[key].

__getitem__(key, /)

Return self[key].

__len__()

Return len(self).

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__setitem__(key, value, /)

Set self[key] to value.

__str__()

Return str(self).

append(object)

Append object to the end of the list.

Raises

TypeError – when the object is not of the right type for this container (see type-level documentation for the required type).

clear()

Remove all items from list.

copy()

Return a shallow copy of the list.

count(value)

Return number of occurrences of value.

Raises

TypeError – when the object is not of the right type for this container (see type-level documentation for the required type).

insert(index, object)

Insert object before index.

If index is greater than the number of elements in the list, object will be added at the end of the list.

pop(index=- 1)

Remove and return item at index (default last).

Raises

IndexError – when list is empty or index is out of range.

reverse()

Reverse IN PLACE.

Clauses

BaseTermClause

class fastobo.term.BaseTermClause(AbstractEntityClause)

A term clause, appearing in an OBO term frame.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

AltIdClause

class fastobo.term.AltIdClause(BaseTermClause)

A clause defines an alternate id for this term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

BuiltinClause

class fastobo.term.BuiltinClause(BaseTermClause)

A clause declaring whether or not this term is built-in to the OBO format.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

CommentClause

class fastobo.term.CommentClause(BaseTermClause)

A clause storing a comment for this term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

comment

a comment relevant to this term.

Type

str

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

ConsiderClause

class fastobo.term.ConsiderClause(BaseTermClause)

A clause giving a potential substitute for an obsolete term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

CreatedByClause

class fastobo.term.CreatedByClause(BaseTermClause)

A term clause stating the name of the creator of this term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

creator

the name of the creator of this term.

Type

str

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

CreationDateClause

class fastobo.term.CreationDateClause(BaseTermClause)

A clause declaring the date (and optionally time) a term was created.

Parameters

date (datetime.date) – The date this term was created. If a datetime.datime object is given, then the serialized value will also include the serialized time.

Warning

The timezone of the datetime will only be extracted down to the minutes, seconds and smaller durations will be ignored. It is advised to use datetime.timezone.utc whenever possible to preserve the date and time properly.

Example

>>> d1 = datetime.date(2021, 1, 23)
>>> print(fastobo.term.CreationDateClause(d1))
creation_date: 2021-01-23
>>> d2 = datetime.datetime(2021, 1, 23, tzinfo=datetime.timezone.utc)
>>> print(fastobo.term.CreationDateClause(d2))
creation_date: 2021-01-23T00:00:00Z
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

date

the date and time this term was created.

Type

datetime.datetime

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

DefClause

class fastobo.term.DefClause(BaseTermClause)

A clause giving a human-readable definition of the term.

Parameters
  • definition (str) – The human-readable textual definition of the current term.

  • xrefs (Iterable[Xref], optional) – An iterable of database cross-references describing the origin of the definition, or None.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

definition

a textual definition for this term.

Type

str

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'
xrefs

a list of xrefs supporting the definition.

Type

XrefList

DisjointFromClause

class fastobo.term.DisjointFromClause(BaseTermClause)

A clause stating this term has no instances in common with another term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

EquivalentToClause

class fastobo.term.EquivalentToClause(BaseTermClause)

A clause indicating the term is exactly equivalent to another term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'
term

the identifier of the equivalent term.

Type

Ident

IntersectionOfClause

class fastobo.term.IntersectionOfClause(BaseTermClause)

A clause stating this term is equivalent to the intersection of other terms.

Parameters
  • typedef (Ident or None) – the identifier of the composing relationship, or None if the term is an intersection of other terms.

  • term (Ident) – the identifier of the composing term.

Example

The following code describes the GO term GO:0000085 (G2 phase of mitotic cell cycle) as being equivalent to any term which is both a subclass of GO:0051319 (G2 phase) and has a part_of relationship to GO:0000278 (mitotic cell cycle):

>>> from fastobo.term import TermFrame, IntersectionOfClause
>>> frame = TermFrame(fastobo.id.PrefixedIdent("GO", "0000085"))
>>> frame.append(IntersectionOfClause(
...    typedef=None,
...    term=fastobo.id.PrefixedIdent("GO", "0051319")),
... )
>>> frame.append(IntersectionOfClause(
...     typedef=fastobo.id.UnprefixedIdent("part_of"),
...     term=fastobo.id.PrefixedIdent("GO", "0000278")
... ))
__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'
term

the identifier of the composing term.

Type

str

typedef

the identifier of the composing relationship, if any.

Type

str

IsAClause

class fastobo.term.IsAClause(BaseTermClause)

A clause declaring this term is a subclass of another term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

IsAnonymousClause

class fastobo.term.IsAnonymousClause(BaseTermClause)

A clause declaring whether or not the current term has an anonymous id.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

IsObsoleteClause

class fastobo.term.IsObsoleteClause(BaseTermClause)

A clause indicating whether or not this term is obsolete.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

NameClause

class fastobo.term.NameClause(BaseTermClause)

A term clause declaring the human-readable name of this term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

name

the name of the current term.

Type

str

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

NamespaceClause

class fastobo.term.NamespaceClause(BaseTermClause)

A term clause declaring the namespace of this term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

PropertyValueClause

class fastobo.term.PropertyValueClause(BaseTermClause)

A clause that binds a property to a value in the term.

Parameters

property_value (AbstractPropertyValue) – the property value to annotate the current term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

property_value

an annotation of the term.

Type

AbstractPropertyValue

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

RelationshipClause

class fastobo.term.RelationshipClause(BaseTermClause)

A clause describing a typed relationship between this term and another term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

ReplacedByClause

class fastobo.term.ReplacedByClause(BaseTermClause)

A clause giving a term which replaces this obsolete term.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

SubsetClause

class fastobo.term.SubsetClause(BaseTermClause)

A clause declaring a subset to which this term belongs.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

SynonymClause

class fastobo.term.SynonymClause(BaseTermClause)

A clause giving a synonym for this term, with some cross-references.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'

UnionOfClause

class fastobo.term.UnionOfClause(BaseTermClause)

A clause indicating the term represents the union of several other terms.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'
term

the identifier of the member term.

Type

Ident

XrefClause

class fastobo.term.XrefClause(BaseTermClause)

A cross-reference that describes an analogous term in another vocabulary.

__eq__(value, /)

Return self==value.

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__()

Return repr(self).

__str__()

Return str(self).

raw_tag()

Get the raw tag of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> clause = fastobo.header.OntologyClause("test")
>>> clause.raw_tag()
'ontology'
>>> str(clause)
'ontology: test'
raw_value()

Get the raw value of the header clause.

Returns

str – the header clause value as it was extracted from the OBO header, stripped from trailing qualifiers and comment.

Example

>>> dt = datetime.datetime(2019, 4, 29, 21, 52)
>>> clause = fastobo.header.DateClause(dt)
>>> clause.date
datetime.datetime(2019, 4, 29, 21, 52)
>>> clause.raw_value()
'29:04:2019 21:52'
xref

a cross-reference relevant to this term.

Type

Xref