Mercurial > repos > george-weingart > lefse
changeset 2:0efe0916b1b6 draft
Fix the kruskal wallis call error
author | george-weingart |
---|---|
date | Sat, 24 May 2014 13:27:35 -0400 |
parents | 394983afb1ee |
children | 5705c67a8be4 |
files | lefse.py |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lefse.py Sat May 03 11:30:16 2014 -0400 +++ b/lefse.py Sat May 24 13:27:35 2014 -0400 @@ -36,7 +36,6 @@ out.write( "\t" + res['wilcox_res'][k]+"\n") def load_data(input_file, nnorm = False): - with open(input_file, 'rb') as inputf: inp = pickle.load(inputf) if nnorm: return inp['feats'],inp['cls'],inp['class_sl'],inp['subclass_sl'],inp['class_hierarchy'],inp['norm'] @@ -53,10 +52,10 @@ for i,f in enumerate(factors): robjects.globalenv['x'+str(i+1)] = robjects.FactorVector(robjects.StrVector(cls[f])) fo = "y~x1" - for i,f in enumerate(factors[1:]): - if f == "subclass" and len(set(cls[f])) <= len(set(cls["class"])): continue - if len(set(cls[f])) == len(cls[f]): continue - fo += "+x"+str(i+2) + #for i,f in enumerate(factors[1:]): + # if f == "subclass" and len(set(cls[f])) <= len(set(cls["class"])): continue + # if len(set(cls[f])) == len(cls[f]): continue + # fo += "+x"+str(i+2) kw_res = robjects.r('kruskal.test('+fo+',)$p.value') return float(tuple(kw_res)[0]) < p, float(tuple(kw_res)[0]) @@ -95,7 +94,7 @@ first = False if not curv and ( med_comp or tres ): dir_cmp = sx < sy - if sx == sy: br = True + #if sx == sy: br = True elif curv: dir_cmp = None if med_comp or tres: