Commits

Flashpoint committed d9c6f60

Removed the select/unselect all gene sets check box from OWSetEnrichment.py widget

Comments (0)

Files changed (2)

_bioinformatics/obiGeneAtlasSets.py

 from collections import defaultdict
 from Orange.bio.obiGeneAtlas import run_simple_query
 from Orange.bio.obiGeneSets import GeneSets, GeneSet
+import time
 
 def display_string(string):
     return string.capitalize().replace("_", " ")
 
 regulation = "updown"
 organism   = "Homo sapiens"
-condition  = "cell_line"
+condition  = "organism_part"
 org_code   = "9606"
 max_pvalue = 1e-5
 
 sets = defaultdict(list)
 
 for start in range(no_of_pages+1):
+    start = time.time()
     query = run_simple_query(regulation=regulation, organism=organism, condition=condition, start=start*no_of_genes, rows=no_of_genes)
     for result in query["results"]:
         i += 1
-        #print result["gene"]["name"] + "\t" + str(i) # For printing out gene names and the current number of genes during debugging
+        print result["gene"]["name"] + "\t" + str(i) # For printing out gene names and the current number of genes during debugging
         for exp in result["expressions"]: 
             diff_exp = [e for e in exp["experiments"] if e["pvalue"] <= max_pvalue] # Use only genes that are significantly diff. expressed
             if diff_exp:
                     sets[exp["ef"], exp["efv"]].append(result["gene"]["name"]) # The Gene Expression Atlas entries are not consistent. 
                 except:
                     sets[exp["efoTerm"], exp["efoId"]].append(result["gene"]["name"])
+    print time.time() - start
         
 gene_sets = []
 for (ef, efv), genes in sets.items():
 
 final_set = GeneSets(gene_sets)
 
-#print final_set
-#exit()
+print final_set
+exit()
 
 from Orange.bio.obiGeneSets import register
 import Orange.utils.serverfiles as serverfiles

_bioinformatics/widgets/OWSetEnrichment.py

 
         self.speciesComboBox = OWGUI.comboBox(self.controlArea, self,
                       "speciesIndex", "Species",
-                      callback=lambda :self.data and self.updateAnnotations(),
+                      callback=lambda: self.data and self.updateAnnotations(),
                       debuggingEnabled=0)
 
         box = OWGUI.widgetBox(self.controlArea, "Gene names")
 
         self.connect(self.groupsWidget, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self.subsetSelectionChanged)
 
-        self.omnibox = 1                                                                  ## A FUNCTION CALL TO HANDLE SELECTING/DESELECTING gene sets
-        OWGUI.checkBox(self.controlArea, self, "omnibox", "Select/Unselect all gene sets")#, callback= lambda :self.allSetsChanged())
-
         OWGUI.button(self.controlArea, self, "Commit", callback=self.commit)
 
         self.loadedGenematcher = "None"
         collection[taxid].update(collection[None])
         return collection[taxid]
 
-
-
-
-## AN ATTEMPT TO ENABLE/DISABLE all gene sets at once
-#    def allSetsChanged(self):
-#        print self.omnibox
-#        print self.getHierarchyCheckState()
-#        print self.categoriesCheckState
-#        print self.selectedCategories()
-        
-
-
     def setHierarchy(self, hierarchy):
         self.groupsWidgetItems = {}
         def fill(col, parent, full=()):