Demonstrates mapping between GO GAF Codes (IEA, ISS, etc) and ECO classes.
In [1]:
## Create an EcoMap object, for mapping to and from ECO classes
from ontobio.ecomap import EcoMap
m = EcoMap()
In [2]:
## Create an ontology object for ECO;
## This is optional; we use this in this notebook
## to look up ECO class labels, and parentage
from ontobio.ontol_factory import OntologyFactory
ontol = OntologyFactory().create('eco')
In [3]:
## Given a code 'IEA' and no further information, map it
m.coderef_to_ecoclass('IEA')
Out[3]:
Including a specific reference, such as GO_REF:000002 Gene Ontology annotation through association of InterPro records with GO terms can increase the specificity of the mapping
In [11]:
## Given a combination of a code plus a reference,
## we can map this to a more precise evidence type
cls = m.coderef_to_ecoclass('IEA','GO_REF:0000002')
cls
Out[11]:
In [12]:
ontol.label(cls)
Out[12]:
In [13]:
["{} '{}'".format(c, ontol.label(c)) for c in ontol.ancestors(cls)]
Out[13]:
In [14]:
m.ecoclass_to_coderef('ECO:0000501')
Out[14]:
In [15]:
m.ecoclass_to_coderef('ECO:0000256')
Out[15]:
In [ ]: