Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ComBat_seq

Adjust for batch effects using an empirical Bayes framework in RNA-seq raw counts


Description

ComBat_seq is an improved model from ComBat using negative binomial regression, which specifically targets RNA-Seq count data.

Usage

ComBat_seq(
  counts,
  batch,
  group = NULL,
  covar_mod = NULL,
  full_mod = TRUE,
  shrink = FALSE,
  shrink.disp = FALSE,
  gene.subset.n = NULL
)

Arguments

counts

Raw count matrix from genomic studies (dimensions gene x sample)

batch

Vector / factor for batch

group

Vector / factor for biological condition of interest

covar_mod

Model matrix for multiple covariates to include in linear model (signals from these variables are kept in data after adjustment)

full_mod

Boolean, if TRUE include condition of interest in model

shrink

Boolean, whether to apply shrinkage on parameter estimation

shrink.disp

Boolean, whether to apply shrinkage on dispersion

gene.subset.n

Number of genes to use in empirical Bayes estimation, only useful when shrink = TRUE

Value

data A gene x sample count matrix, adjusted for batch effects.

Examples

count_matrix <- matrix(rnbinom(400, size=10, prob=0.1), nrow=50, ncol=8)
batch <- c(rep(1, 4), rep(2, 4))
group <- rep(c(0,1), 4)

# include condition (group variable)
adjusted_counts <- ComBat_seq(count_matrix, batch=batch, group=group, full_mod=TRUE)

# do not include condition
adjusted_counts <- ComBat_seq(count_matrix, batch=batch, group=NULL, full_mod=FALSE)

sva

Surrogate Variable Analysis

v3.38.0
Artistic-2.0
Authors
Jeffrey T. Leek <jtleek@gmail.com>, W. Evan Johnson <wej@bu.edu>, Hilary S. Parker <hiparker@jhsph.edu>, Elana J. Fertig <ejfertig@jhmi.edu>, Andrew E. Jaffe <ajaffe@jhsph.edu>, Yuqing Zhang <zhangyuqing.pkusms@gmail.com>, John D. Storey <jstorey@princeton.edu>, Leonardo Collado Torres <lcolladotor@gmail.com>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.