runLimma: DEG analysis with limma in batch mode

Description Usage Arguments Value Author(s) Examples

Description

The sampleList function extracts the sample comparisons (contrasts) from the CMAP annotation table and stores them as a list. The runLimma function performs the actual DEG analysis with the limma package for all comparisons defined by sampleList.

Usage

1
2
3
sampleList(cmap, myby)

runLimma(df, comp_list, fdr = 0.05, foldchange = 1, verbose = TRUE, affyid=NULL)

Arguments

df

data.frame containing normalized intensity values. Row names are the probe set identifiers of the corresponding Affymetrix chip.

comp_list

Sample comparison list generated by sampleList.

fdr

FDR cutoff filter value on scale between 0 to 1.

foldchange

log2 fold change filter.

affyid

If affyid=NULL, a binary DEG matrix will be returned; if affyid is assigned a character vector of Affy IDs, a list will be returned containing for each treatment the topTable output subsetted by the corresponding Affy IDs.

verbose

Function prints status output if verbose=TRUE, while FALSE suppresses it.

cmap

Input data.frame defining sample comparisons, such as CMAP annotation file (cmap_instances_02.txt).

myby

If myby=CMP the comparisons will consider only the compound information, while myby=CMP_CELL also the cell types used in the assyas.

Value

Function sampleList returns a list of character vectors.

If affyid=NULL, the function runLimma returns a list with the following three components. DEG: binary matrix where DEGs meeting the cutoff settings are indicated by 1s; logFC: matrix with corresponding logFC values; FDR matrix with corresponding FDR values. If affyid is assigned a character vector of Affy IDs, then the function returns a list containing for each treatment the topTable output subsetted by the corresponding Affy IDs.

Author(s)

Thomas Girke

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
## Generate CEL file list for treatment vs. control comparisons
cmap <- read.delim("./data/cmap_instances_02.txt", check.names=FALSE)
comp_list <- sampleList(cmap, myby="CMP") 
comp_list <- sampleList(cmap, myby="CMP_CELL") # includes cell type info

## Load normalized expression data
chiptype_dir <- unique(readRDS("./data/chiptype.rds"))
df1 <- readRDS(paste0("data/", chiptype_dir[1], "/", "all_mas5exprs.rds"))
df2 <- readRDS(paste0("data/", chiptype_dir[2], "/", "all_mas5exprs.rds"))
df3 <- readRDS(paste0("data/", chiptype_dir[3], "/", "all_mas5exprs.rds"))
affyid <- rownames(df1)[rownames(df1) 
df <- cbind(df1[affyid,], df2[affyid,], df3[affyid,])

## DEG analysis with Limma
degMA <- runLimma(df, comp_list, fdr=0.10, foldchange=1, verbose=TRUE) 


## End(Not run)

tgirke/longevityTools documentation built on May 31, 2019, 9:07 a.m.