immunedeconv:一个R软件包,用于统一访问从大量RNA测序数据估算免疫细胞组分的计算方法。
an R package for unified access to computational methods for estimating immune cell fractions from bulk RNA sequencing data.
1. 安装
conda create -n deconvolution
conda activate deconvolution
conda install -c bioconda -c conda-forge r-immunedeconv
## 连接超时
#install.packages("remotes")
#remotes::install_github("icbi-lab/immunedeconv")
#devtools::install_github('icbi-lab/immunedeconv', repos='http://cran.rstudio.com')
2. 准备表达谱数据
The input data is a gene
×× sample
gene expression matrix. In general values should be
- TPM-normalized
- not log-transformed.
gene_expr <- read.table("/data/query_expr_ready.txt",
sep='\t',header=T)
head(gene_expr)
colnames(gene_expr)
rownames(gene_expr)
rownames(gene_expr) <- gene_expr$ID
gene_expr <- gene_expr[,-1]
exprs_matrix <- as.matrix(gene_expr)
head(exprs_matrix)
3. 估算免疫细胞比例
library(tidyr)
library(immunedeconv)
res = deconvolute(exprs_matrix, "quantiseq")
res = deconvolute(exprs_matrix, "quantiseq") %>%
map_result_to_celltypes(c("T cell CD4+"), "quantiseq")
knitr::kable(res, digits=2)
res1 <- deconvolute(your_mixture_matrix, "mcp_counter")
res2 <- deconvolute(your_mixture_matrix, "xcell")
res3 <- deconvolute(your_mixture_matrix, "epic")
## method:
#quantiseq
#timer
#cibersort
#cibersort_abs
#mcp_counter
#xcell
#epic
参考: