Demonstrates mapping between GO GAF Codes (IEA, ISS, etc) and ECO classes.

See http://purl.obolibrary.org/obo/eco/gaf-eco-mapping.txt


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]:
'ECO:0000501'

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]:
'ECO:0000256'

In [12]:
ontol.label(cls)


Out[12]:
'match to sequence model evidence used in automatic assertion'

In [13]:
["{} '{}'".format(c, ontol.label(c)) for c in ontol.ancestors(cls)]


Out[13]:
["ECO:0000202 'match to sequence model evidence'",
 "ECO:0000501 'evidence used in automatic assertion'",
 "ECO:0000044 'sequence similarity evidence'",
 "ECO:0000000 'evidence'",
 "ECO:0000249 'sequence similarity evidence used in automatic assertion'",
 "ECO:0000203 'automatic assertion'",
 "ECO:0000041 'similarity evidence'",
 "ECO:0000217 'assertion method'",
 "ECO:0000251 'similarity evidence used in automatic assertion'"]

In [14]:
m.ecoclass_to_coderef('ECO:0000501')


Out[14]:
('IEA', None)

In [15]:
m.ecoclass_to_coderef('ECO:0000256')


Out[15]:
('IEA', 'GO_REF:0000002')

In [ ]: