Description Usage Arguments Value References Examples
Runs the Uniform Manifold Approximation and Projection (UMAP) dimensional
reduction technique. To run, you must first install the umap-learn python
package (e.g. via pip install umap-learn
). Details on this package can be
found here: https://github.com/lmcinnes/umap. For a more in depth
discussion of the mathematics underlying UMAP, see the ArXiv paper here:
https://arxiv.org/abs/1802.03426.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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 | RunUMAP(object, ...)
## Default S3 method:
RunUMAP(
object,
assay = NULL,
n.neighbors = 30L,
n.components = 2L,
metric = "cosine",
n.epochs = NULL,
learning.rate = 1,
min.dist = 0.3,
spread = 1,
set.op.mix.ratio = 1,
local.connectivity = 1L,
repulsion.strength = 1,
negative.sample.rate = 5,
a = NULL,
b = NULL,
uwot.sgd = FALSE,
seed.use = 42,
metric.kwds = NULL,
angular.rp.forest = FALSE,
reduction.key = "UMAP_",
verbose = TRUE,
...
)
## S3 method for class 'Seurat'
RunUMAP(
object,
dims = NULL,
reduction = "pca",
features = NULL,
graph = NULL,
assay = "RNA",
n.neighbors = 30L,
n.components = 2L,
metric = "cosine",
n.epochs = NULL,
learning.rate = 1,
min.dist = 0.3,
spread = 1,
set.op.mix.ratio = 1,
local.connectivity = 1L,
repulsion.strength = 1,
negative.sample.rate = 5L,
a = NULL,
b = NULL,
uwot.sgd = FALSE,
seed.use = 42L,
metric.kwds = NULL,
angular.rp.forest = FALSE,
verbose = TRUE,
reduction.name = "umap",
reduction.key = "UMAP_",
...
)
|
object |
An object |
... |
Arguments passed to other methods and UMAP |
assay |
Assay to pull data for when using |
n.neighbors |
This determines the number of neighboring points used in local approximations of manifold structure. Larger values will result in more global structure being preserved at the loss of detailed local structure. In general this parameter should often be in the range 5 to 50. |
n.components |
The dimension of the space to embed into. |
metric |
metric: This determines the choice of metric used to measure distance in the input space. A wide variety of metrics are already coded, and a user defined function can be passed as long as it has been JITd by numba. |
n.epochs |
he number of training epochs to be used in optimizing the low dimensional embedding. Larger values result in more accurate embeddings. If NULL is specified, a value will be selected based on the size of the input dataset (200 for large datasets, 500 for small). |
learning.rate |
The initial learning rate for the embedding optimization. |
min.dist |
This controls how tightly the embedding is allowed compress points together. Larger values ensure embedded points are moreevenly distributed, while smaller values allow the algorithm to optimise more accurately with regard to local structure. Sensible values are in the range 0.001 to 0.5. |
spread |
The effective scale of embedded points. In combination with min.dist this determines how clustered/clumped the embedded points are. |
set.op.mix.ratio |
Interpolate between (fuzzy) union and intersection as the set operation used to combine local fuzzy simplicial sets to obtain a global fuzzy simplicial sets. Both fuzzy set operations use the product t-norm. The value of this parameter should be between 0.0 and 1.0; a value of 1.0 will use a pure fuzzy union, while 0.0 will use a pure fuzzy intersection. |
local.connectivity |
The local connectivity required - i.e. the number of nearest neighbors that should be assumed to be connected at a local level. The higher this value the more connected the manifold becomes locally. In practice this should be not more than the local intrinsic dimension of the manifold. |
repulsion.strength |
Weighting applied to negative samples in low dimensional embedding optimization. Values higher than one will result in greater weight being given to negative samples. |
negative.sample.rate |
The number of negative samples to select per positive sample in the optimization process. Increasing this value will result in greater repulsive force being applied, greater optimization cost, but slightly more accuracy. |
a |
More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor. |
b |
More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor. |
uwot.sgd |
Set |
seed.use |
Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed |
metric.kwds |
A dictionary of arguments to pass on to the metric, such as the p value for Minkowski distance. If NULL then no arguments are passed on. |
angular.rp.forest |
Whether to use an angular random projection forest to initialise the approximate nearest neighbor search. This can be faster, but is mostly on useful for metric that use an angular style distance such as cosine, correlation etc. In the case of those metrics angular forests will be chosen automatically. |
reduction.key |
dimensional reduction key, specifies the string before the number for the dimension names. UMAP by default |
verbose |
Controls verbosity |
dims |
Which dimensions to use as input features, used only if
|
reduction |
Which dimensional reduction (PCA or ICA) to use for the UMAP input. Default is PCA |
features |
If set, run UMAP on this subset of features (instead of running on a
set of reduced dimensions). Not set (NULL) by default; |
graph |
Name of graph on which to run UMAP |
reduction.name |
Name to store dimensional reduction under in the Seurat object |
Returns a Seurat object containing a UMAP representation
McInnes, L, Healy, J, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction, ArXiv e-prints 1802.03426, 2018
1 2 3 4 5 6 7 8 | ## Not run:
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.