phylovelo.inference =================== .. py:module:: phylovelo.inference Classes ------- .. autoapisummary:: phylovelo.inference.InfMu Functions --------- .. autoapisummary:: phylovelo.inference.mle_zinb phylovelo.inference.mle_nb phylovelo.inference.mle_norm phylovelo.inference.mle_zinorm phylovelo.inference.lrtest phylovelo.inference.est_z phylovelo.inference.latenct_z_inference phylovelo.inference.is_meg phylovelo.inference.velocity_inference Module Contents --------------- .. py:function:: mle_zinb(data: list) Maximum likelihood estimation of ZINB distribution Args: data: Data Returns: tuple: (-loglikelihood, MLE) .. py:function:: mle_nb(data) Maximum likelihood estimation of NB distribution Args: data: Data Returns: tuple: (-loglikelihood, MLE) .. py:function:: mle_norm(data) Maximum likelihood estimation of Normal distribution Args: data: Data Returns: tuple: (-loglikelihood, MLE) .. py:function:: mle_zinorm(data) Maximum likelihood estimation of ZI-Normal distribution Args: data: Data Returns: tuple: (-loglikelihood, MLE) .. py:function:: 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) .. py:function:: est_z(x: ndarray, alpha: float, mu0: float, sigma2: float, model: str) Estimation of latent expression z .. py:class:: InfMu(time, paras) Inference mean of z at time t .. py:attribute:: slope .. py:attribute:: inte .. py:attribute:: sigma2 .. py:method:: get_mu(t) .. py:function:: latenct_z_inference(data: list, time: int, model: str) Inference latent expression z at time t in given model .. py:function:: 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 .. py:function:: 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