前言
Immugent在前一期推文:CommPath:细胞通讯分析的百宝箱中,已经介绍了CommPath包的基本功能框架,并且对比了CommPath和其它用于细胞通讯分析软件的对比。那么从本期推文开始,Immugent就将通过代码实操的方式来介绍CommPath包的使用技巧。
在使用CommPath包之前,我们需要准备相应的输入文件,一般是选择高变基因的表达矩阵和细胞注释信息作为输入。为了方便大家复现,Immugent在教程中使用的数据均是同一套模拟数据。
代码流程
第一步,安装CommPath包和导入数据。
devtools::install_github("yingyonghui/CommPath")
library(CommPath)
# load(url("https://figshare.com/ndownloader/files/35185522"))
load("path_to_download/HCC.tumor.3k.RData")
第二步,创建CommPath对象,鉴定差异信号
tumor.obj <- createCommPath(expr.mat = tumor.expr,
cell.info = tumor.label,
species = "hsapiens")
tumor.obj <- findLRmarker(object = tumor.obj, method = "wilcox.test")
# To find significant LR pairs
tumor.obj <- findLRpairs(object = tumor.obj,
logFC.thre = 0,
p.thre = 0.01)
第三步,可视化。
# To show the counts of LR associations among all clusters
# Here we set the parameter "filter" as FALSE, which means that those LR interactions are identified only based on their expression profiles, not filtered by pathways in the receiver cells (as described in the later sections)
pdf('circosPlot.count.nonfiltered.pdf',height=6,width=6)
circosPlot(object = tumor.obj, filter=FALSE)
dev.off()
image.png
# To show the overall interaction intensity of LR interactions among all clusters
pdf('circosPlot.intensity.nonfiltered.pdf',height=6,width=6)
circosPlot(object = tumor.obj, plot="intensity", filter=FALSE)
dev.off()
image.png
展示特殊细胞类型的信号。
select.ident = 'Endothelial'
pdf('circosPlot.Endothelial.count.filtered.pdf',height=6,width=6)
circosPlot(object = tumor.obj, select.ident = select.ident, filter=TRUE)
dev.off()
image.png
展示特殊的细胞信号。
# To find upstream clusters and ligands for the selected cluster and receptor
select.ident = "Endothelial"
select.receptor = "ACKR1"
ident.up.dat <- findLigand(object = tumor.obj,
select.ident = select.ident,
select.receptor = select.receptor)
head(ident.up.dat)
# To find downstream clusters and receptors for the selected cluster and ligand
select.ident = "Endothelial"
select.ligand = "CXCL12"
ident.down.dat <- findReceptor(object = tumor.obj,
select.ident = select.ident,
select.ligand = select.ligand)
head(ident.down.dat)
# To investigate the upstream clusters which release ligands to the selected cluster
pdf('dotPlot.ligand.Endothelial.pdf',height=5,width=10)
dotPlot.LR(object = tumor.obj, receptor.ident = select.ident)
dev.off()
image.png
# To investigate the downstream clusters which express receptors for the selected cluster
pdf('dotPlot.receptor.Endothelial.pdf',height=5,width=10.5)
dotPlot.LR(object = tumor.obj, ligand.ident = select.ident)
dev.off()
image.png
说在最后
生物信息学作为目前在生命科学领域最活跃的领域之一,为我们提供了不断迭代更新的强大工具。从上面的分析结果,我们就可以看出CommPath包对之前细胞通讯分析存在的问题进行了优化。这包括在计算差异信号通路,以及差异通路的个性化展示上均有所体现。当然,本期内容只是对CommPath包最基础的功能进行展示,后续还会介绍如何将这些通路和功能通路相关联。
好啦,本期分享到这里就结束了,我们下期再会~~
网友评论