source: orange-bioinformatics/doc/modules/mirnaExample4.py @ 1091:2d25a8aa46d0

Revision 1091:2d25a8aa46d0, 576 bytes checked in by riccardoberetta <riccardoberetta@…>, 4 years ago (diff)
Line 
1import random
2import obiGO
3import obimiRNA
4
5annotations = obiGO.Annotations('hsa',obiGO.Ontology())
6
7miRNAs = random.sample(obimiRNA.ids('hsa'),10)
8
9dict_all = obimiRNA.get_GO(miRNAs, annotations, goSwitch=False)
10dict_enr = obimiRNA.get_GO(miRNAs, annotations, enrichment=True, goSwitch=False)
11
12dict_tfidf = obimiRNA.filter_GO(dict_all, annotations, reverse=False)
13
14print '#\tmiRNA name\t# All GO terms\t# Enriched GO terms\t# Filtred GO terms\n'
15for n,m in enumerate(miRNAs):
16    print '%d\t%s\t\t%d\t\t%d\t\t%d' % (n+1,m,len(dict_all[m]),len(dict_enr[m]),len(dict_tfidf[m]))
Note: See TracBrowser for help on using the repository browser.