From 3cff3091379a2e8835027c272ada0d8d4314624e Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 16 Mar 2015 13:15:21 +0300 Subject: Output added --- wqflask/wqflask/my_pylmm/pyLMM/kinship.py | 4 ++-- wqflask/wqflask/my_pylmm/pyLMM/lmm.py | 16 +++++++++------- wqflask/wqflask/my_pylmm/pyLMM/runlmm.py | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/wqflask/wqflask/my_pylmm/pyLMM/kinship.py b/wqflask/wqflask/my_pylmm/pyLMM/kinship.py index bb4f5ace..cd2445f1 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/kinship.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/kinship.py @@ -164,8 +164,8 @@ def kvakve(K, verbose=True): Kva,Kve = linalg.eigh(K) if verbose: - print("self.Kva is: ", Kva.shape, Kva) - print("self.Kve is: ", Kve.shape, Kve) + print("Kva is: ", Kva.shape, Kva) + print("Kve is: ", Kve.shape, Kve) if sum(Kva < 1e-6): if verbose: sys.stderr.write("Cleaning %d eigen values\n" % (sum(Kva < 1e-6))) diff --git a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py index 17fe952a..9fd05b42 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/lmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/lmm.py @@ -533,11 +533,12 @@ class LMM: if len(Kva) == 0 or len(Kve) == 0: # if self.verbose: sys.stderr.write("Obtaining eigendecomposition for %dx%d matrix\n" % (K.shape[0],K.shape[1]) ) - # begin = time.time() + begin = time.time() # Kva,Kve = linalg.eigh(K) - # end = time.time() - # if self.verbose: sys.stderr.write("Total time: %0.3f\n" % (end - begin)) Kva,Kve = kvakve(K) + end = time.time() + if self.verbose: sys.stderr.write("Total time: %0.3f\n" % (end - begin)) + print("sum(Kva),sum(Kve)=",sum(Kva),sum(Kve)) self.K = K self.Kva = Kva @@ -547,10 +548,11 @@ class LMM: self.Y = Y self.X0 = X0 self.N = self.K.shape[0] - - if sum(self.Kva < 1e-6): - if self.verbose: sys.stderr.write("Cleaning %d eigen values\n" % (sum(self.Kva < 0))) - self.Kva[self.Kva < 1e-6] = 1e-6 + + # ----> Below moved to kinship.kvakve(K) + # if sum(self.Kva < 1e-6): + # if self.verbose: sys.stderr.write("Cleaning %d eigen values\n" % (sum(self.Kva < 0))) + # self.Kva[self.Kva < 1e-6] = 1e-6 self.transform() diff --git a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py index 6bb79856..cef0cdc4 100644 --- a/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py +++ b/wqflask/wqflask/my_pylmm/pyLMM/runlmm.py @@ -120,6 +120,7 @@ if cmd == 'redis': G = None ps, ts = gn2_load_redis('testrun','other',k,Y,gt) print np.array(ps) + print sum(ps) # Test results p1 = round(ps[0],4) p2 = round(ps[-1],4) -- cgit v1.2.3