scPhyloX.estimation.tumor

Classes

LogLike

Functions

cellnumber(t, xx, r, a, s, u)

ODE of cell number changes over time

cellnumber_nc(t, x, r, a)

Neutral cell number calculator

nc_sol(t, c0, k, r, a)

Analytical solution of neutral cell number

cellnumber_ac(t, x, c0, r, a, s, u)

Neutral cell number calculator

p_xi(gen, T, x0, r, a, s, u)

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

cellnumber(t, xx, r, a, s, u)

ODE of cell number changes over time

Args:
t:

time

xx:

[n_stemcell, n_nonstemcell]

cellnumber_nc(t, x, r, a)

Neutral cell number calculator

Args:
t:

time

x:

neutral cell number

r, a:

parameters

return:
np.array:

neutral cell number at time t.

nc_sol(t, c0, k, r, a)

Analytical solution of neutral cell number

Args:
t:

time

c0:

initial neutral cell number

k:

generation

r, a:

parameters

return:
float:

neutral cell number in generation k at time t.

cellnumber_ac(t, x, c0, r, a, s, u)

Neutral cell number calculator

Args:
t:

time

x:

advantageous cell number

c0:

initial ac number

r, a, s, u:

parameters

return:
np.array:

advantageous cell number at time t.

p_xi(gen, T, x0, r, a, s, u)

Probability density function of LR distance Args:

gen:

generation

T:

time

x0:

initial cell number

r, a, s, u:

parameters

Return:
np.array:

Probability density of LR distance at time T.

my_loglike(theta, data, args)

Likelihood of lr-dist

Args:
theta:

parameters, (r, a, s, u)

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=5)

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