MCP-count
包的安装
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
TCGA_xena_FPKM表达数据
library(curl)
library(MCPcounter)
??MCPcounter.estimate
load(file = 'TCGA.Rdata')
exprMatrix[1:10,1:10]####################ensemble整洁版ID
####library(clusterProfiler)
library(org.Hs.eg.db)
ls("package:org.Hs.eg.db")
g2s=toTable(org.Hs.egSYMBOL);head(g2s)
g2e=toTable(org.Hs.egENSEMBL);head(g2e)
tmp=merge(g2e,g2s,by='gene_id')
head(tmp)
colnames(exprMatrix)[ncol(exprMatrix)] <- c("ensembl_id")###################重命名Ensemble_ID 便于后面merge
exprMatrix<- merge(tmp,exprMatrix,by='ensembl_id')
exprMatrix<- exprMatrix[,- c(1,2)]
exprMatrix=exprMatrix[!duplicated(exprMatrix$symbol),]
row.names(exprMatrix)<- exprMatrix[,1]
exprMatrix<- exprMatrix[,-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)
results<- MCPcounter.estimate(exprMatrix,featuresType=c("HUGO_symbols")[1],
probesets=probesets,
genes=genes
)
参考资料:
360图书馆
简书1
网友评论