R 函数学习 - ComBat_seq
2020-08-11 本文已影响0人
Thinkando
image.png
image.png
ComBat-seq:使用经验贝叶斯框架调整批处理效果
输入raw_count 文件,输出也是count 文件
安装(我在windows 没有安装成功,在linux 安装成功了)
# install.packages("devtools")
devtools::install_github("zhangyuqing/sva-devel")
Basic usage (users need to input at least two parameters - a raw count matrix from RNA-Seq studies, without any normalization or transformation, and a vector for batch separation):
count_matrix <- matrix(rnbinom(400, size=10, prob=0.1), nrow=50, ncol=8)
batch <- c(rep(1, 4), rep(2, 4))
adjusted <- ComBat_seq(count_matrix, batch=batch, group=NULL)
image.png
image.png
In ComBat-Seq, user may specify biological covariates, whose signals will be preserved in the adjusted data. If the user would like to specify one biological variable, they may use the group parameter:
group <- rep(c(0,1), 4)
adjusted_counts <- ComBat_seq(count_matrix, batch=batch, group=group)
If users wish to specify multiple biological variables, they may pass them as a matrix or data frame to the covar_mod parameter:
cov1 <- rep(c(0,1), 4)
cov2 <- c(0,0,1,1,0,0,1,1)
covar_mat <- cbind(cov1, cov2)
adjusted_counts <- ComBat_seq(count_matrix, batch=batch, group=NULL, covar_mod=covar_mat)