res_edgeR: Automate the glmQLFit/glmTreat functions from edgeR

Description Usage Arguments Author(s) Examples

View source: R/src_res_edgeR.R

Description

Function assumes a DGEGLM object from glmQLFit and will then produce DE results based on a coef or contrast.

Usage

1
res_edgeR(fit, contrast = NULL, coef = NULL, lfc = log2(1.2), ID = "Gene")

Arguments

fit

DGEGLM, output of glmQLFit

contrast

a numeric contrast so a column from edgeR::makeContrasts()

coef

a coefficient to test, ignored it contrast is set

lfc

a lfc threshold for glmTreat, if 0 falls back to glmQLTest

ID

the name of the column that will store the genes/regions/identifiers for each row

Author(s)

Alexander Toenges

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
nlibs <- 4
ngenes <- 1000
dispersion.true <- 1/rchisq(ngenes, df=10)
design <- model.matrix(~factor(c(1,1,2,2)))
y <- rnbinom(ngenes*nlibs,mu=20,size=1/dispersion.true)
y <- matrix(y,ngenes,nlibs)
rownames(y) <- paste0("Gene", seq(1,nrow(y)))
d <- DGEList(y)
d <- calcNormFactors(d)
d <- estimateDisp(d, design)
fit <- glmQLFit(d, design)
head(res_edgeR(fit=fit,coef=2))

ATpoint/diffanalyseR documentation built on Oct. 8, 2021, 10:11 p.m.