提取某一基因的表达值到metadata中
expr <- sce@assays$RNA@scale.data
gene_name <- c("CXCL10") # CXCL10, 这里需要修改为目标基因
gene_expression <- expr %>%
.[gene_name,] %>%
#t() %>%
as.data.frame()
colnames(gene_expression) <- paste0(gene_name)
identical(colnames(sce),row.names(gene_expression))
sce$CXCL10 <- gene_expression[,paste0(gene_name)] # CXCL10, 这里需要修改为目标基因
identical(sce@meta.data[,paste0(gene_name)],gene_expression[,paste0(gene_name)])
meta <- sce@meta.data