View source: R/Seurat-function.R
RunLargeVis | R Documentation |
Run LargeVis (Dimensionality Reduction with a LargeVis-like method)
RunLargeVis(object, ...)
## S3 method for class 'Seurat'
RunLargeVis(
object,
reduction = "pca",
dims = NULL,
features = NULL,
assay = NULL,
slot = "data",
perplexity = 50,
n_neighbors = perplexity * 3,
n_components = 2,
metric = "euclidean",
n_epochs = -1,
learning_rate = 1,
scale = "maxabs",
init = "lvrandom",
init_sdev = NULL,
repulsion_strength = 7,
negative_sample_rate = 5,
nn_method = NULL,
n_trees = 50,
search_k = 2 * n_neighbors * n_trees,
n_threads = NULL,
n_sgd_threads = 0,
grain_size = 1,
kernel = "gauss",
pca = NULL,
pca_center = TRUE,
pcg_rand = TRUE,
fast_sgd = FALSE,
batch = FALSE,
opt_args = NULL,
epoch_callback = NULL,
pca_method = NULL,
reduction.name = "largevis",
reduction.key = "LargeVis_",
verbose = TRUE,
seed.use = 11L,
...
)
## Default S3 method:
RunLargeVis(
object,
assay = NULL,
perplexity = 50,
n_neighbors = perplexity * 3,
n_components = 2,
metric = "euclidean",
n_epochs = -1,
learning_rate = 1,
scale = "maxabs",
init = "lvrandom",
init_sdev = NULL,
repulsion_strength = 7,
negative_sample_rate = 5,
nn_method = NULL,
n_trees = 50,
search_k = 2 * n_neighbors * n_trees,
n_threads = NULL,
n_sgd_threads = 0,
grain_size = 1,
kernel = "gauss",
pca = NULL,
pca_center = TRUE,
pcg_rand = TRUE,
fast_sgd = FALSE,
batch = FALSE,
opt_args = NULL,
epoch_callback = NULL,
pca_method = NULL,
reduction.key = "LargeVis_",
verbose = TRUE,
seed.use = 11L,
...
)
object |
An object. This can be a Seurat object or a matrix-like object. |
... |
Additional arguments to be passed to the lvish function. |
reduction |
A character string specifying the reduction to be used. Default is "pca". |
dims |
An integer vector specifying the dimensions to be used. Default is NULL. |
features |
A character vector specifying the features to be used. Default is NULL. |
assay |
A character string specifying the assay to be used. Default is NULL. |
slot |
A character string specifying the slot name to be used. Default is "data". |
perplexity |
Controls the size of the local neighborhood used for
manifold approximation. This is the analogous to |
n_neighbors |
The number of neighbors to use when calculating the
|
n_components |
An integer specifying the number of LargeVis components. Default is 2. |
metric |
Type of distance metric to use to find nearest neighbors. One of:
Only applies if If Each metric calculation results in a separate fuzzy simplicial set, which are intersected together to produce the final set. Metric names can be repeated. Because non-numeric columns are removed from the data frame, it is safer to use column names than integer ids. Factor columns can also be used by specifying the metric name
For a given data block, you may override the |
n_epochs |
Number of epochs to use during the optimization of the
embedded coordinates. The default is calculate the number of epochs
dynamically based on dataset size, to give the same number of edge samples
as the LargeVis defaults. This is usually substantially larger than the
UMAP defaults. If |
learning_rate |
Initial learning rate used in optimization of the coordinates. |
scale |
Scaling to apply to
For lvish, the default is |
init |
Type of initialization for the coordinates. Options are:
For spectral initializations, ( |
init_sdev |
If non- |
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 edge/1-simplex samples to use per positive edge/1-simplex sample in optimizing the low dimensional embedding. |
nn_method |
Method for finding nearest neighbors. Options are:
By default, if
Multiple nearest neighbor data (e.g. from two different precomputed
metrics) can be passed by passing a list containing the nearest neighbor
data lists as items.
The |
n_trees |
Number of trees to build when constructing the nearest
neighbor index. The more trees specified, the larger the index, but the
better the results. With |
search_k |
Number of nodes to search during the neighbor retrieval. The
larger k, the more the accurate results, but the longer the search takes.
With |
n_threads |
Number of threads to use (except during stochastic gradient
descent). Default is half the number of concurrent threads supported by the
system. For nearest neighbor search, only applies if
|
n_sgd_threads |
Number of threads to use during stochastic gradient
descent. If set to > 1, then be aware that if |
grain_size |
The minimum amount of work to do on each thread. If this
value is set high enough, then less than |
kernel |
Type of kernel function to create input probabilities. Can be
one of |
pca |
If set to a positive integer value, reduce data to this number of
columns using PCA. Doesn't applied if the distance |
pca_center |
If |
pcg_rand |
If |
fast_sgd |
If |
batch |
If |
opt_args |
A list of optimizer parameters, used when
|
epoch_callback |
A function which will be invoked at the end of every
epoch. Its signature should be:
|
pca_method |
Method to carry out any PCA dimensionality reduction when the pca parameter is specified. Allowed values are: "irlba", "rsvd", "bigstatsr", "svd", "auto"(the default. Uses "irlba", unless more than 50 case "svd" is used.) |
reduction.name |
A character string specifying the name of the reduction to be stored in the Seurat object. Default is "largevis". |
reduction.key |
A character string specifying the prefix for the column names of the LargeVis embeddings. Default is "LargeVis_". |
verbose |
A logical value indicating whether to print verbose output. Default is TRUE. |
seed.use |
An integer specifying the random seed to be used. Default is 11. |
pancreas_sub <- Seurat::FindVariableFeatures(pancreas_sub)
pancreas_sub <- RunLargeVis(object = pancreas_sub, features = Seurat::VariableFeatures(pancreas_sub))
CellDimPlot(pancreas_sub, group.by = "CellType", reduction = "largevis")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.