msmu.tl.umap
Calculate UMAP embedding for a given modality in MuData object.
UMAP is described by McInnes et al. (2018).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
|
required |
modality
|
str
|
The modality to perform UMAP on. |
required |
n_components
|
int
|
The dimension of the space to embed into. This defaults to |
2
|
n_neighbors
|
int | None
|
The size of local neighborhood (in terms of number of neighboring sample points) used for manifold approximation. Larger values result in more global views of the manifold, while smaller values result in more local data being preserved. In general values should be in the range 2 to 100. |
15
|
layer
|
str | None
|
Layer to use for quantification aggregation. If |
None
|
metric
|
str
|
The metric to use to compute distances in high dimensional space.
If a string is passed it must match a valid predefined metric. If
a general metric is required a function that takes two 1d arrays and
returns a
Metrics that take arguments (such as |
'euclidean'
|
init
|
str
|
How to initialize the low dimensional embedding. Options are:
|
'random'
|
min_dist
|
float
|
The effective minimum distance between embedded points. Smaller values
will result in a more clustered/clumped embedding where nearby points
on the manifold are drawn closer together, while larger values will
result on a more even dispersal of points. The value should be set
relative to the |
0.1
|
random_state
|
int | None
|
|
None
|
key_added
|
str
|
Base key used for UMAP outputs. Results are stored in:
- |
'X_umap'
|
**kwargs
|
Any
|
Additional keyword arguments passed to the |
{}
|
Returns:
| Type | Description |
|---|---|
MuData
|
Updated |
References
McInnes, L., Healy, J., and Melville, J. UMAP: uniform manifold approximation and projection for dimension reduction. arXiv:1802.03426 (2018). https://doi.org/10.48550/arXiv.1802.03426.