umap
Short Description
sm.tl.umap
: This function enables dimensionality reduction on high-dimensional
datasets using UMAP, allowing for the visualization of complex data structures
in a lower-dimensional space. It supports customization through various parameters,
including data source selection, logarithmic transformation, and manifold
approximation settings, accommodating a wide range of analytical needs. Results
are stored in adata.obsm
, ready for subsequent visualization or analysis.
Function
umap(adata, use_layer=None, use_raw=False, log=False, n_neighbors=15, n_components=2, metric='euclidean', min_dist=0.1, random_state=0, label='umap', **kwargs)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
Annotated data matrix or path to an AnnData object, containing spatial gene expression data. |
required |
use_layer |
str
|
Specifies a layer in |
None
|
use_raw |
bool
|
Whether to use |
False
|
log |
bool
|
Applies natural log transformation to the data if |
False
|
n_neighbors |
int
|
Number of neighboring points used in manifold approximation. |
15
|
n_components |
int
|
Dimensionality of the target embedding space. |
2
|
metric |
str
|
Metric used to compute distances in high-dimensional space. |
'euclidean'
|
min_dist |
float
|
Effective minimum distance between embedded points. |
0.1
|
random_state |
int
|
Seed used by the random number generator for reproducibility. |
0
|
label |
str
|
Key for storing UMAP results in |
'umap'
|
Returns:
Name | Type | Description |
---|---|---|
adata |
AnnData
|
The input |
Example
1 2 3 4 5 6 7 8 9 10 11 |
|
Source code in scimap/tools/umap.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|