From 60476f068766371c41eb17c2ad20f4f6ce7da2d5 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 14 Mar 2015 13:58:02 +0300 Subject: Adding assertions --- wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 17 +++++++++++++---- 1 file changed, 13 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 7a77ad0a..8c0b73eb 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -113,10 +113,19 @@ if cmd == 'redis': ps, ts = gn2_load_redis('testrun','other',k,Y,G.T) print np.array(ps) - print round(ps[0],4) - assert(options.testing and round(ps[0],4)==0.7262) - print round(ps[-1],4) - assert(options.testing and round(ps[-1],4)==0.3461) + # Test results + p1 = round(ps[0],4) + p2 = round(ps[-1],4) + sys.stderr.write(options.geno+"\n") + if options.geno == 'data/small.geno': + assert p1==0.0708, "p1=%f" % p1 + assert p2==0.1417, "p2=%f" % p2 + if options.geno == 'data/small_na.geno': + assert p1==0.0958, "p1=%f" % p1 + assert p2==0.0435, "p2=%f" % p2 + if options.geno == 'data/test8000.geno': + assert p1==0.8984, "p1=%f" % p1 + assert p2==0.9623, "p2=%f" % p2 elif cmd == 'kinship': G = g print "Original G",G.shape, "\n", G -- cgit v1.2.3