Reputation: 704
I have never worked with array-data before and I have som basic question on my setup. I have normalized data in a time series with two replicates.
my samples:
colnames(hela.bc)
[1] "I.0h" "I.1h" "I.2h" "I.3h" "I.6h" "I.9h" "I.12h"
"I.15h" "I.18h" "I.21h" "I.24h" "II.0h"
[13] "II.1h" "II.2h" "II.3h" "II.6h" "II.9h" "II.12h" "II.15h"
"II.18h" "II.21h" "II.24h"
I would like to compare "I.0h" and "II.0h" against all the other time points. (I=replicate 1, II=replicate 2)
I set up the following, but I wonder if its correct:
design <- c(2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1)
fit <-lmFit(hela.bc, design)
fit2 <- eBayes(fit)
topTableF(fit2, adjust="BH")*
my data:
dput(head(hela.bc))
structure(c(0.422727272727273, 0.0145454545454545, 0.115909090909091,
0.303636363636364, -0.0622727272727273, 0.415, 0.222727272727273,
0.0545454545454545, 0.0859090909090909, 0.163636363636364,
-0.0122727272727273,
0.205, 0.232727272727273, 0.154545454545455, 0.195909090909091,
0.193636363636364, 0.0577272727272727, 0.235, 0.0527272727272727,
0.144545454545455, 0.0959090909090909, -0.126363636363636,
0.0377272727272727,
-0.035, 0.0627272727272727, 0.104545454545455, 0.0759090909090909,
-0.116363636363636, -0.0422727272727273, -0.035, 0.0827272727272727,
0.154545454545455, 0.125909090909091, 0.00363636363636364,
0.0377272727272727,
-0.045, 0.102727272727273, 0.124545454545455, 0.115909090909091,
0.0836363636363636, -0.0322727272727273, 0.015, 0.0627272727272727,
0.114545454545455, 0.0259090909090909, -0.0563636363636364,
-0.202272727272727,
-0.065, 0.102727272727273, 0.164545454545455, 0.155909090909091,
0.0336363636363636, 0.0777272727272727, 0.085, 0.322727272727273,
0.214545454545455, 0.165909090909091, 0.213636363636364,
-0.00227272727272728,
0.155, 0.272727272727273, 0.134545454545455, 0.105909090909091,
0.163636363636364, -0.0322727272727273, 0.225, 0.177272727272727,
0.115454545454545, 0.114090909090909, 0.186363636363636,
-0.127727272727273,
0.245, 0.177272727272727, 0.0954545454545455, 0.0940909090909091,
0.0963636363636364, -0.0977272727272727, 0.045, 0.0772727272727273,
0.0454545454545455, 0.0640909090909091, -0.0536363636363636,
-0.117727272727273, 0.125, 0.157272727272727, 0.175454545454545,
0.154090909090909, 0.0563636363636364, 0.0122727272727273, 0.095,
0.267272727272727, 0.0954545454545455, 0.0640909090909091,
0.126363636363636,
0.00227272727272728, 0.125, 0.217272727272727, 0.175454545454545,
0.124090909090909, 0.0263636363636364, 0.0622727272727273, 0.115,
0.237272727272727, 0.0954545454545455, 0.144090909090909,
0.146363636363636,
0.00227272727272728, 0.145, 0.127272727272727, 0.195454545454545,
0.124090909090909, 0.106363636363636, -0.0277272727272727, 0.165,
0.137272727272727, 0.0854545454545455, 0.0940909090909091,
0.0563636363636364,
-0.00772727272727272, 0.075, 0.167272727272727, 0.155454545454545,
0.154090909090909, 0.0763636363636364, 0.0722727272727273, 0.035,
0.197272727272727, 0.145454545454545, 0.134090909090909,
0.0363636363636364,
0.0522727272727273, -0.015), .Dim = c(6L, 22L), .Dimnames = list(
c("hsa-let-7a", "hsa-let-7b", "hsa-let-7c", "hsa-let-7d",
"hsa-let-7e", "hsa-let-7f"), c("I.0h", "I.1h", "I.2h", "I.3h",
"I.6h", "I.9h", "I.12h", "I.15h", "I.18h", "I.21h", "I.24h",
"II.0h", "II.1h", "II.2h", "II.3h", "II.6h", "II.9h", "II.12h",
"II.15h", "II.18h", "II.21h", "II.24h")))
Upvotes: 0
Views: 300
Reputation: 10253
I don't think your design matrix is right. You're just passing a vector to the design
argument which should be a matrix
. I think the following is what you want:
fac <- factor(c(2,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1))
fit <- lmFit(hela.bc, design = model.matrix(~fac))
fit2 <- eBayes(fit)
topTableF(fit2, adjust = "BH")
# X.Intercept. fac2 AveExpr F P.Value adj.P.Val
# hsa-let-7b 0.1315 -6.65e-02 0.1255 69.34 5.48e-11 1.74e-10
# hsa-let-7c 0.1150 1.18e-16 0.1150 68.98 5.79e-11 1.74e-10
# hsa-let-7a 0.1640 1.36e-01 0.1764 52.37 1.03e-09 2.06e-09
# hsa-let-7f 0.0825 2.47e-01 0.1050 22.55 2.40e-06 3.60e-06
# hsa-let-7d 0.0615 1.83e-01 0.0782 12.07 2.10e-04 2.52e-04
# hsa-let-7e -0.0080 -8.70e-02 -0.0159 2.12 1.41e-01 1.41e-01
Upvotes: 1