Changeset 1961:3cffa0f0cf0e in orange-bioinformatics


Ignore:
Timestamp:
02/18/14 15:28:19 (2 months ago)
Author:
markotoplak
Branch:
default
Message:

Remove dependencies for stats in obiGeneSetSig.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orangecontrib/bio/obiGeneSetSig.py

    r1955 r1961  
    66 
    77import scipy.stats 
     8import scipy.special 
    89import numpy 
    910import Orange, Orange.utils, statc 
    1011 
    11 if __name__ == "__main__": 
    12     __package__ = "Orange.bio" 
    13  
    14 from . import obiExpression, obiGene, obiGeneSets, obiGsea, stats 
     12from . import obiExpression, obiGene, obiGeneSets, obiGsea 
    1513 
    1614def corgs_activity_score(ex, corg): 
     
    196194 
    197195def normcdf(x, mi, st): 
    198     return 0.5*(2. - stats.erfcc((x - mi)/(st*math.sqrt(2)))) 
     196    #implementation with scipy is almost the same as from Gary's stats 
     197    #return 0.5*(2. - stats.erfcc((x - mi)/(st*math.sqrt(2)))) 
     198    return 0.5*(2. - scipy.special.erfc((x - mi)/(st*math.sqrt(2)))) 
    199199 
    200200class AT_edelmanParametric(object): 
     
    437437    def ttest(ex1, ex2): 
    438438        try: 
    439             return stats.lttest_ind(ex1, ex2)[0] 
     439            return float(scipy.stats.ttest_ind(ex1, ex2)[0]) 
    440440        except: 
    441441            return 0.0 
     
    10161016    #ass = LLR(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0, normalize=True) 
    10171017    #ass = LLR_slow(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0) 
    1018     ass = PCA(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0, cv=True) 
     1018    ass = SetSig(data, matcher=matcher, gene_sets=gsets, class_values=choosen_cv, min_part=0.0, cv=True) 
    10191019    ar = to_old_dic(ass.domain, data[:5]) 
    10201020    pp2(ar) 
Note: See TracChangeset for help on using the changeset viewer.