Пример #1
0
 def compute_Kbg_excluded_chrom(self, chrom_i):
     """
     computes the background covariance matrix from all SNPs that are not on
     chromosome chrom_i
     """
     idx_bg = self.chrom != chrom_i
     M = self.M[idx_bg]
     Kbg = utils.computeLinearKernel(M.T)
     return Kbg
Пример #2
0
 def compute_Kbg_excluded_chrom(self,chrom_i):
     """
     computes the background covariance matrix from all SNPs that are not on
     chromosome chrom_i
     """
     idx_bg = self.chrom!=chrom_i
     M = self.M[idx_bg]
     Kbg = utils.computeLinearKernel(M.T)
     return Kbg
Пример #3
0
    def set_K(self,K=None, X=None, U=None, S=None):
        """
        setting background covariance matrix

        input:
        K   :   covariance matrix [NxN]
        X   :   genetric markers used for constructing the covariance marix [NxF].
        """
        N = self.genoreader.get_ncols()
        
        if K is not None:
            assert K.shape[0]==N
            assert K.shape[1]==N
            self.K = K

        if X is not None:
            assert X.shape[0]==N
            self.K = utils.computeLinearKernel(X)

        if (U is None) or (S is None):
            S,U = scipy.linalg.eigh(K)
        self.S = S
        self.U = U
Пример #4
0
    def set_K(self, K=None, X=None, U=None, S=None):
        """
        setting background covariance matrix

        input:
        K   :   covariance matrix [NxN]
        X   :   genetric markers used for constructing the covariance marix [NxF].
        """
        N = self.genoreader.get_ncols()

        if K is not None:
            assert K.shape[0] == N
            assert K.shape[1] == N
            self.K = K

        if X is not None:
            assert X.shape[0] == N
            self.K = utils.computeLinearKernel(X)

        if (U is None) or (S is None):
            S, U = scipy.linalg.eigh(K)
        self.S = S
        self.U = U