
Last chance! 50% off unlimited learning
Sale ends in
The aim of this function is to provide convenient acces to two-factorial (linear) testing withing the framework of makeMAList
including the emprical Bayes shrinkage.
The input data 'datMatr' which should already be organized as limma-type MAList, eg using using makeMAList
.
Note: This function uses the Bioconductor package limma.
test2factLimma(
datMatr,
fac1,
fac2,
testSynerg = TRUE,
testOrientation = "=",
addResults = c("lfdr", "FDR", "Mval", "means"),
addGenes = NULL,
silent = FALSE,
callFrom = NULL,
debug = FALSE
)
matrix or data.frame with lines as indenpendent series of measures (eg different genes)
(character or factor) vector describing grouping elements of each line of 'datMatr' for first factor, must be of same langth as fac2
(character or factor) vector describing grouping elements of each line of 'datMatr' for second factor, must be of same langth as fac1
(logical) decide if factor-interactions (eg synergy) should be included to model
(character) default (or any non-recignized input) '=', otherwise either '>','gerater','sup','upper' or '<','inf','lower'
(character) vector defining which types of information should be included to output, may be 'lfdr','FDR' (for BY correction), 'Mval' (M values), 'means' (matrix with mean values for each group of replicates)
(matrix or data.frame) additional information to add to output
(logical) suppress messages
(character) allow easier tracking of message(s) produced
(logical) additional messages for debugging
object of class "MArrayLM" (from limma)
makeMAList
, single line testing lmFit
and the eBayes
-family of functions in package limma
# NOT RUN {
set.seed(2014)
dat0 <- rnorm(30) + rep(c(10,15,19,20),c(9,8,7,6))
fa <- factor(rep(letters[1:4],c(9,8,7,6)))
dat2 <- data.frame(facA=rep(c("-","A","-","A"), c(9,8,7,6)),
facB= rep(c("-","-","B","B"), c(9,8,7,6)), dat1=dat0, dat2=runif(30))
grpNa <- sub("-","",sub("\\.","", apply(dat2[,1:2], 1, paste, collapse="")))
test2f <- test2factLimma(t(dat2[,3:4]), dat2$facA, dat2$facB, testS=FALSE)
test2f
# Now you can easily summarize results using topTable from limma
if(requireNamespace("limma", quietly=TRUE)) {
library(limma)
topTable(test2f, coef=1, n=5)
topTable(test2f, coef=2, n=5) }
# }
Run the code above in your browser using DataLab