limix / struct-lmm

Structured Linear Mixed Model is a method to test for loci that interact with multiple environments.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is no interpretation module anymore

horta opened this issue · comments

Even though it tries to provide it in the __init__.py:

"interpretation",

@annacuomo tried to use struct-lmm version 0.0.10 as it provides interpretation module. The problem is that that it is failing anyway because of GP2KronSumLR from limix-core fails with the error:

numpy.linalg.linalg.LinAlgError: 12-th leading minor of the array is not positive definite

when running the lines

gp=GP2KronSumLR(Y=self.y, F=_covs, A=sp.eye(1), Cn=FreeFormCov(1), G=self.xoE)                    
gp.covar.Cr.setCovariance(1e-4 * sp.ones((1,1)))
gp.covar.Cn.setCovariance(0.02 * sp.ones((1,1)))

from file struct_lmm/interpretation/predict_genetic_effect.py.

The error can be reproduced by running the following:

import limix_core as lc
import limix_core.covar
import limix_core.gp
import numpy as np
import urllib2
import scipy as sp

url = "http://rest.s3for.me/limix/GP2KronSumLR_input.npz"

with open("GP2KronSumLR_input.npz",'wb') as f:
    f.write(urllib2.urlopen(url).read())
    f.close()
print("Download Complete!")

inp = dict(np.load("GP2KronSumLR_input.npz"))
inp["Cn"] = lc.covar.FreeFormCov(1)
gp = lc.gp.GP2KronSumLR(**inp)
gp.covar.Cr.setCovariance(1e-4 * sp.ones((1,1)))
gp.covar.Cn.setCovariance(0.02 * sp.ones((1,1)))
gp.optimize(verbose=True)

I think the interpretation module won't get back into struct-lmm (it is more suitable for limix anyway).