MCPcounter返回的分数以任意单位表示。这些分数与样本中估计的细胞数量成比例。每个种群具有不同的任意单位。因此,它不能用来比较一个样本中不同种群的丰度。然而,这些分数允许比较队列中样本之间单个细胞群体的丰度。这与其他去卷积方法(如CIBERSORT)是一个根本性的区别,这些方法估计了整体免疫浸润中的相对成分,因此允许在样本内的群体之间进行比较,但不能在样本之间进行比较。

####MCPcounter ######## 下载超时,安装不成功
#利用devtools包的install_github函数进行安装
# install.packages(c('devtools','curl'))
# library(curl)
# library(devtools)
# install_github("ebecht/MCPcounter",ref="master", subdir="Source")
# library(MCPcounter)############# 直接拷贝R脚本文件########################## Rd
## description >> Takes as input an expression matrix and a list of marker features and return summarized expression values
## argument
## item >> xp >> An expression matrix with features in rows and samples in columns
## item >> markers >> a list whose names are cellular populations' names and elements are character vectors of features
## value >> matrix with the summarized expression of each marker features sets in rows
## author >> Etienne Becht
## keyword >> methods
## endappendSignatures=function(xp,markers){res=as.data.frame(do.call(cbind,lapply(markers,function(x){apply(xp[intersect(row.names(xp),x),,drop=F],2,mean,na.rm=T)})))res
}## Rd
## description >> this function produces a matrix with abundance estimates from an expression matrix
## argument
## item >> expression >> matrix or data.frame with features in rows and samples in columns
## item >> featuresType >> type of identifiers for expression features. Defaults to "affy133P2_probesets" for Affymetrix Human Genome 133 Plus 2.0 probesets. Other options are "HUGO_symbols" (Official gene symbols), "ENTREZ_ID" (Entrez Gene ID) or "ENSEMBL_ID" (ENSEMBL Gene ID)
## value >> matrix with cell populations in rows and samples in columns
## author >> Etienne Becht
## keyword >> methods
## examples >> ExampleEstimates=MCPcounter.estimate(MCPcounterExampleData,featuresType="affy133P2_probesets")
## examples >> heatmap(as.matrix(ExampleEstimates),col=colorRampPalette(c("blue","white","red"))(100))
## endMCPcounter.estimate=function(expression,featuresType=c("affy133P2_probesets","HUGO_symbols","ENTREZ_ID","ENSEMBL_ID")[1],probesets=read.table(curl:::curl("https://raw.githubusercontent.com/ebecht/MCPcounter/master/Signatures/probesets.txt"),sep="\t",stringsAsFactors=FALSE,colClasses="character"),genes=read.table(curl:::curl("https://raw.githubusercontent.com/ebecht/MCPcounter/master/Signatures/genes.txt"),sep="\t",stringsAsFactors=FALSE,header=TRUE,colClasses="character",check.names=FALSE)
){## marker.names=c("T cells","CD8 T cells","Cytotoxic lymphocytes","NK cells","B lineage","Monocytic lineage","Myeloid dendritic cells","Neutrophils","Endothelial cells","Fibroblasts")if(featuresType=="affy133P2_probesets"){features=probesetsmarkers.names = unique(features[, 2])features=split(features[,1],features[,2])features=lapply(features,intersect,x=rownames(expression))features=features[sapply(features,function(x)length(x)>0)]missing.populations=setdiff(markers.names,names(features))features=features[intersect(markers.names,names(features))]} else {markersG=genes}if(featuresType=="HUGO_symbols"){features=subset(markersG,get("HUGO symbols")%in%rownames(expression))markers.names = unique(features[, "Cell population"])features=split(features[,"HUGO symbols"],features[,"Cell population"])missing.populations=setdiff(markers.names,names(features))features=features[intersect(markers.names,names(features))]}if(featuresType=="ENTREZ_ID"){features=subset(markersG,ENTREZID%in%rownames(expression))markers.names = unique(features[, "Cell population"])features=split(features[,"ENTREZID"],features[,"Cell population"])missing.populations=setdiff(markers.names,names(features))features=features[intersect(markers.names,names(features))]}if(featuresType=="ENSEMBL_ID"){features=subset(markersG,get("ENSEMBL ID")%in%rownames(expression))markers.names = unique(features[, "Cell population"])features=split(features[,"ENSEMBL ID"],features[,"Cell population"])missing.populations=setdiff(markers.names,names(features))features=features[intersect(markers.names,names(features))]}if(length(missing.populations)>0){warning(paste("Found no markers for population(s):",paste(missing.populations,collapse=", ")))}t(appendSignatures(expression,features))
}## Rd
## description >> this function returns a matrix whose elements are p-value corresponding to the null hypothesis that samples are not infiltrated by the corresponding cell population.
## argument
## item >> MCPcounterMatrix >> A matrix, usually a return from the MCPcounter.estimate method
## item >> platform >> Expression platform used to produce the data. Supported are "133P2" (Affymetrix Human Genome 133 Plus 2.0), "133A" (Affymetrix Human Genome 133A), "HG1" (Affymetrix Human Gene 1.0ST). Other platforms are not supported. Data should ideally be log2-transformed and normalized with the fRMA bioconductor package. MCP-counter estimates from Affymetrix Human Genome 133 Plus 2.0 and 133A arrays should be computed using "affy_133P2_probesets" as identifiers, and "HUGO_symbols" or "ENTREZ_ID" for Affymetrix Human Gene 1.0ST.
## value >> matrix with samples in rows and cell populations in columns. Elements are p-values
## author >> Etienne Becht
## keyword >> methods
## endtest_for_infiltration=function(MCPcounterMatrix,platform=c("133P2","133A","HG1")[1]){MCPcounterMatrix=t(MCPcounterMatrix)params=null_models[grep(platform,colnames(null_models))]rownames(params)=null_models[,"Cell.population"]colnames(params)=sub(platform,"",colnames(params),fixed=T)res=sapply(colnames(MCPcounterMatrix),function(x){pnorm(MCPcounterMatrix[,x],mean=params[x,"mu."],sd=params[x,"sigma."],lower.tail=F)})rownames(res)=rownames(MCPcounterMatrix)res
}############# 直接拷贝R脚本文件########################setwd("/Users/zhengxueming/scripts/R_scripts")
genes <- data.table::fread("/Users/zhengxueming/software/MCPcounter-master/Signatures/genes.txt",data.table = F)
genes[1:5,]probesets <- data.table::fread("/Users/zhengxueming/software/MCPcounter-master/Signatures/probesets.txt",data.table = F,header = F)
probesets[1:5,]# 准备基因表达数据rna_seq数据
# 行名为HUGO_symbols,ENTREZ_ID或 ENSEMBL_ID
exprs_df <- read.delim("/Users/zhengxueming/test/test_mRNA_exprs.tsv", header=T, sep="\t", check.names=F,row.names = 1)
exprs_df[1:3,1:5]library(stringr)
# ENSG00000242268.2 =》ENSG00000242268
names_short <- word(rownames(exprs_df),1,sep=fixed("."))  # 提取点号前面的部分
rownames(exprs_df) <- names_short
dim(exprs_df)
results<- MCPcounter.estimate(exprs_df,featuresType= "ENSEMBL_ID", probesets=probesets,genes=genes)class(results) # [1] "matrix" "array"
results # 行为十种细胞类型,列为样本
dim(results)
rownames(results)
colnames(results)
results[1:3,1:5]

