Xref

Xref

class fastobo.xref.Xref

A cross-reference to another entity or an external resource.

Xrefs can be used in a DefClause to indicate the provenance of the definition, or in a Synonym to add evidence from literature supporting the origin of the synonym.

Example

>>> xref = fastobo.xref.Xref(
...     fastobo.id.PrefixedIdent('ISBN', '978-0-321-84268-8'),
... )
__new__(**kwargs)

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

__repr__()

Return repr(self).

__str__()

Return str(self).

desc

the description of the reference, if any.

Type

str or None

id

the identifier of the reference.

Type

Ident

XrefList

class fastobo.xref.XrefList

A list of cross-references.

Example

>>> xrefs = ms[0][1].xrefs
>>> print(xrefs)
[PSI:MS]
>>> xrefs[0]
Xref(PrefixedIdent('PSI', 'MS'))
__contains__(key, /)

Return key in self.

__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).

__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.