aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorPjotr Prins2015-04-02 12:14:43 +0200
committerPjotr Prins2015-04-02 12:14:43 +0200
commit5151bc389aa98415da9f4d49b3c279ed1380ea7d (patch)
treed7499106c7b3cc080b26257202d21f51f943998b /wqflask
parent43295e57621e9a08ca4cb90e95cc14a87e0d8b5e (diff)
downloadgenenetwork2-5151bc389aa98415da9f4d49b3c279ed1380ea7d.tar.gz
Prepare iterator
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/my_pylmm/pyLMM/runlmm.py15
1 files changed, 11 insertions, 4 deletions
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