omicverse.micro.Alpha

omicverse.micro.Alpha#

class omicverse.micro.Alpha(adata, rarefy_depth=None, seed=0)[源代码]#

Compute and store per-sample alpha-diversity metrics on adata.obs.

参数:
  • adata (AnnData) – Samples × features AnnData with int counts. The class does NOT modify X; pass rarefy_depth if you want rarefaction applied only for the diversity calculation.

  • rarefy_depth (Optional[int] (default: None)) – If set, subsample to this depth (without replacement) before computing each metric. None → use raw counts.

  • seed (int (default: 0)) – Random seed for rarefaction.

__init__(adata, rarefy_depth=None, seed=0)[源代码]#

Methods

__init__(adata[, rarefy_depth, seed])

observed()

Per-sample observed-OTU count.

run([metrics, write_to_obs, tree_key])

Compute the requested alpha metrics.

shannon()

Per-sample Shannon entropy.