source: orange-bioinformatics/docs/reference/obiGO-enrichment.py @ 1634:32373d957326

Revision 1634:32373d957326, 942 bytes checked in by mitar, 2 years ago (diff)

Renamed addon reference documentation.

Line 
1import obiGO
2
3ontology = obiGO.Ontology()
4annotations = obiGO.Annotations("sgd", ontology=ontology)
5
6res = annotations.GetEnrichedTerms(["YGR270W", "YIL075C", "YDL007W"])
7print "Enriched terms:"
8for GOId, (genes, p_value, ref) in res.items():
9    if p_value < 0.05:
10        print ontology[GOId].name, "with p-value: %.4f" %p_value, ", ".join(genes)
11
12# And again for slims       
13ontology.SetSlimsSubset("goslim_yeast")
14
15res = annotations.GetEnrichedTerms(["YGR270W", "YIL075C", "YDL007W"], slimsOnly=True)
16print "Enriched slim terms:"
17for GOId, (genes, p_value, _) in res.items():
18    if p_value < 0.05:
19        print ontology[GOId].name, "with p-value: %.4f" %p_value, ", ".join(genes)
20       
21# Print names and definitions of all terms with "apoptosis" in the name
22##for term in [term for term in ontology.terms.values() if "apoptosis" in term.name.lower()]:
23##  print term.name, term.id
24##  print term.def_ if hasattr(term, "def_") else ""
Note: See TracBrowser for help on using the repository browser.