Changeset 1728:a7d42a8d1ed2 in orange-bioinformatics for _bioinformatics/obiGeneSetSig.py


Ignore:
Timestamp:
02/19/13 12:37:15 (14 months ago)
Author:
markotoplak
Branch:
default
Message:

Added an option in Assess to not ignore umatchable context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGeneSetSig.py

    r1725 r1728  
    219219        self.example_buffer = {} 
    220220        self.attransv = 0 
     221        self.ignore_unmatchable_context = True 
    221222        super(Assess, self).__init__(**kwargs) 
    222223 
     
    227228        if key not in self.example_buffer: 
    228229            ex_atts = [ at.name for at in ex.domain.attributes ] 
    229             new_atts = [ name_ind[nm.umatch(an)] if nm.umatch(an) != None else None 
    230                 for an in ex_atts ] 
     230            new_atts = [ name_ind[nm.umatch(an)] if nm.umatch(an) != None else (None if self.ignore_unmatchable_context else i) 
     231                for i,an in enumerate(ex_atts) ] 
    231232 
    232233            #new_atts: indices of genes in original data for that sample  
     
    274275                lcor, ordered, rev2, indices_to_lcori = \ 
    275276                    self._ordered_and_lcor(ex, nm, name_ind, attrans, attransv) 
    276          
     277 
     278            
    277279                #subset = list of indices, lcor = correlations, ordered = order 
    278280                #make it compatible with lcor, if some are missing in lcor 
    279281                subset = filter(None, 
    280282                    [ indices_to_lcori.get(name_ind2[g], None) for g in genes2 ] ) 
     283 
    281284                return obiGsea.enrichmentScoreRanked(subset, lcor, ordered, rev2=rev2)[0]  
    282285 
Note: See TracChangeset for help on using the changeset viewer.