参考:

http://134.157.229.105:3838/webMCP/

https://github.com/ebecht/MCPcounter

https://genomebiology.biomedcentral.com/articles/10.1186/s13059-016-1070-5

MCPcounter估计免疫浸润细胞丰度相关推荐

  1. RNA 29. SCI文章中基于TCGA的免疫浸润细胞分析 (TIMER2.0)

    桓峰基因公众号推出转录组分析教程,有需要生信的老师可以联系我们!转录分析教程整理如下: RNA 1. 基因表达那些事--基于 GEO RNA 2. SCI文章中基于GEO的差异表达基因之 limma ...

  2. RNA 24. SCI文章中基于TCGA的免疫浸润细胞分析的在线小工具——TIMER

    点击关注,桓峰基因 桓峰基因 生物信息分析,SCI文章撰写及生物信息基础知识学习:R语言学习,perl基础编程,linux系统命令,Python遇见更好的你 135篇原创内容 公众号 今天来介绍一个使 ...

  3. RNA 25. SCI文章中估计组织浸润免疫细胞和基质细胞群的群体丰度(MCP-counter)

    点击关注,桓峰基因 今天来介绍一个利用基因表达估计组织浸润免疫细胞和基质细胞群的群体丰度的软件包--MCP-counter,亲试,非常好用. 桓峰基因的教程不但教您怎么使用,还会定期分析一些相关的文章 ...

  4. ImmuCellAI | 免疫浸润计算工具 R包学习

    ImmuCellAI ImmuCellAI(Immune Cell Abundance Identifier) 是一个从基因表达数据集(包括RNA-Seq和芯片数据)中估计24种免疫细胞丰度的工具,其 ...

  5. Microbiome:环境样品中绝对定量菌群丰度的新方法

    文章目录 环境样品中微生物群落丰度的绝对定量 写在前面 摘要 背景 结果 结论 背景 方法 P.E.F合成spikes的设计 图 1 合成spike设计 土壤样品的特征 微生物学技术 图 2 DNA提 ...

  6. 宏基因组实战6. 不比对快速估计基因丰度Salmon

    前情提要 如果您在学习本教程中存在困难,可能因为缺少背景知识,建议先阅读本系统前期文章 宏基因组分析理论教程 微生物组入门圣经+宏基因组分析实操课程 1背景知识-Shell入门与本地blast实战 2 ...

  7. RNA 12. SCI 文章中肿瘤免疫浸润计算方法之 CIBERSORT

    免疫浸润也是近几年肿瘤研究的一个重要方向.通过表达数据即可推算出这个整体样本中究竟有哪些免疫细胞.下面我们就基于数据库数据来看下整个流程分析! 前言 我们介绍了CIBERSORT,一种从其基因表达谱表 ...

  8. Science Bulletin:绝对丰度的植物根际微生物群落“扩增-选择”模型

    Science Bulletin: 基于绝对丰度的植物根际微生物群落"扩增-选择"组装模型 2020年3月7日,Science Bulletin在线发表中科院分子植物科学卓越创新中 ...

  9. Science Bulletin:上海植生所王二涛组发表基于绝对丰度的植物根际微生物群落“扩增-选择”组装模型

    文章目录 Science Bulletin: 基于绝对丰度的植物根际微生物群落"扩增-选择"组装模型 背景介绍 研究方法 结果与讨论 作者简介 王二涛 于楠 张学斌 王孝林 Ref ...

