Пример #1
0
    def construct(self,
                  Y,
                  X=None,
                  forcefullrank=False,
                  SNPs0=None,
                  i_exclude=None,
                  nullModel=None,
                  altModel=None,
                  scoring=None,
                  greater_is_better=None):
        '''
        The same code gets executed for both linear and logistic, because the logistic is an approximation.
        '''
        assert nullModel['effect'] == 'mixed' and altModel['effect'] == 'mixed',\
               'You have not used mixed effects for the two kernel case.'

        assert nullModel['link'] == 'linear'
        assert altModel['link'] == 'linear'

        if self.score == 'mom':
            assert nullModel['link'] == 'linear' and altModel['link'] == 'linear', 'You are allowed to use '\
                   'only the linear link for sc mom test.'
        G0, K0 = tu.set_snps0(SNPs0=SNPs0,
                              sample_size=Y.shape[0],
                              i_exclude=i_exclude,
                              forcefullrank=forcefullrank)
        return score.scoretest2K(Y=Y[:, SP.newaxis], X=X, K=K0, G0=G0)
Пример #2
0
    def construct(self, Y, X=None, forcefullrank = False, SNPs0 = None, i_exclude = None, nullModel = None, altModel = None,
                  scoring = None, greater_is_better = None):
        '''
        The same code gets executed for both linear and logistic, because the logistic is an approximation.
        '''
        assert nullModel['effect'] == 'mixed' and altModel['effect'] == 'mixed',\
               'You have not used mixed effects for the two kernel case.'

        assert nullModel['link'] == 'linear'
        assert altModel['link'] == 'linear'

        if self.score == 'mom':
            assert nullModel['link'] == 'linear' and altModel['link'] == 'linear', 'You are allowed to use '\
                   'only the linear link for sc mom test.'        
        G0,K0=tu.set_snps0(SNPs0=SNPs0,sample_size=Y.shape[0],i_exclude=i_exclude,forcefullrank=forcefullrank)          
        return score.scoretest2K(Y=Y[:,SP.newaxis],X=X,K=K0,G0=G0)
Пример #3
0
 def construct(self,
               Y,
               X=None,
               forcefullrank=False,
               SNPs0=None,
               i_exclude=None,
               nullModel=None,
               altModel=None,
               scoring=None,
               greater_is_better=None):
     G0, K0 = tu.set_snps0(SNPs0=SNPs0,
                           sample_size=Y.shape[0],
                           i_exclude=i_exclude)
     print "constructing LMM - this should only happen once."
     return lrt(Y,
                X=X,
                forcefullrank=forcefullrank,
                G0=G0,
                K0=K0,
                nullModel=nullModel,
                altModel=altModel)
Пример #4
0
 def construct(self,
               Y,
               X=None,
               forcefullrank=False,
               SNPs0=None,
               i_exclude=None,
               nullModel=None,
               altModel=None,
               scoring=None,
               greater_is_better=None):
     G0, K0 = tu.set_snps0(SNPs0=SNPs0,
                           sample_size=Y.shape[0],
                           i_exclude=i_exclude)
     return lr.lrt(Y=Y,
                   X=X,
                   model0=None,
                   appendbias=False,
                   forcefullrank=forcefullrank,
                   G0=G0,
                   K0=K0,
                   nullModel=nullModel,
                   altModel=altModel)
Пример #5
0
 def construct(self, Y, X=None, forcefullrank = False, SNPs0 = None, i_exclude = None, nullModel = None, altModel = None,
               scoring = None, greater_is_better = None):
     G0,K0=tu.set_snps0(SNPs0=SNPs0,sample_size=Y.shape[0],i_exclude=i_exclude)
     return lr.lrt(Y=Y, X=X, model0=None, appendbias=False, forcefullrank=forcefullrank, G0=G0,K0=K0, nullModel=nullModel, altModel=altModel)
Пример #6
0
 def construct(self, Y, X=None, forcefullrank = False, SNPs0 = None, i_exclude=None, nullModel = None, altModel = None,
               scoring = None, greater_is_better = None):
     G0,K0=tu.set_snps0(SNPs0=SNPs0,sample_size=Y.shape[0],i_exclude=i_exclude)
     print "constructing LMM - this should only happen once."
     return lrt(Y, X=X, forcefullrank=forcefullrank, G0=G0, K0=K0, nullModel=nullModel,altModel=altModel)