source: orange-bioinformatics/docs/reference-html/gsea3.py @ 1662:427f1876f3e6

Revision 1662:427f1876f3e6, 891 bytes checked in by mitar, 2 years ago (diff)

Revamped documentation.

Line 
1import obiGeneSets
2import obiGsea
3import orange
4import obiGene
5import obiGEO
6
7import obiGEO
8gds = obiGEO.GDS("GDS10")
9data = gds.getdata() 
10
11print "Possible phenotype descriptors:"
12print map(lambda x: x[0], obiGsea.allgroups(data).items())
13
14matcher=obiGene.matcher([obiGene.GMKEGG("9606")])
15
16phenVar = "tissue"
17geneVar = "gene" #use gene meta variable for gene names
18
19genesets =  obiGeneSets.collections([":kegg:hsa"])
20res = obiGsea.runGSEA(data, matcher=matcher, minPart=0.05, geneSets=genesets, 
21    permutation="class", n=10, phenVar=phenVar, geneVar=geneVar)
22
23print
24print "GSEA results (choosen descriptor: tissue)"
25print "%-40s %6s %6s %6s %7s" % ("LABEL", "NES", "FDR", "SIZE", "MATCHED") 
26for name,resu in sorted(res.items(), key=lambda x: x[1]["fdr"])[:10]: 
27    print "%-40s %6.3f %6.3f %6d %7d" % (name[:30], resu["nes"], resu["fdr"], 
28        resu["size"], resu["matched_size"]) 
Note: See TracBrowser for help on using the repository browser.