addContrast: fit GLMs to reduced model and test for significance

View source: R/qsea.glm.R

addContrastR Documentation

fit GLMs to reduced model and test for significance

Description

This function fits negative binomial GLMs to reduced models defined either by the "contrast" parameter, or by one or several model coefficients (specified by "coef" parameter) set to zero. Subsequently, a likelihood ratio test is applied, to identify windows significantly dependent on the tested coefficient.

Usage

addContrast(qs,glm,contrast,coef,name,verbose=TRUE, nChunks = NULL, 
    parallel = FALSE )

Arguments

qs

a qseaSet object

glm

a qseaGLM object

contrast

numeric vector specifying a contrast of the model coefficients. This contrast can for example be defined using limma::makeContrasts()

coef

alternatively defines the contrast by coefficient(s) of the model tested to be equal to zero.

name

short descriptive name for the contrast (as "TvsN"), used for examples in columns of result tables

verbose

more messages that document the process

nChunks

fit GLMs in multiple chunks

parallel

use multicore processing

Value

This function returns the qseaGLM object, extended by the fitted coefficients of the reduced GLMs, as well as the test statistics. Note that one qseaGLM object can contain several contrasts.

Author(s)

Mathias Lienhard

See Also

limma::makeContrasts(), fitNBglm(), isSignificant()

Examples

qs=getExampleQseaSet()
design=model.matrix(~group, getSampleTable(qs))
TvN_glm=fitNBglm(qs, design, norm_method="beta")
TvN_glm=addContrast(qs,TvN_glm, coef=2, name="TvN")

MatthiasLienhard/qsea documentation built on March 22, 2023, 1:15 p.m.