phylovelo.inference
Classes
Inference mean of z at time t |
Functions
|
Maximum likelihood estimation of ZINB distribution |
|
Maximum likelihood estimation of NB distribution |
|
Maximum likelihood estimation of Normal distribution |
|
Maximum likelihood estimation of ZI-Normal distribution |
|
Likelihood ratio test |
|
Estimation of latent expression z |
|
Inference latent expression z at time t in given model |
|
Determine whether a gene is meg |
|
Inference phylogenetic velocity |
Module Contents
- mle_zinb(data: list)
Maximum likelihood estimation of ZINB distribution
- Args:
- data:
Data
- Returns:
- tuple:
(-loglikelihood, MLE)
- mle_nb(data)
Maximum likelihood estimation of NB distribution
- Args:
- data:
Data
- Returns:
- tuple:
(-loglikelihood, MLE)
- mle_norm(data)
Maximum likelihood estimation of Normal distribution
- Args:
- data:
Data
- Returns:
- tuple:
(-loglikelihood, MLE)
- mle_zinorm(data)
Maximum likelihood estimation of ZI-Normal distribution
- Args:
- data:
Data
- Returns:
- tuple:
(-loglikelihood, MLE)
- lrtest(lh1: float, lh0: float, n: int, alpha: float)
Likelihood ratio test
- Args:
- lh1:
Likelihood of alternative hypothesis
- lh0:
Likelihood of null hypothesis
- n:
Degrees of freedom
- alpha:
Significance level
- Returns:
- tuple:
(Likelihood ratio statistics, is reject)
- est_z(x: ndarray, alpha: float, mu0: float, sigma2: float, model: str)
Estimation of latent expression z
- latenct_z_inference(data: list, time: int, model: str)
Inference latent expression z at time t in given model
- is_meg(x, y, trend=0)
Determine whether a gene is meg
- Args:
- x:
Gene expression
- y:
Cell generation
- trend:
positive for incresing megs, negative for decreasing megs
- Return:
- bool:
If a gene is MEG
- velocity_inference(sd: scData, time: list = None, cutoff: float = 0.97, alpha: float = 0.05, target: str = 'x_normed', exact: bool = False)
Inference phylogenetic velocity
- Args:
- sd:
scData
- time:
if None, cell generation will be automatically calculated from phylo tree
- cutoff:
Only calculate genes with top ‘cutoff’ correlation
- alpha:
Significance level
- target:
which data to inference, ‘count’ for nb model or ‘x_normed’ for normal model
- exact:
True to use ‘is_meg’ function; False do not use
- Return:
sd.velocity