def get_mixture(cls,
         log_counts, codon_distn,
         ts, tv, syn, nonsyn, compo, asym_compo,
         natural_theta,
         ):
     """
     @return: finite_distn, pre_Q_matrices
     """
     cls.check_theta(natural_theta)
     p0 = natural_theta[0]
     p1 = 1 - p0
     first_omega = natural_theta[1]
     second_omega = natural_theta[2]
     kappa = natural_theta[3]
     nt_distn = markovutil.ratios_to_distn(natural_theta[4:4+3])
     first_pre_Q = fmutsel.get_pre_Q(
             log_counts,
             fmutsel.genic_fixation,
             ts, tv, syn, nonsyn, compo, asym_compo,
             nt_distn, kappa, first_omega,
             )
     second_pre_Q = fmutsel.get_pre_Q(
             log_counts,
             fmutsel.genic_fixation,
             ts, tv, syn, nonsyn, compo, asym_compo,
             nt_distn, kappa, second_omega,
             )
     return (p0, p1), (first_pre_Q, second_pre_Q)
예제 #2
0
 def get_pre_Q(cls,
         log_counts, codon_distn,
         ts, tv, syn, nonsyn, compo, asym_compo,
         natural_theta,
         ):
     cls.check_theta(natural_theta)
     kappa = natural_theta[0]
     omega = natural_theta[1]
     nt_distn = markovutil.ratios_to_distn(natural_theta[2:5])
     pre_Q = fmutsel.get_pre_Q(
             log_counts,
             fmutsel.preferred_recessive_fixation,
             ts, tv, syn, nonsyn, compo, asym_compo,
             nt_distn, kappa, omega,
             )
     return pre_Q
예제 #3
0
 def get_pre_Q(cls,
         log_counts, codon_distn,
         ts, tv, syn, nonsyn, compo, asym_compo,
         theta,
         ):
     cls.check_theta(theta)
     kappa = algopy.exp(theta[0])
     omega = algopy.exp(theta[1])
     nt_distn = markovutil.log_ratios_to_distn(theta[2:5])
     pre_Q = fmutsel.get_pre_Q(
             log_counts,
             fmutsel.preferred_dominant_fixation,
             ts, tv, syn, nonsyn, compo, asym_compo,
             nt_distn, kappa, omega,
             )
     return pre_Q
예제 #4
0
 def get_pre_Q(cls,
         log_counts, codon_distn,
         ts, tv, syn, nonsyn, compo, asym_compo,
         natural_theta,
         ):
     cls.check_theta(natural_theta)
     first_proportion = natural_theta[0]
     first_omega = natural_theta[1]
     second_omega = natural_theta[2]
     kappa = natural_theta[3]
     nt_distn = markovutil.ratios_to_distn(natural_theta[4:4+3])
     pre_Q = fmutsel.get_pre_Q(
             log_counts,
             fmutsel.genic_fixation,
             ts, tv, syn, nonsyn, compo, asym_compo,
             nt_distn, kappa, omega,
             )
     return pre_Q