M_step

Module Contents

M_step.sum_nonleaf_gammas(leaves_idx, gammas: npt.NDArray[np.float64]) → npt.NDArray[np.float64]

Sum of the gammas of the cells that are able to divide, that is, sum the of the gammas of all the nonleaf cells. It is used in estimating the transition probability matrix. This is an inner component in calculating the overall transition probability matrix.

This is downward recursion.

Parameters
  • lO – the object of lineage tree

  • gamma_arr – the gamma values for each lineage

Returns

the sum of gamma values for each state for non-leaf cells.

M_step.get_all_zetas(leaves_idx: npt.NDArray[np.uintp], cell_to_daughters: npt.NDArray[np.uintp], beta_array: npt.NDArray[np.float64], MSD_array: npt.NDArray[np.float64], gammas: npt.NDArray[np.float64], T: npt.NDArray[np.float64]) → npt.NDArray[np.float64]

Sum of the list of all the zeta parent child for all the parent cells for a given state transition pair. This is an inner component in calculating the overall transition probability matrix.

Parameters
  • lineageObj – the lineage tree of cells

  • beta_array – beta values. The conditional probability of states, given observations of the sub-tree rooted in cell_n

  • MSD_array – marginal state distribution

  • gammas – gamma values. The conditional probability of states, given the observation of the whole tree

  • T – transition probability matrix

Returns

numerator for calculating the transition probabilities