Create a DimReduc object

CreateDimReducObject(
  embeddings = new(Class = "matrix"),
  loadings = new(Class = "matrix"),
  projected = new(Class = "matrix"),
  assay = NULL,
  stdev = numeric(),
  key = NULL,
  global = FALSE,
  jackstraw = NULL,
  misc = list()
)

Arguments

embeddings

A matrix with the cell embeddings

loadings

A matrix with the feature loadings

projected

A matrix with the projected feature loadings

assay

Assay used to calculate this dimensional reduction

stdev

Standard deviation (if applicable) for the dimensional reduction

key

A character string to facilitate looking up features from a specific DimReduc

global

Specify this as a global reduction (useful for visualizations)

jackstraw

Results from the JackStraw function

misc

list for the user to store any additional information associated with the dimensional reduction

Value

A DimReduc object

See also

Dimensional reduction object, validity, and interaction methods DimReduc-class, DimReduc-validity, [.DimReduc(), [[.DimReduc(), dim.DimReduc(), merge.DimReduc(), print.DimReduc(), subset.DimReduc()

Examples

data <- GetAssayData(pbmc_small[["RNA"]], slot = "scale.data")
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#>  Please use the `layer` argument instead.
pcs <- prcomp(x = data)
pca.dr <- CreateDimReducObject(
  embeddings = pcs$rotation,
  loadings = pcs$x,
  stdev = pcs$sdev,
  key = "PC",
  assay = "RNA"
)
#> Warning: Keys should be one or more alphanumeric characters followed by an underscore, setting key from PC to PC_