Given a SeuratObject created from a 10X file, pbmc, how can I access the expression values across ALL features for a particular cell? I know I can access the cell names with rownames(pbmc@meta.data) and the matrix with GetAssayData(object = pbmc, slot = "counts"), but I'm really confused as to how to index the matrix such that I can extract a column/row from it. (I am not sure if the data I want is a row or column in the matrix - I believe it is a column).
1 answer
The column names of the output from GetAssayData will be the cell UMIs, so one way you can select the counts for a single cell would be:
cell_umi <- "AAACCCACAATCTCGA"
counts <- Seurat::GetAssayData(scrna_object)
cell_counts <- counts[, cell_umi]
You can also use Seurat::subset with the cells parameter to subset your Seurat object to a specific cell or subset of cells via cell UMIs.
Log in to answer this question.