Changeset 1448:c4986b126c36 in orange-bioinformatics


Ignore:
Timestamp:
07/01/11 13:35:15 (3 years ago)
Author:
lanz <lan.zagar@…>
Branch:
default
Convert:
5077c45557218db7ab37815baadcdf9f22d8812a
Message:

Added two filtering methods to Gene Selection widget.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • obiDifscale.py

    r1446 r1448  
    11import random 
    22from math import log 
     3from operator import itemgetter 
    34 
    45import numpy 
     
    78import Orange 
    89import obiGEO 
     10from obiExpression import ExpressionSignificance_Test 
    911 
    1012 
     
    180182    return areas 
    181183 
     184class ExpressionSignificance_AREA(ExpressionSignificance_Test): 
     185    def __call__(self, target=None): 
     186        attr_set = {} 
     187        for a in self.data.domain.attributes: 
     188            attr_set[a.attributes['time']] = attr_set.get(a.attributes['time'], []) + [a.name] 
     189        scores = AREA(self.data, sorted(attr_set.items())) 
     190        return zip(self.keys, map(itemgetter(1), scores)) 
     191 
    182192def FC(data, attr_set, control='t0', thr=2, auto=False, p_thr=0.2): 
    183193    """ Gene filtering based on the number of FC of all time points with the control series > thr """ 
     
    192202    return fc 
    193203 
     204class ExpressionSignificance_FCts(ExpressionSignificance_Test): 
     205    def __call__(self, target=None): 
     206        attr_set = {} 
     207        for a in self.data.domain.attributes: 
     208            attr_set[a.attributes['time']] = attr_set.get(a.attributes['time'], []) + [a.name] 
     209        scores = FC(self.data, sorted(attr_set.items())) 
     210        return zip(self.keys, map(itemgetter(1), scores)) 
     211 
    194212def spearmanr_filter(data, limit=1000): 
    195213    """ Spearman ranks gene filtering """ 
  • widgets/OWFeatureSelection.py

    r1407 r1448  
    1010 
    1111from obiExpression import * 
     12from obiDifscale import ExpressionSignificance_AREA, ExpressionSignificance_FCts 
    1213 
    1314from OWGraph import * 
     
    125126                             ("info gain", ExpressionSignificance_Info, oneTailTestHi, True), 
    126127                             ("chi-square", ExpressionSignificance_ChiSquare, oneTailTestHi, True), 
    127                              ("mann-whitney", ExpressionSignigicance_MannWhitneyu_U, oneTailTestLow, True)] 
     128                             ("mann-whitney", ExpressionSignigicance_MannWhitneyu_U, oneTailTestLow, True), 
     129                             ("AREA (timeseries)", ExpressionSignificance_AREA, oneTailTestHi, False), 
     130                             ("FC (timeseries)", ExpressionSignificance_FCts, oneTailTestHi, False)] 
    128131 
    129132        boxHistogram = OWGUI.widgetBox(self.mainArea) 
Note: See TracChangeset for help on using the changeset viewer.