Pequeñas correcciones.

This commit is contained in:
Costa
2021-02-16 12:04:19 +01:00
parent 756cb1b300
commit 0be8700e87
+20 -5
View File
@@ -131,14 +131,21 @@ server <- function(input, output) {
t_maps<-generate_labstats(t_stats, t, "value", "variable", "Groups")
dades$maps<<-t_maps
}
print(t_substr)
if (length(unique(dades$taula[,"Groups"])) < 2){
dades$stats<<-1
}
dades$final<<-if(ctrl %in% colnames(t_substr)){t_substr %>% select(-cctrl)}else{t_substr}
# dades$final<<-if(ctrl %in% colnames(t_substr)){t_substr %>% select(-c(ctrl, mock))}else{t_substr %>% select(-mock)}
c(ctrl, mock)[c(ctrl, mock) %in% colnames(t_substr)]
dades$final<<-t_substr %>% select(-c(ctrl, mock)[c(ctrl, mock) %in% colnames(t_substr)])
set.seed(123)
if (input$positive == T){
ggplot(melt(t_substr, id=c("Mice", ctrl, "Groups")), aes(variable, value))+
ids=c("Mice", "Groups", c(ctrl, mock)[c(ctrl, mock) %in% colnames(t_substr)])
validate(
need(exists("mock_mean"), "No se puede elegir positividad con múltiples mocks")
)
if (exists("mock_mean")){
ggplot(melt(t_substr, id=ids), aes(variable, value))+
labs(x="", y="Spots/2.5*10^5 cells")+
# geom_errorbar(stat="summary", position=position_dodge(width=0.9), width=0.5, aes(fill=Groups))+
geom_hline(data=mock_mean, aes(color=Groups, yintercept = `.`))+
@@ -151,8 +158,10 @@ server <- function(input, output) {
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{
ids<-if(ctrl %in% colnames(t_substr)){c("Mice", ctrl, "Groups")}else{c("Mice", "Groups")}
ids=c("Mice", "Groups", c(ctrl, mock)[c(ctrl, mock) %in% colnames(t_substr)])
ggplot(melt(t_substr, id=ids), aes(variable, value))+
labs(x="", y="Spots/2.5*10^5 cells")+
# geom_errorbar(stat="summary", position=position_dodge(width=0.9), width=0.5, aes(fill=Groups))+
@@ -174,6 +183,11 @@ server <- function(input, output) {
observeEvent(dades$stats, {})
t_stats<-dades$stats
if (!is.null(dades$stats)){
if (t_stats == 1){
validate(
need(t_stats == 1, "Con un sólo grupo no se puede hacer estadística")
)
}else{
return(
t_stats %>%
flextable() %>%
@@ -185,6 +199,7 @@ server <- function(input, output) {
) %>%
htmltools_value()
}
}
})
output$expPlotUI<- renderUI({