library(plyr) library(dplyr) library(gplots) library(ggplot2) library(readr) library(reshape2) devtools::load_all(".") df = load_all_cqs() %>% fold_vs_gapdh() %>% filter(Timepoint == "4h") by_mouse = df %>% group_by(Target, Timepoint, Condition, Mouse) %>% summarize(FoldVsGapdh=mean(FoldVsGapdh, na.rm=TRUE)) %>% filter(!is.na(FoldVsGapdh)) by_condition = by_mouse %>% group_by(Target, Timepoint, Condition) %>% summarize(FoldVsGapdh=mean(FoldVsGapdh, na.rm=TRUE))
g = ggplot(by_mouse, aes(Condition, FoldVsGapdh)) + facet_wrap(~Target, ncol=2, scales="free") + stat_summary(fun.data=mean_se) + theme_bw() + theme(axis.text.x=element_text(angle=40, hjust=1)) print(g)
g = ggplot(by_mouse, aes(Condition, FoldVsGapdh)) + facet_wrap(~Target, ncol=2, scales="free") + stat_summary(fun.data=mean_se, geom="bar", width=0.8) + stat_summary(fun.data=mean_se, geom="errorbar", width=0.5) + labs(y="Fold expression vs Gapdh") + theme_bw() + theme(axis.text.x=element_text(size=8)) print(g)
for(target in unique(by_mouse$Target)) { paste("\n****", target, "\n") %>% cat conditions = c("Control", "F", "Fg", "F+Fg") fit = aov(FoldVsGapdh~Condition, by_mouse, subset=by_mouse$Target == target & by_mouse$Condition %in% conditions) summary(fit) %>% print hsd = TukeyHSD(fit) print(hsd$Condition[hsd$Condition[,"p adj"] < 0.05,]) }
map_array = acast(by_mouse, Condition~Target, value.var="FoldVsGapdh", subset=.(Timepoint == "4h" & Condition != "L"), fun.aggregate=mean) heatmap(map_array, scale="col")
my_pca = prcomp(map_array, scale.=TRUE) biplot(my_pca)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.