| [[.Seurat {SeuratObject} | R Documentation |
Subobjects and Cell-Level Meta Data
Description
The [[ operator pulls either subobjects
(eg. v3 or v5 assays,
dimensional reduction information,
or nearest-neighbor graphs) or cell-level
meta data from a Seurat object
Usage
## S3 method for class 'Seurat'
x[[i = missing_arg(), ..., drop = FALSE, na.rm = FALSE]]
## S3 method for class 'Seurat'
head(x, n = 10L, ...)
## S3 method for class 'Seurat'
tail(x, n = 10L, ...)
Arguments
x |
A |
i |
Name of cell-level meta data |
... |
Ignored |
drop |
See |
na.rm |
Remove cells where meta data is all |
n |
Number of meta data rows to show |
Value
Varies based on the value of i:
If
iis missing, a data frame with cell-level meta dataIf
iis a vector with cell-level meta data names, a data frame (or vector ofdrop = TRUE) with cell-level meta data requestedIf
iis a one-length character with the name of a subobject, the subobject specified byi
head: The first n rows of cell-level metadata
tail: The last n rows of cell-level metadata
See Also
See here for adding meta data with [[<-,
here for adding subobjects with [[<-, and
here for removing subobjects and cell-level meta
data with [[<-
Seurat object, validity, and interaction methods
$.Seurat(),
Seurat-class,
Seurat-validity,
[[<-,Seurat,
[[<-,Seurat,NULL,
dim.Seurat(),
dimnames.Seurat(),
merge.Seurat(),
names.Seurat(),
subset.Seurat()
Examples
# Get the cell-level metadata data frame
head(pbmc_small[[]])
# Pull specific metadata information
head(pbmc_small[[c("letter.idents", "groups")]])
head(pbmc_small[["groups", drop = TRUE]])
# Get a sub-object (eg. an `Assay` or `DimReduc`)
pbmc_small[["RNA"]]
pbmc_small[["pca"]]
# Get the first 10 rows of cell-level metadata
head(pbmc_small)
# Get the last 10 rows of cell-level metadata
tail(pbmc_small)