xCell由dviraran团队于2017年开发,原文题目为:xCell: digitally portraying the tissue cellularheterogeneity landscape
超过200次引用:

该方法通过反褶积整合了基因富集分析的优势,可以评估64种细胞类型,涉及多个适应性和先天免疫细胞、造血祖细胞、上皮细胞和细胞外基质细胞,其中包括48种肿瘤微环境相关细胞。

该方法适用于基因表达谱和传统RNA-seq数据,但不包括单细胞数据(推荐singleR,同样由该团队开发)。
R代码存于github,网址为https://github.com/dviraran/xCell,代码如下:
rm(list = ls())options( repos<- c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))options("BioC_mirror"<- "https://mirrors.ustc.edu.cn/bioc/")options(stringsAsFactors = F)Sys.setlocale("LC_ALL","English")devtools::install_github('dviraran/xCell')
我们以GSE76275为例试一下这个包:
要求输入行为基因名,列为样本。

代码很简单
library(xCell)load("finalSet.Rdata")xCell<- xCellAnalysis(exprSet)xCell_RNAseq<- xCellAnalysis(exprSet,rnaseq = T)
该包vignette也提供了参考代码
评估了sdy311和sdy420两个数据集的免疫浸润情况:
sdy311 <- readRDS("xCell-master/vignettes/sdy311.rds") sdy311_expr <- sdy311$expr sdy311_fcs <- sdy311$fcs dim(sdy311_expr) dim(sdy311_fcs) sdy420 <- readRDS("xCell-master/vignettes/sdy420.rds") sdy420_expr <- sdy420$expr sdy420_fcs <- sdy420$fcs get.xCell.scores = function(sdy){ raw.scores = rawEnrichmentAnalysis(as.matrix(sdy$expr), xCell.data$signatures, xCell.data$genes) colnames(raw.scores) = gsub("\\.1","",colnames(raw.scores)) raw.scores = aggregate(t(raw.scores)~colnames(raw.scores),FUN=mean) rownames(raw.scores) = raw.scores[,1] raw.scores = raw.scores[,-1] raw.scores = t(raw.scores) cell.types = rownames(sdy$fcs) cell.types.use = intersect(rownames(raw.scores),rownames(sdy$fcs)) transformed.scores = transformScores(raw.scores[cell.types.use,],xCell.data$spill.array$fv) scores = spillOver(transformed.scores,xCell.data$spill.array$K) A = intersect(colnames(sdy$fcs),colnames(scores)) scores = scores[,A] scores } library(xCell) sdy311$fcs= sdy311$fcs[,-which(colnames(sdy311$fcs) %in% c("SUB134240","SUB134283"))] scores311 = get.xCell.scores(sdy311) scores420 = get.xCell.scores(sdy420)
计算了xCell评分和免疫分析的相关性
library(psych) library(ggplot2) correlateScoresFCS = function(scores,fcs,tit){ fcs = fcs[rownames(scores),colnames(scores)] res = corr.test(t(scores),t(fcs),adjust='none') df = data.frame(R=diag(res$r),p.value=diag(res$p),Cell.Types=rownames(res$r)) ggplot(df)+geom_col(aes(y=df$R,x=Cell.Types,fill=p.value<0.05))+theme_classic()+ theme(axis.text.x = element_text(angle = 45, hjust = 1))+ ylab('Pearson R')+ggtitle(tit) } correlateScoresFCS(scores311,sdy311$fcs,'SDY311') correlateScoresFCS(scores420,sdy420$fcs,'SDY420')

同样地,作者提供了xCell网页版工具,网址为:http://xcell.ucsf.edu/

通过上传表达数据,会在你的邮箱里收到分析结果。

还提供了可视化分析结果的网页工具,网址为http://comphealth.ucsf.edu/xCellView/,不过貌似用不了