Description Usage Arguments Details Value Examples
View source: R/dimension_reduction.R
run UMAP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | runUMAP(
gobject,
expression_values = c("normalized", "scaled", "custom"),
reduction = c("cells", "genes"),
dim_reduction_to_use = "pca",
dim_reduction_name = "pca",
dimensions_to_use = 1:10,
name = "umap",
genes_to_use = NULL,
return_gobject = TRUE,
n_neighbors = 40,
n_components = 2,
n_epochs = 400,
min_dist = 0.01,
n_threads = 1,
spread = 5,
set_seed = T,
seed_number = 1234,
verbose = T,
...
)
|
gobject |
giotto object |
expression_values |
expression values to use |
reduction |
cells or genes |
dim_reduction_to_use |
use another dimension reduction set as input |
dim_reduction_name |
name of dimension reduction set to use |
dimensions_to_use |
number of dimensions to use as input |
name |
arbitrary name for UMAP run |
genes_to_use |
if dim_reduction_to_use = NULL, which genes to use |
return_gobject |
boolean: return giotto object (default = TRUE) |
n_neighbors |
UMAP param: number of neighbors |
n_components |
UMAP param: number of components |
n_epochs |
UMAP param: number of epochs |
min_dist |
UMAP param: minimum distance |
n_threads |
UMAP param: threads to use |
spread |
UMAP param: spread |
set_seed |
use of seed |
seed_number |
seed number to use |
verbose |
verbosity of function |
... |
additional UMAP parameters |
See umap
for more information about these and other parameters.
Input for UMAP dimension reduction can be another dimension reduction (default = 'pca')
To use gene expression as input set dim_reduction_to_use = NULL
If dim_reduction_to_use = NULL, genes_to_use can be used to select a column name of
highly variable genes (see calculateHVG
) or simply provide a vector of genes
multiple UMAP results can be stored by changing the name of the analysis
giotto object with updated UMAP dimension recuction
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 1. create giotto object
expr_path = system.file("extdata", "seqfish_field_expr.txt", package = 'Giotto')
loc_path = system.file("extdata", "seqfish_field_locs.txt", package = 'Giotto')
VC_small <- createGiottoObject(raw_exprs = expr_path, spatial_locs = loc_path)
# 2. normalize giotto
VC_small <- normalizeGiotto(gobject = VC_small, scalefactor = 6000)
VC_small <- addStatistics(gobject = VC_small)
# 3. dimension reduction
VC_small <- calculateHVG(gobject = VC_small)
VC_small <- runPCA(gobject = VC_small)
VC_small <- runUMAP(VC_small, dimensions_to_use = 1:5, n_threads = 2)
plotUMAP(gobject = VC_small)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.