使用工具:R语言,CellChat
我是参考该帖子来做的:https://www.jianshu.com/p/7128c64f8cf4
本篇对该帖子的一些bug做补充,以及谈谈对分析结果的理解
备注:
在安装CellChat时,需要在python装一个包,而且还要在R用biocManager先装两个包‘BiocNeighbors’和‘ComplexHeatmap’。
问题1
这个帖子可能因为版本的原因有些地方出错了,第一个问题是CellChat不支持V5版本,需要转成V3版本的seurat对象
#V5转V3
scedata[['RNA']]<-as(object = scedata[['RNA']], Class = 'Assay') #scedata是你的seurat对象
问题2
在选择cellchatDB时,要输入正确的数据库名称,这个帖子的示例有个地方没大写,会导致下一步报错:
Error in identifyOverExpressedGenes(cellchat) :
Please check `object@data.signaling` and ensure that you have run `subsetData` and that the data matrix `object@data.signaling` looks OK.
正确的数据库名称可以用这个代码看,以及正确选择cellchatDB的代码如下所示:
##加载设定需要的cellchat数据库
CellChatDB <- CellChatDB.human #human
#显示cellchat数据库名称
showDatabaseCategory(CellChatDB)
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling") # use Secreted Signaling for cell-cell communication analysis(原帖子就是在这里写错大小写害我浪费不少时间)
cellchat@DB <- CellChatDB.use # set the used database in the object
#直