plots in OPTIMIZE improved
Build and deploy Roxygen2|pkgdown documentation site / build-and-deploy-documentation (push) Successful in 47s
run tests / build-and-deploy-documentation (push) Successful in 8s

This commit is contained in:
2026-06-07 22:35:43 +02:00
parent abf02ef4ec
commit 5071896110
+235 -203
View File
@@ -15,10 +15,13 @@ library(purrr)
library(gslnls) library(gslnls)
library(tidyverse) library(tidyverse)
library(ggplot2) library(ggplot2)
library(ggExtra)
library(gtable)
library(reshape2) library(reshape2)
library(openxlsx) library(openxlsx)
library(DT) library(DT)
library(ggpubr) library(ggpubr)
library(grid)
library(gridExtra) library(gridExtra)
library(drc) library(drc)
library(twopartm) library(twopartm)
@@ -583,17 +586,16 @@ server <- function(input, output, session) {
box( box(
title = "Upload multiple worksheets", status = "warning", solidHeader = TRUE, width = 12, "Please upload your EXCEL file here", title = "Upload multiple worksheets", status = "warning", solidHeader = TRUE, width = 12, "Please upload your EXCEL file here",
fileInput("MiFile", "", accept = ".xlsx") fileInput("MiFile", "", accept = ".xlsx")
) ),
sliderInput("dilslider", "Adjust the dilutions(+-change in %)", min = -100,max=100, value=0, step=1, round=0),
checkboxInput("fixupper","Fix highest concentration (if unticked, the center is fixed)",FALSE)
) )
), ),
mainPanel( mainPanel(
tabsetPanel( tabsetPanel(
id = "tabs", id = "tabs",
tabPanel("4pl", tabPanel("4pl",
box(
title = "ANOVA table", status = "primary", solidHeader = TRUE, width = 12,
tableOutput("Anovatab")
),
column(12, column(12,
# h3("Confidence intervals"), # h3("Confidence intervals"),
@@ -605,41 +607,43 @@ server <- function(input, output, session) {
plotOutput("sigPlotTEST"), plotOutput("sigPlotTEST"),
#selectInput(inputId = "scenario", label = "Select an 'optimal' scenario:", choices = c("scenario 2", "scenario 3", "scenario 6", "steep slope")) #selectInput(inputId = "scenario", label = "Select an 'optimal' scenario:", choices = c("scenario 2", "scenario 3", "scenario 6", "steep slope"))
plotOutput("plotfordilutions"), )),
# h4("in grey: most extreme bend point lines of theoretical samples with 50% and 200% potency"), tabPanel("Dilution slider",
# sliderInput("dilslider", "Adjust the dilutions(+-change in %)", min = -100, max = 100, value = 0, step = 1, round = 0), h4("Adjust the dilutions"),
# checkboxInput("fixupper", "Fix highest concentration (if unticked, the center is fixed)", FALSE), plotOutput("plotfordilutions"),
# h5("Dilution factors"), h5("Dilution factors"),
# tableOutput("adjlogdil"), box(
# "Short guidance: wider dilution ranges increase the CIs of rel. potency, and decrease the CIs of upper and lower asymptote ratios, as well as Hill's slope ratios", br(), title = "Adjusted dilutions", status = "primary", solidHeader = TRUE, width = 12, collapsible = TRUE,
# "Narrower dilution ranges decrease the CIs of rel. potency, and increase the CIs of upper and lower asymptote ratios, ands Hill's slope ratios", tableOutput("adjlogdil")
),
"Short guidance: wider dilution ranges increase the CIs of rel. potency, and decrease the CIs of upper and lower asymptote ratios, as well as Hill's slope ratios", br(),
"Narrower dilution ranges decrease the CIs of rel. potency, and increase the CIs of upper and lower asymptote ratios, ands Hill's slope ratios",
),
column(
3,
h3("Bend points"),
tableOutput("bps"),
tableOutput("extremebps"),
h4("Explanation of the plots")
)
), ),
tabPanel("Histograms", tabPanel("Histograms",
h4("Histograms of parameters"), h4("Histograms of parameters"),
plotOutput("histCIs"), plotOutput("histCIs"),
plotOutput("histEC50REF"), column(6,
plotOutput("histLasREF"), plotOutput("histEC50REF"),
plotOutput("histUasREF"), plotOutput("histLasREF"),
plotOutput("histUasREF")
),
column(6,
plotOutput("histEC50TEST"),
plotOutput("histLasTEST"),
plotOutput("histUasTEST")
)
), ),
tabPanel( tabPanel(
"Report", "Report",
h4("Settings for report") h4("Settings for report"))
)
) )
) ) # main panel
) ) # sidebar Layout
) ) # tabpanel
) ) # navbarPage
}) })
@@ -696,7 +700,7 @@ server <- function(input, output, session) {
reset(id = "") # from shinyjs package reset(id = "") # from shinyjs package
}) })
#### input optim XL file ----
observe({ observe({
if (!is.null(input$MiFile)) { if (!is.null(input$MiFile)) {
MinFile <- input$MiFile MinFile <- input$MiFile
@@ -2114,7 +2118,7 @@ server <- function(input, output, session) {
#### Dilutions Simulator ---- #### Dilutions Simulator ----
output$plotfordilutions <- renderPlot({ observe({
if (!is.null(Dat$Mws)) { if (!is.null(Dat$Mws)) {
@@ -2125,55 +2129,55 @@ server <- function(input, output, session) {
for (N_WS in 1:length(AllXL)) { for (N_WS in 1:length(AllXL)) {
datWS <- as.data.frame(AllXL[[N_WS]]) datWS <- as.data.frame(AllXL[[N_WS]])
cn <- colnames(datWS) cn <- colnames(datWS)
logI <- grep("log|ln", cn) logI <- grep("log|ln", cn)
logDoseI <- grep("log_dose", cn) logDoseI <- grep("log_dose", cn)
if (length(logI) > 0 & length(logDoseI) == 0) { if (length(logI) > 0 & length(logDoseI) == 0) {
datWS$log_dose <- datWS[, logI] datWS$log_dose <- datWS[, logI]
datWS2 <- datWS[, -logI] datWS2 <- datWS[, -logI]
CORro <- cor(datWS$log_dose, datWS[, 3]) CORro <- cor(datWS$log_dose, datWS[, 3])
} else if (length(logI) == 0 & length(logDoseI) == 0) { } else if (length(logI) == 0 & length(logDoseI) == 0) {
Ind <- grep(".ilution|.ose|.onc", cn) Ind <- grep(".ilution|.ose|.onc", cn)
datWS$log_dose <- log(datWS[, Ind]) datWS$log_dose <- log(datWS[, Ind])
CORro <- cor(datWS[, Ind], datWS[, 3]) CORro <- cor(datWS[, Ind], datWS[, 3])
datWS2 <- datWS[, -Ind] datWS2 <- datWS[, -Ind]
} else if (length(logI) > 0 & length(logDoseI) > 0) { } else if (length(logI) > 0 & length(logDoseI) > 0) {
datWS2 <- datWS datWS2 <- datWS
CORro <- cor(datWS[, logI], datWS[, 3]) CORro <- cor(datWS[, logI], datWS[, 3])
} }
Dat$datWS2 <- datWS2 Dat$datWS2 <- datWS2
FITs <- Fitting_FUNC(datWS2, TransFlag = F) FITs <- Fitting_FUNC(datWS2, TransFlag = F)
pot_est <- FITs[[3]] pot_est <- FITs[[3]]
potEstL[[N_WS]] <- pot_est potEstL[[N_WS]] <- pot_est
potU_est <- FITs[[4]] potU_est <- FITs[[4]]
# unrestricted # unrestricted
SU_mu <- FITs[[2]] SU_mu <- FITs[[2]]
URMcoefs1 <- SU_mu$coefficients URMcoefs1 <- SU_mu$coefficients
URMcoefs <- t(matrix(unlist(URMcoefs1[,1]))) URMcoefs <- t(matrix(unlist(URMcoefs1[,1])))
URMcoefs_ <- cbind(AllSheets[[N_WS]], URMcoefs) URMcoefs_ <- cbind(AllSheets[[N_WS]], URMcoefs)
URMcoefsL[[N_WS]] <- URMcoefs_ URMcoefsL[[N_WS]] <- URMcoefs_
SU_mr <- FITs[[1]] SU_mr <- FITs[[1]]
RMcoefs1 <- SU_mr$coefficients RMcoefs1 <- SU_mr$coefficients
RMcoefs <- t(matrix(unlist(RMcoefs1[,1]))) RMcoefs <- t(matrix(unlist(RMcoefs1[,1])))
RMcoefs_ <- cbind(AllSheets[[N_WS]], RMcoefs) RMcoefs_ <- cbind(AllSheets[[N_WS]], RMcoefs)
RMcoefsL[[N_WS]] <- RMcoefs_ RMcoefsL[[N_WS]] <- RMcoefs_
X <- seq(min(datWS2$log_dose), max(datWS2$log_dose), 0.1) X <- seq(min(datWS2$log_dose), max(datWS2$log_dose), 0.1)
sigRef <- URMcoefs[1,1] + (URMcoefs[1,3]-URMcoefs[1,1])/(1+exp(URMcoefs[1,2]*(URMcoefs[1,4]-X))) sigRef <- URMcoefs[1,1] + (URMcoefs[1,3]-URMcoefs[1,1])/(1+exp(URMcoefs[1,2]*(URMcoefs[1,4]-X)))
sigTest1 <- URMcoefs[1,5] + (URMcoefs[1,7]-URMcoefs[1,5])/(1+exp(URMcoefs[1,6]*(URMcoefs[1,4] - URMcoefs[1,8]-X))) sigTest1 <- URMcoefs[1,5] + (URMcoefs[1,7]-URMcoefs[1,5])/(1+exp(URMcoefs[1,6]*(URMcoefs[1,4] - URMcoefs[1,8]-X)))
#browser() #browser()
dfPlotsigRef <- data.frame(X=X, sigRef = sigRef, Sheet = AllSheets[[N_WS]]) dfPlotsigRef <- data.frame(X=X, sigRef = sigRef, Sheet = AllSheets[[N_WS]])
dfPlotsigTest <- data.frame(X=X, sigTest = sigTest1, Sheet = AllSheets[[N_WS]]) dfPlotsigTest <- data.frame(X=X, sigTest = sigTest1, Sheet = AllSheets[[N_WS]])
if (!exists("SIGrefDF")) SIGrefDF <- dfPlotsigRef else SIGrefDF <- rbind(SIGrefDF, dfPlotsigRef) if (!exists("SIGrefDF")) SIGrefDF <- dfPlotsigRef else SIGrefDF <- rbind(SIGrefDF, dfPlotsigRef)
if (!exists("SIGtestDF")) SIGtestDF <- dfPlotsigTest else SIGtestDF <- rbind(SIGtestDF,dfPlotsigTest) if (!exists("SIGtestDF")) SIGtestDF <- dfPlotsigTest else SIGtestDF <- rbind(SIGtestDF,dfPlotsigTest)
} #for N_WS } #for N_WS
@@ -2205,18 +2209,83 @@ server <- function(input, output, session) {
x_UA <- max(X); x_LA <- min(X) x_UA <- max(X); x_LA <- min(X)
} else { x_UA <- min(X); x_LA <- max(X) } } else { x_UA <- min(X); x_LA <- max(X) }
#browser()
BoxDF <- data.frame(EC50REF = EC50REF, EC50TEST = EC50TEST, LasREF = LasREF, UasREF = UasREF)
p1 <- ggplot(SIGrefDF, aes(x=X, y=sigRef, col=as.factor(Sheet))) + p1 <- ggplot(SIGrefDF, aes(x=X, y=sigRef, col=as.factor(Sheet))) +
geom_line() + geom_line() +
annotate("text", label="x", x=x_UA, y=UasREF, alpha=0.2) + annotate("text", label="x", x=x_UA, y=UasREF, alpha=0.2) +
annotate("text", label="o", x=x_LA, y=LasREF, alpha=0.2) + annotate("text", label="o", x=x_LA, y=LasREF, alpha=0.2) +
geom_vline(xintercept = EC50REF, alpha = 0.2) + geom_vline(xintercept = EC50REF, alpha = 0.2) +
scale_x_continuous(expand = c(0, 0)) +
scale_y_continuous(expand = c(0, 0)) +
expand_limits(y = c(min(SIGrefDF$sigRef) - 0.1 * diff(range(SIGrefDF$sigRef)),
max(SIGrefDF$sigRef) + 0.1 * diff(range(SIGrefDF$sigRef)))) +
expand_limits(x = c(min(SIGrefDF$X) - 0.1 * diff(range(SIGrefDF$X)),
max(SIGrefDF$X) + 0.1 * diff(range(SIGrefDF$X)))) +
xlab("dilutions") + xlab("dilutions") +
ggtitle("Plot of all calculated reference fits (unrestricted model, in gray vertical lines: EC50)") + #ggtitle("Plot of all calculated reference fits (unrestricted model, in gray vertical lines: EC50)") +
theme_bw() + theme_bw() +
theme(axis.text = element_text(face = "bold", size = 15), theme(axis.text = element_text(face = "bold", size = 15),
plot.title = element_text(size = 15, face = "bold")) plot.title = element_text(size = 15, face = "bold"),
plot.margin = unit(c(0.2, 0.2, 0.5, 0.5), "lines"))
# Horizontal marginal boxplot - to appear at the top of the chart
pBox_hor <- ggplot( BoxDF, aes(x = factor(1), y = EC50REF)) +
geom_boxplot(outlier.colour = NA) +
geom_jitter(position = position_jitter(width = 0.05)) +
scale_y_continuous(expand = c(0, 0)) +
expand_limits(y = c(min(SIGrefDF$X) - 0.1 * diff(range(SIGrefDF$X)),
max(SIGrefDF$X) + 0.1 * diff(range(SIGrefDF$X)))) +
coord_flip() +
theme_bw() +
theme(axis.text = element_blank(),
axis.title = element_blank(),
axis.ticks = element_blank(),
plot.margin = unit(c(1, 0.2, -0.5, 0.5), "lines"))
output$sigPlotREF <- renderPlot({ p1 }) # Vertical marginal boxplot - to appear at the right of the chart
pBox_ver <- ggplot(BoxDF, aes(x = factor(1), y = UasREF)) +
geom_boxplot(outlier.colour = NA) +
geom_jitter(position = position_jitter(width = 0.05)) +
scale_y_continuous(expand = c(0, 0)) +
expand_limits(y = c(min(SIGrefDF$sigRef) - 0.1 * diff(range(SIGrefDF$sigRef)),
max(SIGrefDF$sigRef) + 0.1 * diff(range(SIGrefDF$sigRef)))) +
theme_bw() +
theme(axis.text = element_blank(),
axis.title = element_blank(),
axis.ticks = element_blank(),
plot.margin = unit(c(0.2, 1, 0.5, -0.5), "lines"))
#browser()
gt1 <- ggplot_gtable(ggplot_build(p1))
gt2 <- ggplot_gtable(ggplot_build(pBox_hor))
gt3 <- ggplot_gtable(ggplot_build(pBox_ver))
# Get maximum widths and heights
maxWidth <- unit.pmax(gt1$widths[2:3], gt2$widths[2:3])
maxHeight <- unit.pmax(gt1$heights[4:5], gt3$heights[4:5])
# Set the maximums in the gtables for gt1, gt2 and gt3
gt1$widths[2:3] <- as.list(maxWidth)
gt2$widths[2:3] <- as.list(maxWidth)
gt1$heights[4:5] <- as.list(maxHeight)
gt3$heights[4:5] <- as.list(maxHeight)
# Create a new gtable
gt <- gtable(widths = unit(c(7, 1), "null"), height = unit(c(1, 7), "null"))
# Instert gt1, gt2 and gt3 into the new gtable
gt <- gtable_add_grob(gt, gt1, 2, 1)
gt <- gtable_add_grob(gt, gt2, 1, 1)
gt <- gtable_add_grob(gt, gt3, 2, 2)
# grid.rect(x = 0.5, y = 0.5, height = 0.995, width = 0.995, default.units = "npc",
# gp = gpar(col = "black", fill = NA, lwd = 1))
# And render the plot
grid.newpage()
#browser()
output$sigPlotREF <- renderPlot({ grid.draw(gt) })
Dat$sigPlotREF <- p1 Dat$sigPlotREF <- p1
# #
@@ -2267,35 +2336,44 @@ server <- function(input, output, session) {
output$histUasREF <- renderPlot({ output$histUasREF <- renderPlot({
hist(UasREF, col="darkturquoise", border="white",main = 'Histogram of upper asymptotes REF') hist(UasREF, col="darkturquoise", border="white",main = 'Histogram of upper asymptotes REF')
}) })
output$histEC50TEST <- renderPlot({
hist(EC50TEST, col="steelblue", border="white", main = 'Histogram of EC50TEST')
})
output$histLasTEST <- renderPlot({
hist(LasTEST, col="violet", border="white",main = 'Histogram of lower asymptotes TEST')
})
output$histUasTEST <- renderPlot({
hist(UasTEST, col="darkturquoise", border="white",main = 'Histogram of upper asymptotes TEST')
})
Dat$histEC50REF <- hist(EC50REF, col="steelblue", border="white", main = 'Histogram of EC50REF') Dat$histEC50REF <- hist(EC50REF, col="steelblue", border="white", main = 'Histogram of EC50REF')
Dat$histLasREF <- hist(LasREF, col="violet", border="white", main = 'Histogram of EC50REF') Dat$histLasREF <- hist(LasREF, col="violet", border="white", main = 'Histogram of EC50REF')
Dat$histUasREF <- hist(UasREF, col="darkturquoise", border="white", main = 'Histogram of EC50REF') Dat$histUasREF <- hist(UasREF, col="darkturquoise", border="white", main = 'Histogram of EC50REF')
# dils <- tab$log_dose tab <- AllXL[[1]]
# min_y <- min(tab[, 1:3]) dils <- tab$log_dose
# max_y <- max(tab[, 1:3]) min_y <- min(tab[, 1:2])
# max_y <- max(tab[, 1:2])
# if (input$fixupper) {
# dils_av <- dils - max(dils) if (input$fixupper) {
# dils_av_ <- dils_av * (input$dilslider / 100 + 1) dils_av <- dils - max(dils)
# dils2 <- round(dils_av_ + max(dils), 4) dils_av_ <- dils_av * (input$dilslider / 100 + 1)
# dilfactors <- 1 / exp(dils2 - lag(dils2)) dils2 <- round(dils_av_ + max(dils), 4)
# } else { dilfactors <- 1 / exp(dils2 - lag(dils2))
# if (!is.null(Dat$cfordils)) { } else {
# av <- Dat$cfordils if (!is.null(EC50TEST)) {
# } else { av <- mean(EC50TEST, na.rm = TRUE)
# av <- (min(dils) + max(dils)) / 2 } else {
# } av <- (min(dils) + max(dils)) / 2
# dils_av <- dils - av }
# dils_avsc <- dils_av * (input$dilslider / 100 + 1) dils_av <- dils - av
# dils2 <- dils_avsc + av dils_avsc <- dils_av * (input$dilslider / 100 + 1)
# dilfactors <- 1 / exp(dils2 - lag(dils2)) dils2 <- dils_avsc + av
# } dilfactors <- 1 / exp(dils2 - lag(dils2))
}
Dat$newDils <- dils2
#Dat$newDils <- dils2
#sigmoid <- sigmoid() #sigmoid <- sigmoid()
@@ -2333,111 +2411,65 @@ server <- function(input, output, session) {
# #
# pl_df <- cbind(dils2, SAMPLE50, SAMPLE200) # pl_df <- cbind(dils2, SAMPLE50, SAMPLE200)
# #
#
# output$adjlogdil <- renderTable({
# adjlogdilfactors <- round(dilfactors, 3)
# adjlogdils <- round(dils2, 3)
# adjdils <- round(exp(dils2), 3)
# DilsTable <- data.frame(
# "adjusted ln(dilutions)" = adjlogdils,
# "adjusted ln_dilution_factors" = adjlogdilfactors,
# "adjusted dilutions" = adjdils
# )
# DilsTable
# })
# if (!is.null(Dat$p2)) { output$adjlogdil <- renderTable({
# p2 <- Dat$p2 adjlogdilfactors <- round(dilfactors, 3)
# p_dil <- p2 + adjlogdils <- round(dils2, 3)
# annotate("pointrange", x = dils2, y = rep(min_y, length(dils2)), xmin = min(dils2), xmax = max(dils2)) + adjdils <- round(exp(dils2), 3)
# annotate("text", x = dils2, y = rep(min_y + (max_y - min_y) * 0.05, length(dils2)), label = as.character(round(dils2, 3))) + DilsTable <- data.frame(
# annotate("text", "adjusted ln(dilutions)" = adjlogdils,
# x = dils2[-1] + (max(dils2) - min(dils2)) * 0.05, "adjusted ln_dilution_factors" = adjlogdilfactors,
# y = rep(min_y + (max_y - min_y) * 0.1, length(dils2[-1])), "adjusted dilutions" = adjdils
# label = as.character(round(dilfactors[-1], 3)) )
# ) + DilsTable
# geom_line( })
# data = as.data.frame(pl_df), aes(x = dils2, y = SAMPLE50), color = "grey15", linetype = 2,
# inherit.aes = F if (!is.null(p2)) {
# ) + #p2 <- Dat$p2
# geom_line( p_dil <- p2 +
# data = as.data.frame(pl_df), aes(x = dils2, y = SAMPLE200), color = "grey15", linetype = 2, annotate("pointrange", x = dils2, y = rep(min_y, length(dils2)), xmin = min(dils2), xmax = max(dils2)) +
# inherit.aes = F annotate("text", x = dils2, y = rep(min_y + (max_y - min_y) * 0.05, length(dils2)), label = as.character(round(dils2, 3))) +
# ) + annotate("text",
# geom_vline(xintercept = c(Xbend50, Xbend200), col = "grey15", linetype = 2) + x = dils2[-1] + (max(dils2) - min(dils2)) * 0.05,
# { y = rep(min_y + (max_y - min_y) * 0.1, length(dils2[-1])),
# if (input$scenario == "scenario 6") { label = as.character(round(dilfactors[-1], 3)))
# annotate("pointrange", # geom_line(
# x = optdils2, y = rep(min_y + (max_y - min_y) * 0.2, length(optdils2)), # data = as.data.frame(pl_df), aes(x = dils2, y = SAMPLE50), color = "grey15", linetype = 2,
# xmin = min(optdils2), xmax = max(optdils2), color = "seagreen" # inherit.aes = F
# ) # ) +
# } # geom_line(
# } + # data = as.data.frame(pl_df), aes(x = dils2, y = SAMPLE200), color = "grey15", linetype = 2,
# { # inherit.aes = F
# if (input$scenario == "scenario 6") { # ) +
# annotate("text", # geom_vline(xintercept = c(Xbend50, Xbend200), col = "grey15", linetype = 2) +
# x = optdils2, y = rep(min_y + (max_y - min_y) * 0.25, length(optdils2)), # { if (input$scenario == "scenario 6") {
# label = as.character(round(optdils2, 3)), color = "seagreen" # annotate("pointrange",
# ) # x = optdils2, y = rep(min_y + (max_y - min_y) * 0.2, length(optdils2)),
# } # xmin = min(optdils2), xmax = max(optdils2), color = "seagreen"
# } + # )
# { # }
# if (input$scenario == "scenario 2") { # } +
# annotate("pointrange", # {
# x = optdils, y = rep(min_y + (max_y - min_y) * 0.2, length(optdils)), # if (input$scenario == "scenario 6") {
# xmin = min(optdils), xmax = max(optdils), color = "seagreen" # annotate("text",
# ) # x = optdils2, y = rep(min_y + (max_y - min_y) * 0.25, length(optdils2)),
# } # label = as.character(round(optdils2, 3)), color = "seagreen"
# } + # )
# { # }
# if (input$scenario == "scenario 2") { # } +
# annotate("text",
# x = optdils, y = rep(min_y + (max_y - min_y) * 0.25, length(optdils)),
# label = as.character(round(optdils, 3)), color = "seagreen" # annotate("text",
# ) # x = optdils[1], y = (max_y + min_y) * 0.5,
# } # label = paste("in green: optimal \n dilutions acc. to Whitepaper\n", input$scenario), color = "seagreen",
# } + # size = 14 / .pt, fontface = "bold"
# { # )
# if (input$scenario == "scenario 3") { output$plotfordilutions <- renderPlot({
# annotate("pointrange", print(p_dil)
# x = optdils_3, y = rep(min_y + (max_y - min_y) * 0.2, length(optdils_3)), })
# xmin = min(optdils_3), xmax = max(optdils_3), color = "seagreen"
# ) } # if (!is.null(p2))
# } } # if !is.null Dat$Mws
# } +
# {
# if (input$scenario == "scenario 3") {
# annotate("text",
# x = optdils_3, y = rep(min_y + (max_y - min_y) * 0.25, length(optdils_3)),
# label = as.character(round(optdils_3, 3)), color = "seagreen"
# )
# }
# } +
# {
# if (input$scenario == "steep slope") {
# annotate("pointrange",
# x = optdils3, y = rep(min_y + (max_y - min_y) * 0.2, length(optdils3)),
# xmin = min(optdils3), xmax = max(optdils3), color = "seagreen"
# )
# }
# } +
# {
# if (input$scenario == "steep slope") {
# annotate("text",
# x = optdils3, y = rep(min_y + (max_y - min_y) * 0.25, length(optdils3)),
# label = as.character(round(optdils3, 3)), color = "seagreen"
# )
# }
# } +
# annotate("text",
# x = optdils[1], y = (max_y + min_y) * 0.5,
# label = paste("in green: optimal \n dilutions acc. to Whitepaper\n", input$scenario), color = "seagreen",
# size = 14 / .pt, fontface = "bold"
# )
# }
#print(p_dil)
# }
}
}) })