correction

This commit is contained in:
Costa
2020-11-04 12:05:58 +01:00
parent d252b74866
commit 43e29b5260
+18 -17
View File
@@ -96,10 +96,8 @@ server <- function(input, output) {
colnames(t_maps$label)<-c("x", "y") colnames(t_maps$label)<-c("x", "y")
t_maps[["brackets"]]<-as.data.frame(matrix(nrow = 0, ncol=4)) t_maps[["brackets"]]<-as.data.frame(matrix(nrow = 0, ncol=4))
colnames(t_maps$brackets)<-c("y1", "y2", "x1", "x2") colnames(t_maps$brackets)<-c("y1", "y2", "x1", "x2")
} dades$stats<<-t_stats
}else{
set.seed(123)
if (input$positive == T){
if (input$test == "T-test (adj Holm)"){ if (input$test == "T-test (adj Holm)"){
t_stats<-multi_stats(t, "value", "variable", "Groups", stat.test = "ttest") t_stats<-multi_stats(t, "value", "variable", "Groups", stat.test = "ttest")
} }
@@ -111,20 +109,23 @@ server <- function(input, output) {
t_stats<-t_stats %>% filter(p.signif != "ns") t_stats<-t_stats %>% filter(p.signif != "ns")
t_maps<-generate_labstats(t_stats, t, "value", "variable", "Groups") t_maps<-generate_labstats(t_stats, t, "value", "variable", "Groups")
}
ggplot(melt(t_substr, id=c("Mice", ctrl, "Groups")), aes(variable, value))+ set.seed(123)
labs(x="", y="Spots/2.5*10^5 cells")+ if (input$positive == T){
# geom_errorbar(stat="summary", position=position_dodge(width=0.9), width=0.5, aes(fill=Groups))+ ggplot(melt(t_substr, id=c("Mice", ctrl, "Groups")), aes(variable, value))+
geom_hline(data=mock_mean, aes(color=Groups, yintercept = `.`))+ labs(x="", y="Spots/2.5*10^5 cells")+
# geom_bar(stat="summary", position="dodge", color="black", aes(fill=Groups))+ # geom_errorbar(stat="summary", position=position_dodge(width=0.9), width=0.5, aes(fill=Groups))+
geom_boxplot(color="black", aes(fill=Groups), alpha=0.4, outlier.alpha = 0)+ geom_hline(data=mock_mean, aes(color=Groups, yintercept = `.`))+
geom_jitter(position=position_jitterdodge(jitter.width = 0.2), shape=21, aes(fill=Groups), size=3)+ # geom_bar(stat="summary", position="dodge", color="black", aes(fill=Groups))+
# geom_quasirandom(position = position_quasirandom(), shape=21)+ geom_boxplot(color="black", aes(fill=Groups), alpha=0.4, outlier.alpha = 0)+
scale_x_discrete(limits=colnames(t_substr)[!colnames(t_substr) %in% c("Mice", "Groups", ctrl, mock)])+ geom_jitter(position=position_jitterdodge(jitter.width = 0.2), shape=21, aes(fill=Groups), size=3)+
geom_segment(data=t_maps$brackets, aes(x=x1, xend=x2, y=y1, yend=y2), color="black")+ # geom_quasirandom(position = position_quasirandom(), shape=21)+
geom_text(data=t_stats, aes(t_maps$label$x, t_maps$label$y, label=p.signif), color="black")+ scale_x_discrete(limits=colnames(t_substr)[!colnames(t_substr) %in% c("Mice", "Groups", ctrl, mock)])+
theme_bw()+ geom_segment(data=t_maps$brackets, aes(x=x1, xend=x2, y=y1, yend=y2), color="black")+
theme(axis.text.x=element_text(angle=45, hjust=1)) geom_text(data=t_stats, aes(t_maps$label$x, t_maps$label$y, label=p.signif), color="black")+
theme_bw()+
theme(axis.text.x=element_text(angle=45, hjust=1))
}else{ }else{
ids<-if(ctrl %in% colnames(t_substr)){c("Mice", ctrl, "Groups")}else{c("Mice", "Groups")} ids<-if(ctrl %in% colnames(t_substr)){c("Mice", ctrl, "Groups")}else{c("Mice", "Groups")}
ggplot(melt(t_substr, id=ids), aes(variable, value))+ ggplot(melt(t_substr, id=ids), aes(variable, value))+