scRNA-单细胞转录组学习笔记-23-多个基因集相关性热图
刘小泽写于19.9.6-第四单元第三讲:多个基因集相关性热图 笔记目的:根据生信技能树的单细胞转录组课程探索smart-seq2技术相关的分析技术 课程链接在:http://jm.grazy.cn/index/mulitcourse/detail.html?cid=53 基于前面的两节,这一节变得更容易理解
前言
文章正文还是以乳腺癌为例,绘制了6个数据集和两个亚型基因集之间的相关性
这次还是要对基因集进行操作,因此也是需要进行上一次的colMeans()
操作,只不过上次总共得到4个,这次是7个(因为下文将troma1和stroma2合并为一个stroma)
获取各个基因集的基因
一共5篇参考文献,需要将其中各个基因集拿出来:
library(stringr)
# vCAF基因集
vCAF='Esam, Gng11, Higd1b, Cox4i2, Cygb, Gja4, Eng'
vCAF=unlist(str_split(vCAF,', '))
# mCAF基因集
mCAF='Dcn, Col12a1, Mmp2, Lum, Mrc2, Bicc1, Lrrc15, Mfap5, Col3A1, Mmp14, Spon1, Pdgfrl, Serpinf1, Lrp1, Gfpt2, Ctsk, Cdh11, Itgbl1, Col6a2, Postn, Ccdc80, Lox, Vcan, Col1a1, Fbn1, Col1a2, Pdpn, Col6a1, Fstl1, Col5a2, Aebp1'
mCAF=unlist(str_split(mCAF,', '))
# ECM基因集
ECM=c('COL1A1', 'COL1A2','COL3A1')
# Endothelial基因集
endothelial=c('CDH5', 'DIPK2B','TIE1')
# for 参考文献ref32:proliferation 基因集
proliferation <- c("BAG1","ESR1","FOXA1","GPR160","NAT1","NAT1","MAPT","MLPH","PGR")
# for ref31: stroma-related 基因集
stroma <- c('DCN', 'CSPG2', 'CDH11', 'COL3A1', 'FAP', 'PEDF', 'FBN1', 'PDGFRL', 'CTSK', 'HTRA1', 'ASPN', 'SPARC', 'COL5A2', 'LOXL1', 'MMP2', 'SPON1', 'SFRP4', 'ITGBL1', 'CALD1', 'COPZ2', 'MFAP2', 'ANGPTL2', 'PLAU', 'COL1A2', 'LRRC17', 'C1QTNF3', 'SNAI2', 'PCOLCE', 'POSTN', 'ECM2', 'FBLN1', 'ADAM12', 'MMP11', 'AEBP1', 'PDGFRB', 'GAS1', 'COL6A3', 'RARRES2', 'COL6A1', 'TGFB3', 'NDN', 'C1R', 'LRP1', 'COL10A1', 'DPYSL3', 'OLFML2B', 'MMP14', 'DACT1', 'MGC3047', 'THBS2')
# for ref29: endothelial/microvasculature 基因集
microvasculature <- c('ARAP3','ADCY4','ESAM','ERG','SLC43A3','SOX7','PTPRB','PTPRM','AFAP1L1','MMRN2','TENC1','STARD9','COL4A3','LRRK1','PALD1','NPR3','ROBO4','NOTCH4','TIE1','RASIP1','ACVRL1','RAMP2','FAM110D','EGFL7','SMAD6','FGD5','ENG','CASKIN2','ACKR2','SLC9A3R2','CALCRL','HSPA12B','EPAS1','EHD4','LATS2','ICAM1','HBEGF','PLTP','C1orf54','CTTNBP2NL','MYO1B','SLCO2A1','KIFC1','EPHB4','SOX13','DRAM1','PECAM1','ENTPD1','ICAM2','CLDN5','SDPR','CDH5','GPR116','ELTD1','KDR','HILPDA','NPNT')
然后得到7个基因集的表达量
# 读入数据TCGA-BRCA.htseq_counts.tsv.gz
library(data.table)
filepath <- file.choose()
a=fread(filepath ,data.table=F)
# Ensembl ID切割
library(stringr)
esid=str_split(a$Ensembl_ID,
'[.]',simplify = T)[,1]
# ID转换
e2s=select(org.Hs.eg.db,keys = esid,columns = c( "ENSEMBL" , "SYMBOL" ),keytype = 'ENSEMBL')
vCAF=toupper(vCAF);vCAF=vCAF[vCAF %in% e2s$SYMBOL,]
mCAF=toupper(mCAF);mCAF=mCAF[mCAF %in% e2s$SYMBOL,]
# 获得表达量
rownames(a)=esid
a=a[,-1]
# vCAF
ng=e2s[match(vCAF,e2s$SYMBOL),1]
vCAF_value=colMeans(a[ng,])
# mCAF
ng=e2s[match(mCAF,e2s$SYMBOL),1]
mCAF_value=colMeans(a[ng,])
# ECM
ng=e2s[match(ECM,e2s$SYMBOL),1]
ECM_value=colMeans(a[ng,])
# Endothelial
ng=e2s[match(endothelial,e2s$SYMBOL),1]
endothelial_value=colMeans(a[ng,])
# proliferation(注意这里加上了检测基因名是否存在的代码)
ng=e2s[match(proliferation,e2s$SYMBOL),1];ng=ng[!is.na(ng)];ng
proliferation_value=colMeans(a[ng,])
# stroma
ng=e2s[match(stroma,e2s$SYMBOL),1];ng=ng[!is.na(ng)];ng
stroma_value=colMeans(a[ng,])
# microvasculature
ng=e2s[match(microvasculature,e2s$SYMBOL),1];ng=ng[!is.na(ng)];ng
microvasculature_value=colMeans(a[ng,])
dat=data.frame(vCAF=vCAF_value,
mCAF=mCAF_value,
ECM=ECM_value,
endothelial=endothelial_value,
microvasculature=microvasculature_value,
stroma=stroma_value,
proliferation=proliferation_value)
> dat[1:4,1:4]
vCAF mCAF ECM endothelial
TCGA-A1-A0SP-01A 8.794181 13.07456 17.13670 9.990037
TCGA-BH-A201-01A 9.549604 14.86951 19.40557 10.895579
TCGA-E2-A14T-01A 9.600401 13.33230 17.61368 10.475556
TCGA-AC-A8OS-01A 9.998759 14.07297 19.24798 11.932741
最后做相关性热图
M=cor(dat)
pheatmap::pheatmap(M)
从图中得知(同样也是作者想要证明的),vCAF和mCAF能够分开,并且它们各有特性。比如可以看到mCAF与ECM、stroma更像;而vCAF与microvasculature更像;另外vCAF和mCAF都与proliferation都不相关
总而言之,做这些就是想说明这几个分群的生物学意义的