tomas.fit.dmn

tomas.fit.dmn(adata, groupby, groups='all', tol=0.001, maxiter=1000, subset=None, verbose=2, verbose_interval=10)

Fit Dirichlet-Multinomial distribution with UMI counts of homo-droplet populations.

Parameters:
  • adata (AnnData) – The (annotated) UMI count matrix of shape n_obs × n_vars. Rows correspond to droplets and columns to genes.

  • groupby (str) – The key of the droplet categories stored in adata.obs.

  • groups (list of strings, optional) – Droplet categories to which DMN model shoudl be fitted with. It should be eithor ‘all’ or a list of cell type annotations specified in adata.obs[groupby]. The default is ‘all’.

  • tol (float, optional) – The convergence threshold. The iteration will stop when the likelihood gain is below this threshold. The default is 1e-3.

  • maxiter (int, optional) – The maximal number of iteration. The default is 1000.

  • subset (int, optional) – Number of downsampled droplets to fit DMN. It is only recommended when you have excessive droplet numbers for homotypic droplet populations. The default is None.

  • verbose (int, optional) – Enable verbose output. If 1 then it prints the current initialization and each iteration step. If greater than 1 then it prints also the log probability and time needed for each step. The default is 2.

  • verbose_interval (int, optional) – Number of iteration done before the next print. The default is 10.

Returns:

  • None.

  • The optimized alpha vectors for each kind of droplet population is stroed in adata.varm[‘para_diri’].