scHCL || 鑑定人的單細胞數據細胞類型

install.packages('devtools')
library(devtools)
# scHCL requires ggplot2/reshape2/plotly/shiny/shinythemes/shiny
install_github("ggjlab/scHCL")
#示例數據
library(scHCL)
# hcl_lung is an example expression matrix from HCL project.
data(hcl_lung)
dim(hcl_lung)
#[1] 2884   80
## 2884 genes expression value of 80 cells

# scHCL has two parameters , single cell expression matrix(scdata) and 
# the number of most similar cell types
 hcl_result <- scHCL(scdata = hcl_lung, numbers_plot = 3)

以自己的seurat對象的分羣來鑑定細胞類羣

CM.mt<-cbind(as.data.frame([email protected]$seurat_clusters),as.matrix(t(GetAssayData(seurat.object,slot = "data"))))
colnames(CM.mt)[1]<-"cluster"
CM.mt<-aggregate(.~cluster,CM.mt,mean)
rownames(CM.mt)<-CM.mt$cluster
CM.mt<-CM.mt[,-1]
CM.mt<-t(CM.mt)
hcl_result <- scHCL(scdata = CM.mt, numbers_plot = 3)
head(hcl_result$scHCL_probility,15)

參考:https://github.com/ggjlab/scHCL

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章