Changeset 1878:8b1e95b04793 in orange-bioinformatics for orangecontrib/bio/widgets/OWSetEnrichment.py


Ignore:
Timestamp:
10/09/13 15:36:14 (6 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Parents:
1877:2a17616eb737 (diff), 1870:8993be909b62 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged biolab/orange-bioinformatics into default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orangecontrib/bio/widgets/OWSetEnrichment.py

    r1877 r1878  
    8383    contextHandlers = {"":DomainContextHandler("", ["speciesIndex", "genesinrows", "geneattr", "categoriesCheckState"])} 
    8484 
     85    def refreshHierarchy(self): 
     86        self.setHierarchy(*self.getHierarchy(taxid=self.taxid_list[self.speciesIndex])) 
     87 
    8588    def __init__(self, parent=None, signalManager=None, name="Gene Set Enrichment Analysis", **kwargs): 
    8689        OWWidget.__init__(self, parent, signalManager, name, **kwargs) 
     
    114117        self.speciesComboBox = OWGUI.comboBox(self.controlArea, self, 
    115118                      "speciesIndex", "Species", 
    116                       callback=lambda: self.data and self.updateAnnotations(), 
     119                      callback=lambda: (self.refreshHierarchy(), self.data and self.updateAnnotations()), 
    117120                      debuggingEnabled=0) 
    118121 
     
    261264 
    262265            self.openContext("", data) 
    263  
    264 #            print self.speciesIndex 
    265  
    266             self.setHierarchy(*self.getHierarchy(taxid=self.taxid_list[self.speciesIndex])) 
     266         
     267            self.refreshHierarchy() 
    267268 
    268269            self.loadedGenematcher = "None" 
     
    304305                fill(value, item, full_cat, org=org) 
    305306 
     307        self.groupsWidget.clear() 
    306308        fill(hierarchy[1], self.groupsWidget, org=hierarchy[0]) 
    307309        fill(hierarchy_noorg[1], self.groupsWidget, org=hierarchy_noorg[0]) 
     
    332334        self.categoriesCheckState = self.getHierarchyCheckState() 
    333335        categories = self.selectedCategories() 
     336         
    334337        if not set(categories) <= set(self.currentAnnotatedCategories): 
    335338            self.updateAnnotations() 
    336339        else: 
    337340            self.filterAnnotationsChartView() 
     341         
    338342 
    339343    def updateGeneMatcherSettings(self): 
     
    483487                item.setData(3, Qt.DisplayRole, QVariant(refFmt % (len(rmapped), 100.0*len(rmapped)/len(referenceGenes)))) 
    484488                item.setData(4, Qt.DisplayRole, QVariant("%0.6f" % p_val)) if p_val > 0.001 else item.setData(4, Qt.DisplayRole, QVariant("%0.2e" % p_val)) 
    485                 item.setData(4, 42, QVariant(p_val)) 
    486                 #stoplec 4 - zelim sort po p_val 
     489                item.setData(4, 42, QVariant(p_val)) #sorting 
    487490                item.setData(4, Qt.ToolTipRole, QVariant("%0.10f" % p_val)) 
    488491                item.setData(5, Qt.DisplayRole, QVariant(enrichment)) 
     
    520523            return 
    521524        categories = set(" ".join(cat) for cat, taxid in self.selectedCategories()) 
     525 
     526        #compute FDR after selection categories 
     527     
    522528        filterString = str(self.filterLineEdit.text()).lower() 
    523529        itemsHidden = [] 
     
    603609    app = QApplication(sys.argv) 
    604610    w = OWSetEnrichment() 
    605     w.updateHierarchy() 
    606611    data = orange.ExampleTable("yeast-class-RPR.tab") 
     612    #data = orange.ExampleTable("/home/marko/Downloads/tmp.tab") 
    607613#    data = orange.ExampleTable("../human") 
    608614#    print cProfile.runctx("w.setData(data)", globals(), locals()) 
Note: See TracChangeset for help on using the changeset viewer.