omicverse.pp.umap#
- omicverse.pp.umap(adata, *, min_dist=0.5, spread=1.0, n_components=2, maxiter=None, alpha=1.0, gamma=1.0, negative_sample_rate=5, init_pos=None, random_state=0, a=None, b=None, method=None, key_added=None, neighbors_key='neighbors', copy=False, **kwargs)[source]#
Compute UMAP embedding, dispatching to the best backend for
ov.settings.mode.- Parameters:
adata – Annotated data matrix; neighbors must already be computed.
min_dist (
float(default:0.5)) – Minimum distance between embedded points. Default0.5matches scanpy; smaller gives more densely packed clusters.spread (
float(default:1.0)) – Scale at which embedded points are spread out.n_components (
int(default:2)) – Output dimensions (2 for typical visualisation).maxiter (
int|None(default:None)) – Number of edge-SGD passes. Defaults are backend-specific — scanpy uses 200 for N>10k, 500 otherwise.alpha (
float(default:1.0)) – Initial learning rate of the edge-SGD optimiser. Only used by non-parametric backends.gamma (
float(default:1.0)) – Weighting for negative samples. Default1.0matches scanpy.negative_sample_rate (
int(default:5)) – Number of negative samples per positive edge. Default5.init_pos (default:
None) – Embedding initialisation:'paga','spectral','random', or anndarray.Nonelets the backend pick.random_state (default:
0) – Seed for reproducibility.a (
float|None(default:None)) – UMAP curve parameters.Nonederives them fromspread+min_distviaumap.umap_.find_ab_params.b (
float|None(default:None)) – UMAP curve parameters.Nonederives them fromspread+min_distviaumap.umap_.find_ab_params.method (
str|None(default:None)) – Explicit backend override, e.g.'umap'(scanpy/umap-learn),'pumap'(omicverse’s parametric GPU UMAP),'torchdr','mde','rapids'.Nonepicks the right default for the currentov.settings.mode.key_added (
str|None(default:None)) – Key under which to store results; default'X_umap'/'umap'.neighbors_key (
str(default:'neighbors')) –.unskey holding the precomputed neighbor graph.copy (
bool(default:False)) – Return a new AnnData instead of modifying in place.**kwargs – Forwarded to the underlying backend (
_umap.umap,rapids_singlecell.tl.umapetc.).
Notes
Behaviour by
ov.settings.mode:'cpu'— scanpy / umap-learn (CPU).'cpu-gpu-mixed'— parametric UMAP on GPU (pumap).- anything else (
'gpu') — RAPIDS if available, falls back to pumap on import error.
- anything else (