这是“学习一个R包系列”第三篇文章
往期见:
学习一个R包——免疫浸润ABIS
学习一个R包——免疫浸润xCell
MCP-counter(Microenvironment Cell Populations-counter)包由Becht团队于2016年开发,原文题目为:Estimating the population abundance of tissue-infiltrating immune and stromal cell populations using gene expression
这是个很常用的包,在我们公众号中多次提到,目前已经被引用200+次。
本包可以利用转录组数据量化异质组织中8个免疫细胞和2个基质细胞的绝对丰度。作者在后续的答疑中说明,转录组数据必须归一化。该包放在了github上,网址为:https://github.com/ebecht/MCPcounter
rm(list = ls())
##更改镜像
options(repos<- c(CRAN='https://mirrors.tuna.tsinghua.edu.cn/CRAN/') )
options('BioC_mirror'<- 'https://mirrors.ustc.edu.cn/bioc/')
install.packages(c('devtools','curl')) ##Installs devtools and the MCPcounter dependancy 'curl'
library(devtools)
install_github('ebecht/MCPcounter',ref='master', subdir='Source')
##加载包
library(MCPcounter)
## 看一下说明书
?MCPcounter.estimate
## 跑一下示例代码
MCPcounter.estimate <- MCPcounter.estimate(
MCPcounterExampleData,
featuresType=c('affy133P2_probesets','HUGO_symbols','ENTREZ_ID')[1], probesets=read.table(curl('http://raw.githubusercontent.com/ebecht/MCPcounter/master/Signatures/probesets.txt'),sep='\t',stringsAsFactors=FALSE,colClasses='character'),
genes=read.table(curl('http://raw.githubusercontent.com/ebecht/MCPcounter/master/Signatures/genes.txt'),sep='\t',stringsAsFactors=FALSE,header=TRUE,colClasses='character',check.names=FALSE)
)
可以看到需要4个参数,MCPcounterExampleData是转录组数据,featuresType是确认转录组数据基因名的类型,可'affy133P2_probesets','HUGO_symbols'和'ENTREZ_ID',实际使用中probesets和genes可以不加。
我们来试一下TCGA的数据
library(MCPcounter)
estimate <- MCPcounter.estimate(exprSet, featurestype=c('affy133P2_probesets','HUGO_symbols','ENTREZ_ID')[2])
可以看到计算了8个免疫细胞丰度,CD3+ T cells, CD8+ T cells, cytotoxic lymphocytes, NK cells, B lymphocytes, cells originating from monocytes (monocytic lineage), myeloid dendritic cells, neutrophils, 以及2个基质细胞,endothelial cells 和fibroblasts。分数的高低可以显示其在免疫微环境中的浸润程度。不过注意,细胞之间的丰度不可互相比较。
画一下热图,清晰明
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。