source: orange-bioinformatics/doc/modules/obiGO-gene-annotations.py @ 788:cb6e303e14e7

Revision 788:cb6e303e14e7, 625 bytes checked in by ales_erjavec <ales.erjavec@…>, 5 years ago (diff)
  • updated obiGO documentation
Line 
1import obiGO
2
3ontology = obiGO.Ontology()
4annotations = obiGO.Annotations("sgd", ontology=ontology)
5
6gene = annotations.aliasMapper["YIL075C"]
7print gene, "(YIL075C) directly annotated to the folowing terms:"
8for a in annotations.geneAnnotations[gene]:
9    print ontology[a.GO_ID].name, "with evidence code", a.Evidence_code
10   
11# Get all genes annotated to the same terms as YIL075C
12ids = set([a.GO_ID for a in annotations.geneAnnotations[gene]])
13for GOID in ids:
14    ants = annotations.GetAllAnnotations(GOID)
15    genes = set([a.geneName for a in ants])
16    print ", ".join(genes), "annotated to", GOID, ontology[a.GO_ID].name
17   
18   
Note: See TracBrowser for help on using the repository browser.