Changeset 1711:643d37885055 in orange-bioinformatics for _bioinformatics/obiGsea.py


Ignore:
Timestamp:
08/17/12 15:36:10 (20 months ago)
Author:
markotoplak
Branch:
default
rebase_source:
89e6b1f907eeaa5970e4e1b4ce03b3fc8ef6995e
Message:

obiGeneSetSig: speedup of ASSESS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGsea.py

    r1706 r1711  
    4747    """ 
    4848    ordered = [ (i,a) for i,a in enumerate(lcor) ] #original pos + correlation 
    49     ordered.sort(lambda x,y: cmp(y[1],x[1])) #sort by correlation, descending 
     49    ordered.sort(key=lambda x: -x[1]) #sort by correlation, descending 
    5050    ordered = nth(ordered, 0) #contains positions in the original list 
    5151    return ordered 
     
    7777    notInA = -(1. / (len(lcor)-len(subset))) 
    7878    #base for addition if gene is in the subset 
    79     cors = [ abs(lcor[i])**p for i in subset ] 
     79 
     80    cors = [ abs(lcor[i])**p for i in subset ] #belowe in numpy 
    8081    sumcors = sum(cors) 
    8182 
Note: See TracChangeset for help on using the changeset viewer.