[BioC] Limma model parameters design, combining a paired with a factorial design

john herbert arraystruggles at gmail.com
Thu Oct 13 19:29:59 CEST 2011


Hello,
I have a complex design matrix to produce (for me anyway) for single
colour array data.

I have 16 samples for 8 patients, which are paired (P1 to P4).

Patients 1 and 3 are control patients and patients 2 and 4 are affected

Before and after refer to before and after an operation.

File1 P1 Control before
File2 P1 Control after
File3 P2 Affected before
File4 P2 Affected after
File5 P3 Control before
File6 P3 Control after
File7 P4 Affected before
File8 P4 Affected after

If to look at the Limma manual, section "8.3 Paired Samples" looks
almost good for this design.

However, does it need combining with a factorial design (section "8.7
Factorial Designs") as there is a before and after op?

How do I combine a design for paired samples with a factorial design?


>From the manual, below, the paired and the factorial examples looks
scary to combine. ?

FileName SibShip Treatment
File1 1 C
File2 1 T
File3 2 C
File4 2 T
File5 3 C
File6 3 T

A moderated paired t-test can be computed by allowing for sib-pair
eects in the linear model:
> SibShip <- factor(targets$SibShip)
> Treat <- factor(targets$Treatment, levels=c("C","T"))
> design <- model.matrix(~SibShip+Treat)
> fit <- lmFit(eset, design)
> fit <- eBayes(fit)
> topTable(fit, coef="TreatT")


frame:

FileName Strain Treatment
File1 WT U
File2 WT S
File3 Mu U
File4 Mu S
File5 Mu S

> TS <- paste(targets$Strain, targets$Treatment, sep=".")
> TS
[1] "WT.U" "WT.S" "Mu.U" "Mu.S" "Mu.S"

> TS <- factor(TS, levels=c("WT.U","WT.S","Mu.U","Mu.S"))

> design <- model.matrix(~0+TS)
> colnames(design) <- levels(TS)
> fit <- lmFit(eset, design)

> cont.matrix <- makeContrasts(
  WT.SvsU=WT.S-WT.U,
  Mu.SvsU=Mu.S-Mu.U,
  Diff=(Mu.S-Mu.U)-(WT.S-WT.U), levels=design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2 <- eBayes(fit2)
We can use topTable() to look at lists of dierentially expressed
genes for each of three
contrasts, or else
48> results <- decideTests(fit2)
> vennDiagram(results)



More information about the Bioconductor mailing list