Header¶
Frame¶
HeaderFrame
¶
- class fastobo.header.HeaderFrame(AbstractFrame)¶
- 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
beforeindex
.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¶
BaseHeaderClause
¶
- class fastobo.header.BaseHeaderClause(AbstractClause)¶
A header clause, appearing in the OBO header frame.
FormatVersionClause
¶
- class fastobo.header.FormatVersionClause(BaseHeaderClause)¶
FormatVersionClause(version) –
A header clause indicating the format version of the OBO document.
- 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'
DataVersionClause
¶
- class fastobo.header.DataVersionClause(BaseHeaderClause)¶
DataVersionClause(version) –
A header clause indicating the version of the data in the OBO document.
- 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'
DateClause
¶
- class fastobo.header.DateClause(BaseHeaderClause)¶
DateClause(date) –
A header clause indicating the date the document was last modified.
- 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'
SavedByClause
¶
- class fastobo.header.SavedByClause(BaseHeaderClause)¶
SavedByClause(name) –
A header clause containing the name of the person who saved the document.
- 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'
AutoGeneratedByClause
¶
- class fastobo.header.AutoGeneratedByClause(BaseHeaderClause)¶
AutoGeneratedByClause(name) –
A header clause indicating the software that generated the document.
- 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'
ImportClause
¶
- class fastobo.header.ImportClause(BaseHeaderClause)¶
ImportClause(reference) –
A clause with a URL or ontology ID referencing another OBO document.
- 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'
SubsetdefClause
¶
- class fastobo.header.SubsetdefClause(BaseHeaderClause)¶
SubsetdefClause(subset, description) –
A header clause declaring a subset in the OBO document.
- 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'
SynonymTypedefClause
¶
- class fastobo.header.SynonymTypedefClause(BaseHeaderClause)¶
SynonymTypedefClause(typedef, description, scope=None) –
A header clause declaring a synonym type in the OBO document.
- 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'
DefaultNamespaceClause
¶
- class fastobo.header.DefaultNamespaceClause(BaseHeaderClause)¶
DefaultNamespaceClause(namespace) –
A clause declaring the default namespace for the rest of the document.
- 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'
IdspaceClause
¶
- class fastobo.header.IdspaceClause(BaseHeaderClause)¶
IdspaceClause(prefix, url, description=None) –
A clause giving the mapping between a “local” and a “global” ID space.
- 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'
TreatXrefsAsEquivalentClause
¶
- class fastobo.header.TreatXrefsAsEquivalentClause(BaseHeaderClause)¶
TreatXrefsAsEquivalentClause(idspace) –
A macro to treats xrefs coming from an ID space as equivalence statements.
- 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'
TreatXrefsAsGenusDifferentiaClause
¶
- class fastobo.header.TreatXrefsAsGenusDifferentiaClause(BaseHeaderClause)¶
TreatXrefsAsGenusDifferentiaClause(idspace, relation, filler) –
A macro to treats xrefs from an ID space as genus-differentia definitions.
- 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'
TreatXrefsAsGenusDifferentiaClause
¶
- class fastobo.header.TreatXrefsAsReverseGenusDifferentiaClause(BaseHeaderClause)¶
TreatXrefsAsReverseGenusDifferentiaClause(idspace, relation, filler) –
A macro to treats xrefs from an ID space as reverse genus-differentia definitions.
- 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'
TreatXrefsAsReverseGenusDifferentiaClause
¶
- class fastobo.header.TreatXrefsAsRelationshipClause(BaseHeaderClause)¶
TreatXrefsAsRelationshipClause(idspace, relation) –
A macro to treats xrefs from an ID space as being relationships.
- 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'
TreatXrefsAsIsAClause
¶
- class fastobo.header.TreatXrefsAsIsAClause(BaseHeaderClause)¶
TreatXrefsAsIsAClause(idspace) –
A macro to treats xrefs from an ID space as being subclassing relations.
- 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'
TreatXrefsAsHasSubclassClause
¶
- class fastobo.header.TreatXrefsAsHasSubclassClause(BaseHeaderClause)¶
TreatXrefsAsHasSubclassClause(idspace) –
A macro to treats xrefs from an ID space as being superclassing relations.
- 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.header.PropertyValueClause(BaseHeaderClause)¶
PropertyValueClause(property_value) –
A clause that binds a property to a value in the OBO document.
- Parameters:
property_value (AbstractPropertyValue) – the property value to annotate the current OBO document with.
- property_value¶
an annotation of the document.
- Type:
- 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'
RemarkClause
¶
- class fastobo.header.RemarkClause(BaseHeaderClause)¶
RemarkClause(remark) –
A header clause storing general comments for the current OBO file.
- 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'
OntologyClause
¶
- class fastobo.header.OntologyClause(BaseHeaderClause)¶
OntologyClause(ontology) –
The ontology ID of the current OBO file.
- 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'
OwlAxiomsClause
¶
- class fastobo.header.OwlAxiomsClause(BaseHeaderClause)¶
OwlAxiomsClause(axioms) –
A header clause containing untranslatable OWL axioms.
- 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'
UnreservedClause
¶
- class fastobo.header.UnreservedClause(BaseHeaderClause)¶
UnreservedClause(tag, value) –
A tag/value pair not reserved in the OBO specification.
- 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'