ct.preprocessFit: Preprocess a 'MArrayLM' model fit object to include only one...

View source: R/processFit.R

ct.preprocessFitR Documentation

Preprocess a 'MArrayLM' model fit object to include only one contrast.

Description

This function preprocesses a fit object returned from eBayes to include only the values relevant to the modelTerm specified.

Usage

ct.preprocessFit(fit, modelTerm)

Arguments

fit

An object of class MArrayLM to be processed.

modelTerm

The model coefficient to be isolated for downstream analyses.

Value

A MArrayLM object for downstream processing.

Author(s)

Russell Bainer

Examples


#Load and preprocess data
data('es')
library(Biobase)
library(limma)

#Make a multi-level contrast
design <- model.matrix(~ 0 + TREATMENT_NAME, pData(es))
colnames(design) <- gsub('TREATMENT_NAME', '', colnames(design))
contrasts <- makeContrasts((ControlExpansion - ControlReference), (DeathExpansion - ControlExpansion), levels = design)

#Make a multi-level fit object
vm <- voom(exprs(es), design)
fit <- lmFit(vm, design)
fit <- contrasts.fit(fit, contrasts)
fit <- eBayes(fit)  

#And trim it
fit2  <- ct.preprocessFit(fit, modelTerm = '(DeathExpansion - ControlExpansion)')

ncol(fit)
ncol(fit2)

OscarBrock/gCrisprTools documentation built on Oct. 25, 2022, 7:29 a.m.