scPhyloX.estimation.mutation_rate

Classes

GenerationEst

Estimation of generations with given LR distance distribution and mutaion rate

BranchLength

Probability distribution of LP distance

LogLike

Functions

mutation_rate_de(data[, n_iter, bootstrape])

Mutation rate estimation using DE

my_loglike(theta, data)

mutation_rate_mcmc(data[, draw, tune, chain, mu0, sigma])

Mutation rate estimation using DE-MCMC

Module Contents

class GenerationEst(lr_dist, mu: float, gennum=None)

Estimation of generations with given LR distance distribution and mutaion rate

Args:
lr_dist:

distribution of LR distance

mu:

mutation rate

lr_dist
mu
u1
s1
generation = None
generation_map(mn: float)

MAP estimation of given lr-dist

Args:
mn:

lr-distance

Returns:
float:

Estimated generation

estimate(cell_number=None)

Generation estimation of all given lr distance in self.lr_dist

class BranchLength(mu, delta)

Probability distribution of LP distance

Args:
mu:

mutation rate

delta:

Probability of branching division

mu
delta
prob(x)

Probability density function of lp-dist

Args:
x:

lp-dist

Return:
float:

probability density

likelihood(data)

Likelihood of lp-dist

Args:
data:

Observed lp dist

Return:
float:

Sum of log-likelihood of given lp dist

mutation_rate_de(data, n_iter: int = 100, bootstrape: int = 0)

Mutation rate estimation using DE

Args:
data:

lp-dist

n_iter:

Iterations of de estimation

bootstrape:

Weather using bootstrape to accuratly estimate mutation rate, 0 to turn off.

Return:
tuple:

(accepted parameters, loss, de-estimator)

class LogLike(loglike, data)

Bases: pytensor.tensor.Op

itypes
otypes
likelihood
data
perform(node, inputs, outputs)
my_loglike(theta, data)
mutation_rate_mcmc(data, draw=1000, tune=1000, chain=4, mu0=2, sigma=0.2)

Mutation rate estimation using DE-MCMC

Args:
data:

Observed lp-dist

draw:

Number of smaples to draw

tune:

Number of iterations to tune

chain:

number of chains to sample

mu0:

mean of prior distribution of mutation rate

sigma:

variation of prior distribution of mutation rate