Demonstrates mapping between GO GAF Codes (IEA, ISS, etc) and ECO classes.
## Create an EcoMap object, for mapping to and from ECO classes
from ontobio.ecomap import EcoMap
m = EcoMap()
## 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')
## Given a code 'IEA' and no further information, map it
m.coderef_to_ecoclass('IEA')
'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
## 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
'ECO:0000256'
ontol.label(cls)
'match to sequence model evidence used in automatic assertion'
["{} '{}'".format(c, ontol.label(c)) for c in ontol.ancestors(cls)]
["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'"]
m.ecoclass_to_coderef('ECO:0000501')
('IEA', None)
m.ecoclass_to_coderef('ECO:0000256')
('IEA', 'GO_REF:0000002')