Creates a Seurat object containing only a subset of the cells in the original object. Takes either a list of cells to use as a subset, or a parameter (for example, a gene), to subset on.
SubsetData(object, cells.use = NULL, subset.name = NULL, ident.use = NULL,
ident.remove = NULL, accept.low = -Inf, accept.high = Inf,
accept.value = NULL, do.center = FALSE, do.scale = FALSE,
max.cells.per.ident = Inf, random.seed = 1, do.clean = FALSE,
subset.raw, ...)
Seurat object
A vector of cell names to use as a subset. If NULL (default), then this list will be computed based on the next three arguments. Otherwise, will return an object consissting only of these cells
Parameter to subset on. Eg, the name of a gene, PC1, a column name in object@meta.data, etc. Any argument that can be retreived using FetchData
Create a cell subset based on the provided identity classes
Subtract out cells from these identity classes (used for filtration)
Low cutoff for the parameter (default is -Inf)
High cutoff for the parameter (default is Inf)
Returns cells with the subset name equal to this value
Recenter the new object@scale.data
Rescale the new object@scale.data. FALSE by default
Can be used to downsample the data to a certain max per cell ident. Default is INF.
Random seed for downsampling
Only keep object@raw.data and object@data. Cleans out most other slots. Can be useful if you want to start a fresh analysis on just a subset of the data. Also clears out stored clustering results in object@meta.data (any columns containing "res"). Will by default subset the raw.data slot.
Also subset object@raw.data
Additional arguments to be passed to FetchData (for example, use.imputed=TRUE)
Returns a Seurat object containing only the relevant subset of cells
# NOT RUN {
pbmc1 <- SubsetData(object = pbmc_small, cells.use = pbmc_small@cell.names[1:40])
pbmc1
# }
Run the code above in your browser using DataLab