scPhyloX.estimation.tissue

Classes

LogLike

Functions

bt(t, a, b, k, t0)

Stem cell growth rate eta(t)

cellnumber(t, xx, a, b, k, t0, p, r, d)

ODE of cell number changes over time

ncyc(i, t, c0, ax, bx, r, d, k, t0)

Stem cell number calculator

nnc(i, t, c0, ax, bx, r, d, k, t0)

non-stem cell number calculator

p_xi(n_gen, T, c0, ax, bx, r, d, k, t0)

Probability density function of LR distance

my_loglike(theta, data, args)

Likelihood of lr-dist

para_inference_DE(data[, T, c0, sigma, n_iter, ...])

Mutation rate estimation using DE

mcmc_inference(data, para_prior, T, c0, sigma[, draw, ...])

Mutation rate estimation using DE-MCMC

Module Contents

bt(t: float, a: float, b: float, k: float, t0: float)

Stem cell growth rate eta(t)

Args:
t:

time

a,b,k,t0:

parameters

cellnumber(t, xx, a, b, k, t0, p, r, d)

ODE of cell number changes over time

Args:
t:

time

xx:

[n_stemcell, n_nonstemcell]

ncyc(i, t, c0, ax, bx, r, d, k, t0)

Stem cell number calculator

Args:
i:

generation

t:

time

c0:

initial cell number

ax,bx,r,d,k,t0:

parameters

return:
float:

Stem cell number in generation i at time t.

nnc(i, t, c0, ax, bx, r, d, k, t0)

non-stem cell number calculator

Args:
i:

generation

t:

time

c0:

initial cell number

ax,bx,r,d,k,t0:

parameters

Return:
float:

non-stem cell number in generation i at time t.

p_xi(n_gen, T, c0, ax, bx, r, d, k, t0)

Probability density function of LR distance Args:

n_gen:

generation

T:

time

c0:

initial cell number

ax, bx, r, d, k, t0:

parameters

Return:
np.array:

Probability density of LR distance at time T.

my_loglike(theta, data, args)

Likelihood of lr-dist

Args:
theta:

parameters, (ax, bx, r, d, k ,t0)

data:

Observed lr dist

args:

paramteres, (time, initial_cell_number, prior_sigma)

Return:
float:

Sum of log-likelihood of given lr dist parameters

para_inference_DE(data, T=20, c0=None, sigma=1, n_iter=100, bootstrape=0, verbose='text')

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, args)

Bases: pytensor.tensor.Op

itypes
otypes
likelihood
data
args
perform(node, inputs, outputs)
mcmc_inference(data, para_prior, T, c0, sigma, draw=1000, tune=1000, chains=8)

Mutation rate estimation using DE-MCMC

Args:
data:

Observed lp-dist

data_prior:

mean of prior distributions of all parameters

T:

time of phylodynamics eqns

c0:

initial cell numbers

sigma:

variation of loss function

draw:

Number of smaples to draw

tune:

Number of iterations to tune

chain:

number of chains to sample