Seurat中的数据对象
最后发布时间:2022-02-28 10:59:29
浏览量:
获取feature(gene)的count值
as.data.frame(thymus.combined.filter@assays$RNA@counts[,] )[c("CD8A","CD8B"),1:3]
GetAssayData(object = thymus.combined.filter,
assay = "RNA", slot = "counts")[c("CD8A","CD8B"), ]
addMeta <- function(obj,genes){
for(gene in genes){
count <- GetAssayData(object = thymus.combined.filter,
assay = "RNA", slot = "counts")[gene, ]
obj <- AddMetaData(obj,count,gene)
}
obj
}
test <- addMeta(thymus.combined.filter,c("CD8A","CD8B"))
test@meta.data[1:3,]