cameraDGEListByContrast: Apply the CAMERA method to a DGEList object and a contrast

View source: R/gse.R

cameraDGEListByContrastR Documentation

Apply the CAMERA method to a DGEList object and a contrast

Description

Apply the CAMERA method to a DGEList object and a contrast

Usage

cameraDGEListByContrast(dgeList, index, design, contrasts, doParallel = FALSE)

Arguments

dgeList

A DGEList object, with GeneSymbol available, and dispersion must be estimated

index

List of integer indices of genesets, names are names of gene sets

design

Design matrix

contrasts

Contrast matrix

doParallel

Logical, whether parallel::mclapply should be used. Since at the current setting it makes a job running forever, use TRUE only if you are debugging the code.

Examples

exMat <- matrix(rpois(120, 10), nrow=20, ncol=6)
exGroups <- gl(2,3, labels=c("Group1", "Group2"))
exDesign <- model.matrix(~0+exGroups)
colnames(exDesign) <- levels(exGroups)
exContrast <- matrix(c(-1,1), ncol=1, dimnames=list(c("Group1", "Group2"), c("Group2.vs.Group1")))
exDescon <- DesignContrast(exDesign, exContrast, groups=exGroups)
exFdata <- data.frame(GeneSymbol=sprintf("Gene%d", 1:nrow(exMat)))
exPdata <- data.frame(Name=sprintf("Sample%d", 1:ncol(exMat)),
                     Group=exGroups)
exDgeList <- DGEList(exMat, genes=exFdata, samples=exPdata)
exDgeList <- edgeR::estimateDisp(exDgeList, exDesign)
cameraDGEListByContrast(exDgeList, index=1:5, design=exDesign, contrasts=exContrast)
cameraDGEListByContrast(exDgeList, 
  index=list(1:5, 6:10),
  design=exDesign, contrasts=exContrast)
  

bedapub/ribiosGSEA documentation built on March 30, 2023, 3:26 p.m.