From 5151bc389aa98415da9f4d49b3c279ed1380ea7d Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 2 Apr 2015 12:14:43 +0200 Subject: Prepare iterator --- wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py index 5a4bd268..036bf7d5 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -104,10 +104,17 @@ if options.geno and cmd != 'iterator': print g.shape if cmd == 'iterator': - print "ITERATE over SNPs" - def pretty(snpid,values): - print snpid,values - print tsvreader.geno_iter(options.geno,pretty) + def snp_iterator(func): + tsvreader.geno_iter(options.geno,func) + + if options.remove_missing_phenotypes: + raise Exception('Can not use --remove-missing-phenotypes with LMM2') + ps, ts = gn2_iter_redis('testrun_iter','other',k,y,snp_iterator) + print np.array(ps) + print len(ps),sum(ps) + # Test results + p1 = round(ps[0],4) + p2 = round(ps[-1],4) elif cmd == 'redis_new': # The main difference between redis_new and redis is that missing # phenotypes are handled by the first -- cgit v1.2.3