ComBat_seq: Adjust for batch effects using an empirical Bayes framework...

Description Usage Arguments Value Examples

View source: R/ComBat_seq.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
8
9
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 documentation built on Nov. 8, 2020, 8:16 p.m.