Wrapper function for Giotto dimension reduction methods for easier coding.

reduceDims(
  gobject,
  method = c("pca", "nmf", "umap", "tsne"),
  projection = FALSE,
  toplevel = 1L,
  ...
)

Arguments

gobject

giotto object

method

character. Dimension reduction method to use

projection

logical. Whether to run in a projection manner (faster, but is an approximation)

toplevel

relative stackframe the call was made at. do not use.

...

additional params to pass to specific functions

Value

`giotto` object with attached dimension reduction

Examples

g <- GiottoData::loadGiottoMini("vis")
#> Error in match.arg(dataset, choices = c(names(mini_gobject_manifest))): 'arg' should be one of “visium”, “visium_multisample”, “vizgen”, “cosmx”, “seqfish”, “starmap”, “spatialgenomics”
x <- reduceDims(g, "tsne", spat_unit = "cell")
#> Error: object 'g' not found
x <- reduceDims(x, "umap", projection = TRUE)
#> Error: object 'x' not found
x <- reduceDims(x, method = "nmf")
#> Error: object 'x' not found