lineage.states.StateDistributionGamma

This file is completely user defined. We have provided a general starting point for the user to use as an example.

Classes

StateDistribution

StateDistribution for cells with gamma distributed times.

Functions

atonce_estimator(all_tHMMobj, x_list, gammas_list, phase)

Estimating the parameters for one state, in this case bernoulli nad gamma distirbution parameters,

Module Contents

class lineage.states.StateDistributionGamma.StateDistribution(bern_p=0.9, gamma_a=7.0, gamma_scale=4.5)

StateDistribution for cells with gamma distributed times.

Parameters:
  • bern_p (float)

  • gamma_a (float)

  • gamma_scale (float)

params
rvs(size, rng=None)

User-defined way of calculating a random variable given the parameters of the state stored in their object.

Parameters:

size (int)

dist(other)

Calculate the Wasserstein distance between two gamma distributions that each correspond to a state. This is our way of calculating the distance between two state, when their bernoulli distribution is kept the same. For more information about wasserstein distance, please see https://en.wikipedia.org/wiki/Wasserstein_metric.

Return type:

float

dof()

Return the degrees of freedom. In this case, each state has 1 bernoulli distribution parameter, and 2 gamma distribution parameters.

Return type:

int

logpdf(x)

User-defined way of calculating the log likelihood of the observation stored in a cell. In the case of a univariate observation, the user still has to define how the likelihood is calculated, but has the ability to just return the output of a known scipy.stats.<distribution>.<{pdf,pmf}> function. In the case of a multivariate observation, the user has to decide how the likelihood is calculated. In our example, we assume the observation's are uncorrelated across the dimensions (across the different distribution observations), so the total log likelihood of observing the multivariate observation is just the sum of the individual observation log likelihoods.

Parameters:

x (numpy.ndarray)

Return type:

numpy.ndarray

estimator(x, gammas)

User-defined way of estimating the parameters given a list of the tuples of observations from a group of cells.

Parameters:
  • x (numpy.ndarray)

  • gammas (numpy.ndarray)

censor_lineage_array(censor_condition, tree, obs, states, desired_experiment_time=2000000000000.0)

Applies censoring to array representation directly.

Parameters:
  • censor_condition (int)

  • tree (scipy.sparse.csr_array)

  • obs (numpy.ndarray)

  • states (numpy.ndarray)

Return type:

tuple[scipy.sparse.csr_array, numpy.ndarray, numpy.ndarray]

lineage.states.StateDistributionGamma.atonce_estimator(all_tHMMobj, x_list, gammas_list, phase)

Estimating the parameters for one state, in this case bernoulli nad gamma distirbution parameters, given a list of the tuples of observations from a group of cells. gammas_list is only for one state.

Parameters:
  • all_tHMMobj (list)

  • x_list (list)

  • gammas_list (list[numpy.ndarray])

  • phase (Literal['all', 'G1', 'G2'])