最新文章

  1. 的安装配置_JDK安装与配置
  2. 各种排序算法思想小结
  3. 12个常用的JavaScript技巧
  4. 更改terminal的端口
  5. JavaScript 高级——详谈面向对象
  6. P3389 【模板】高斯消元法
  7. Dxg——立创EDA [LCEDA] 开发笔记整理分类合集【所有的相关记录,都整理在此】
  8. 2014恒生电子笔试题
  9. 处理自己计算机某的端口被占问题
  10. 微信小程序富文本编辑器 editor 组件源码
  11. cad导出jpg格式什么像素最清晰
  12. 使用dos2unix批量转换文件
  13. 位移的单位符号_位移传感器符号
  14. STM32 DS18B20温度传感器实验(HAL库)
  15. MOS管的行业应用领域-KIA MOS管
  16. 如何让你的本地上的项目不用部署到服务器也能让外网看到?使用ngrok内网穿透实现
  17. python 登录新浪微博_Python 模拟登录新浪微博
  18. docker ——安装tomcat
  19. 计算机毕业设计springboot+vue+elementUI高考填报志愿综合参考系统
  20. 外卖业务服务器端性能测试总结

热门文章

  1. 24点游戏c语言链表做法,解24点
  2. 华为硬件工程师手册_漫画解读—华为最强科普:什么是DSP?
  3. 数据库审计系统在加密传输场景下的应用-SinoDB
  4. Quora图片懒加载
  5. FTP登录提示421 Service not available
  6. 【Django:图书管理(新)】
  7. 计算机硬件相关的论文,计算机硬件论文
  8. 计算机维修知识论文,计算机维修论文2000字
  9. 数据仓库建模(三):事实表的设计
  10. 一招修改文件的创建日期