omicverse.pp.louvain#
- omicverse.pp.louvain(adata, resolution=None, *, random_state=0, key_added='louvain', neighbors_key=None, directed=True, use_weights=False, copy=False, **kwargs)[source]#
Run Louvain clustering on the precomputed kNN graph.
- Parameters:
adata (anndata.AnnData) – AnnData object with a neighborhood graph already computed.
resolution (default:
None) – Resolution γ; higher values yield more, smaller clusters.random_state (default:
0) – Seed for reproducibility.key_added (default:
'louvain') – Column inadata.obsto store labels. Default'louvain'.neighbors_key (default:
None) – Key inadata.unsfor the neighbor dict.Noneuses the standard'neighbors'slot.directed (default:
True) – Forwarded to the igraph backend; rarely need tuning.use_weights (default:
False) – Forwarded to the igraph backend; rarely need tuning.copy (default:
False) – Return a new AnnData instead of modifying in place.**kwargs – Forwarded to the underlying backend (
scanpy.tl.louvainorrapids_singlecell.tl.louvain).
Notes
In
ov.settings.mode='cpu-gpu-mixed'this is auto-routed toov.pp.leiden(Louvain has no GPU backend and Leiden is its strict improvement). Labels are still written toadata.obs[key_added]so existing notebooks keep working.