#!/usr/bin/python import os, csv, sys from GotermEnriched import * #Example of using class GotermEnrich #Generate an object of the GotermEnrich class weightGographData = 'newWeightedPubMedGO.xml' geneGotermAssociationData = 'gene_association.sgd' G = GotermEnrich(weightGographData,geneGotermAssociationData) #two list needed to be processed list1= ['FUS3', 'RAD6', 'STE24', 'DIG2', 'DIG1', 'STE11', 'STE12', 'STE7', 'STE4', 'STE5', 'STE18', 'KSS1'] list2= ['YER044C', 'ERG3', 'CMD1', 'ERG11', 'YMR031W-A', 'SWI4', 'TUNICAMYCIN'] #call the Go term enriched function (Parameters: list1--a list of genes; 0.05--the PValue threshold; # 2--number of top score (PValue) Go terms that are outputed. 5--Minimum number of genes in the Go terms of solutions) #The return value of Goterm_enrich() is a list, where each element is also a list # [goterm ID, a list of genes annotated with this goterm, PValue, the level of go term in the Ontology structure]. result1 = G.Goterm_enrich(list1,0.05,2,5) result2 = G.Goterm_enrich(list2,0.05,2,3) #print the result1 print 'The output of result1:' for item in result1: print item print '-----------------------------------' print 'the output of result2:' for item in result2: print item