def fit_null_model(self): null_model = MixedModel(self.pedigrees, outcome=self.outcome, fixed_effects=self.fixed_effects) null_model.add_genetic_effect() null_model.fit_model() null_model.maximize(method=self.maximization, verbose=self.verbose) return null_model
def fit_alternative_model(self): ibd_model = MixedModel(self.pedigrees, outcome=self.outcome, fixed_effects=self.fixed_effects) ibd_model.add_genetic_effect() ranef = RandomEffect(self.analysis_individuals, 'IBD', incidence_matrix='eye', covariance_matrix=self.ibd_matrix) ibd_model.add_random_effect(ranef) ibd_model.fit_model() ibd_model.maximize(verbose=self.verbose, method=self.maximization) return ibd_model
# Get valid individuals from phenotypes analysis_individuals = [x for x in peds.individuals if args.outcome in x.phenotypes] # Read SGS data print 'Reading SGS data' sgs = read_germline(args.sgs) print 'Updating references' sgs.update_segment_references(peds) print 'Fitting polygenic model' null_model = MixedModel(peds, outcome=args.outcome, fixed_effects=args.fixefs) null_model.add_genetic_effect() null_model.fit_model() null_model.maximize(method=args.maxmethod, verbose=args.verbose) null_model.summary() llik_null = null_model.loglikelihood() print 'Done' analysis_individuals = null_model.observations() def vc_linkage(locus): ibd_model = MixedModel( peds, outcome=args.outcome, fixed_effects=args.fixefs) add_relat_mat = null_model.covariance_matrices[0] additive = RandomEffect(analysis_individuals, 'additive',