Entering edit mode
3.0 years ago
Peter
▴
20
Hey guys
I have transcriptome data from five different groups. I'm comparing transcriptome from five different brain regions. My data is with genes in columns and samples in rows.
I used the following code to perform ANOVA and Tukey's post-hoc test:
> genes <- colnames(mydata)[2:ncol(mydata)]
> head(genes)
> aov.out <- lapply(genes, function(x) { lm(substitute(i ~ Groups, list(i = as.name(x))), data = mydata)})
> TukeyHSD.out <- lapply(aov.out, function(x) TukeyHSD(aov(x)))
My aov.out
file is a result list for all my genes:
> TukeyHSD.out[[1]]
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = x)
$Groups
diff lwr upr p adj
HIP-CER 0.06974 -1.716994 1.856474 0.9994666
LPS-CER 0.18248 -1.502069 1.867029 0.9890216
PFC-CER 0.30944 -1.375109 1.993989 0.9505767
LPS-HIP 0.11274 -1.673994 1.899474 0.9977672
PFC-HIP 0.23970 -1.547034 2.026434 0.9796204
PFC-LPS 0.12696 -1.557589 1.811509 0.9962189
I'd like to get a table in a data.frame that looks something like:
Comparison Gene diff adj.p-value
Group1-Group2 ATF6 1.5548 0.01548
Can anybody help me?
Thanks in advance!