解决新冠数据线粒体问题
正常情况下,基因都是下面这张图展示的,当时有些数据会在基因前面加个前缀,例如上面图的 "GRCh38premrna-" ,所以在计算线粒体比例的时候 MT 就识别不到。按照下面的代码修改就好了。
library(tidyverse)
rownames(Covid_1@assays$RNA$counts)
rownames(Covid_1@assays$RNA$counts) %>% str_remove_all("-.*")
rownames(Covid_1@assays$RNA$counts) %>% str_remove_all("-.*") %>% unique()
counts <- Covid_1@assays$RNA$counts
rownames(counts) <- rownames(counts) %>% str_remove_all("GRCh38premrna-") #这里修改
counts
Covid.1 <- Seurat::CreateSeuratObject(counts = counts,min.cells = 3,min.features = 200)
Covid.1
PercentageFeatureSet(Covid.1,pattern = "^MT")
Covid.1[["percent.mt"]]<-PercentageFeatureSet(Covid.1,pattern = "^MT")
Covid.1@meta.data %>% head()
Covid.1 <- Seurat::CreateSeuratObject(counts = counts,min.cells = 3,min.features = 200,project = "Covid_1")
Covid.1[["percent.mt"]]<-PercentageFeatureSet(Covid.1,pattern = "^MT")
Covid.1@meta.data %>% head()
VlnPlot(Covid.1, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)