Thanks. I've switched to limma. I have a gene expression matrix of normalised gene expression values. There is >26,000 genes, start of the file is like this:
Gene Sample1 Sample2 Sample3 Sample4 Sample5 Sample6
Gene1 5.20 5.05 5.01 4.96 5.31 4.83
Gene2 4.85 4.59 4.91 5.06 4.75 4.86
Gene3 7.68 7.30 7.58 7.64 7.45 7.69
I have a phenotype File (age 2.5 months and 20 months, and I want to find genes that are DE with age):
Sample Age
Sample1 Age2.5
Sample2 Age2.5
Sample3 Age2.5
Sample4 Age20
Sample5 Age20
Sample6 Age20
This case I am comparing two age groups, other data sets I am comparing multiple age groups.
I wrote this code to run the eBayes model in limma:
library(limma)
library(Biobase)
expr <-as.matrix(read.table("Table.tabbed",header=TRUE,sep="\t",row.names=1,as.is=TRUE))
expr
minimalSet <-ExpressionSet(assayData=expr)
pData <-read.table("pData",row.names=1,header=TRUE,sep="\t")
metadata <-data.frame(labelDescription=c("Age"),row.names=c("Age"))
phenoData <-new("AnnotatedDataFrame",data=pData,varMetadata=metadata)
exampleSet <-ExpressionSet(assayData=expr,phenoData=phenoData,annotation="Mouse430_2")
#limma
f <-factor(as.character(exampleSet$Age))
design <-model.matrix(~f)
fit <-eBayes(lmFit(exampleSet,design))
fit$t
fit$p.value
The output:
An object of class "MArrayLM"
$coefficients
(Intercept) fAge5
Gene1 122.74 -7.14
Gene2 17.76 7.98
Gene3 2749.66 -140.96
26676 more rows ...
$rank
[1] 2
$assign
[1] 0 1
$qr
$qr
(Intercept) fAge5
1 -3.16 -1.58
2 0.31 -1.58
3 0.31 0.24
4 0.31 0.24
5 0.31 0.24
6 0.31 -0.39
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$f
[1] "contr.treatment"
$qraux
[1] 1.31 1.24
$pivot
[1] 1 2
$tol
[1] 1e-07
$rank
[1] 2
$df.residual
[1] 8 8 8 8 8
26676 more elements ...
$sigma
Gene1 Gene2 Gene3 Gene4 Gene5
76.52 18.88 315.83 225.08 60.69
26676 more elements ...
$cov.coefficients
(Intercept) fAge5
(Intercept) 0.2 -0.2
fAge5 -0.2 0.4
$stdev.unscaled
(Intercept) fAge5
Gene1 0.44 0.63
Gene2 0.44 0.63
Gene3 0.44 0.63
26676 more rows ...
$pivot
[1] 1 2
$Amean
Gene1 Gene2 Gene3 Gene4 Gene5 119.17 21.75 2679.18 3109.49 544.06 26676 more elements ...
$method
[1] "ls"
$design
(Intercept) fAge5
1 1 1
2 1 1
3 1 1
4 1 1
5 1 1
6 1 0
attr(,"assign")
[1] 0 1
attr(,"contrasts")
attr(,"contrasts")$f
[1] "contr.treatment"
$df.prior
[1] 1.109467
$s2.prior
[1] 1365.136
$var.prior
[1] 0.011 0.011
$proportion
[1] 0.01
$s2.post
Gene1 Gene2 Gene3 Gene4 Gene5
5308.61 479.43 87768.19 44660.61 3401.09
26676 more elements ...
$t
(Intercept) fAge5
Gene1 3.76 -0.15
Gene2 1.81 0.57
Gene3 20.75 -0.75
Gene4 27.48 7.66
Gene5 24.27 -4.82
26676 more rows ...
$df.total
[1] 9.10 9.10 9.10 9.10 9.10
26676 more elements ...
$p.value
(Intercept) fAge5
Gene1 4.34e-03 8.8e-01
Gene2 1.02e-01 5.7e-01
Gene3 5.5e-09 4.7e-01
Gene4 4.4e-10 2.9e-05
Gene5 1.36e-09 9.08e-04
26676 more rows ...
$lods
(Intercept) fAge5
Gene1 -4.45 -4.60
Gene2 -4.54 -4.60
Gene3 -4.34 -4.60
Gene4 -4.33 -4.48
Gene5 -4.34 -4.50
26676 more rows ...
$F
[1] 13.38 5.09 409.20 1111.87 446.79
26676 more elements ...
$F.p.value
[1] 1.94e-03 3.26e-02 1.20e-09 1.30e-11 8.10e-10
26676 more elements ...
Could you post what method you used to arrive to these results? (actual code would help). You mention two age groups but I see 3 in your example data (Age2, Age4 and Age6).
Thanks, sorry I have multiple data sets, both with two and more than two age groups. I have switched to limma and posted the input file, the code and the output below, if you had any thoughts I'd appreciate it.