phylovelo.inference

Classes

InfMu

Inference mean of z at time t

Functions

mle_zinb(data)

Maximum likelihood estimation of ZINB distribution

mle_nb(data)

Maximum likelihood estimation of NB distribution

mle_norm(data)

Maximum likelihood estimation of Normal distribution

mle_zinorm(data)

Maximum likelihood estimation of ZI-Normal distribution

lrtest(lh1, lh0, n, alpha)

Likelihood ratio test

est_z(x, alpha, mu0, sigma2, model)

Estimation of latent expression z

latenct_z_inference(data, time, model)

Inference latent expression z at time t in given model

is_meg(x, y[, trend])

Determine whether a gene is meg

velocity_inference(sd[, time, cutoff, alpha, target, ...])

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

class InfMu(time, paras)

Inference mean of z at time t

slope
inte
sigma2
get_mu(t)
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