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, ...)
# S3 method for Seurat
FetchData(
object,
vars,
cells = NULL,
layer = NULL,
clean = TRUE,
slot = deprecated(),
...
)
An object
Arguments passed to other methods
List of all variables to fetch, use keyword “ident” to pull identity classes
Cells to collect data for (default is all cells)
Layer to pull feature data for
Remove cells that are missing data; choose from:
“all
”: consider all columns for cleaning
“ident
”: consider all columns except the identity
class for cleaning
“project
”: consider all columns except the identity
class for cleaning; fill missing identity values with the object's project
“none
”: do not clean
Passing TRUE
is a shortcut for “ident
”; passing
FALSE
is a shortcut for “none
”
Deprecated in favor of layer
A data frame with cells as rows and cellular data as columns
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