Retrieves data (feature expression, PCA scores, metrics, etc.) for a set of cells in a Seurat object

FetchData(object, ...)

# S3 method for DimReduc
FetchData(
  object,
  vars,
  cells = NULL,
  slot = c("embeddings", "loadings", "projected"),
  ...
)

# S3 method for Seurat
FetchData(object, vars, cells = NULL, slot = "data", ...)

Arguments

object

An object

...

Arguments passed to other methods

vars

List of all variables to fetch, use keyword “ident” to pull identity classes

cells

Cells to collect data for (default is all cells)

slot

Slot to pull feature data for

Value

A data frame with cells as rows and cellular data as columns

Examples

pc1 <- FetchData(object = pbmc_small, vars = 'PC_1')
head(x = pc1)
#>                       PC_1
#> ATGCCAGAACGACT -0.77403708
#> CATGGCCTGTGCAT -0.02602702
#> GAACCTGATGAACC -0.45650250
#> TGACTGGATTCTCA -0.81163243
#> AGTCAGACTGCACA -0.77403708
#> TCTGATACACGTGT -0.77403708
head(x = FetchData(object = pbmc_small, vars = c('groups', 'ident')))
#>                groups ident
#> ATGCCAGAACGACT     g2     0
#> CATGGCCTGTGCAT     g1     0
#> GAACCTGATGAACC     g2     0
#> TGACTGGATTCTCA     g2     0
#> AGTCAGACTGCACA     g2     0
#> TCTGATACACGTGT     g1     0