aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/my_pylmm/pyLMM/kinship.py4
-rw-r--r--wqflask/wqflask/my_pylmm/pyLMM/lmm.py16
-rw-r--r--wqflask/wqflask/my_pylmm/pyLMM/runlmm.py1
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)