formatLimmaResult function

Format a Result from Limma

Format a Result from Limma

It is not exported by DAPAR and has to be reproduced here.

formatLimmaResult(fit, conds, contrast)

Arguments

  • fit: Limma fit
  • conds: Condition vector
  • contrast: Contrast vector

Returns

A list of two dataframes : logFC and P_Value. The first one contains the logFC values of all the comparisons (one column for one comparison), the second one contains the pvalue of all the comparisons (one column for one comparison). The names of the columns for those two dataframes are identical and correspond to the description of the comparison.

Examples

# library(DAPAR) set.seed(2016) data(qData) data(sTab) contrast=1 sTab.old <- sTab conds <- factor(sTab$Condition, levels = unique(sTab$Condition)) sTab <- sTab[unlist(lapply(split(sTab, conds), function(x) { x["Sample.name"] })), ] qData <- qData[, unlist(lapply(split(sTab.old, conds), function(x) { x["Sample.name"] }))] conds <- conds[order(conds)] res.l <- NULL design.matrix <- mi4p::make.design(sTab) contra <- mi4p::make.contrast(design.matrix, condition = conds, contrast) cmtx <- limma::makeContrasts(contrasts = contra, levels = make.names(colnames(design.matrix))) fit <- limma::eBayes(limma::contrasts.fit(limma::lmFit(qData, design.matrix), cmtx)) res.l <- mi4p::formatLimmaResult(fit, conds, contrast)

Author(s)

Adapted from the code of Samuel Wieczorek in the DAPAR package as it is an object that is not exported by the DAPAR package.