Commit 3870e872 authored by dmattek's avatar dmattek

Modified alerts

parent c61fd0c1
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
# #
# This module is a tab for hierarchical clustering (base R hclust + dist) # This module is a tab for hierarchical clustering (base R hclust + dist)
helpText.clHier = c(alertNAsPresentDTW = paste0("NAs present. DTW cannot calculate the distance. ", helpText.clHier = c(alertNAsPresentClDTW = paste0("NAs (still) present. DTW cannot calculate the distance. ",
"Consider interpolation of NAs and missing data in the left panel."), "If interpolation is active in the left panel, missing data can be due to removed outlier time points."),
alertNAsPresent = paste0("NAs present. The selected distance measure will work, ", alertNAsPresentCl = paste0("NAs (still) present, caution recommended. If interpolation is active in the left panel, missing data can be due to removed outlier time points."))
"however caution is recommended. Consider interpolation of NAs and missing data the left panel."))
# UI ---- # UI ----
...@@ -281,24 +280,24 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -281,24 +280,24 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
# from missing rows that cause NAs to appear when convertinf from long to wide (dcast) # from missing rows that cause NAs to appear when convertinf from long to wide (dcast)
if(sum(is.na(loc.dm)) > 0) { if(sum(is.na(loc.dm)) > 0) {
if (input$selectPlotHierDiss == "DTW") { if (input$selectPlotHierDiss == "DTW") {
createAlert(session, "alertAnchorClHierNAsPresent", "alertNAsPresentDTW", title = "Error", createAlert(session, "alertAnchorClHierNAsPresent", "alertNAsPresentClDTW", title = "Error",
content = helpText.clHier[["alertNAsPresentDTW"]], content = helpText.clHier[["alertNAsPresentClDTW"]],
append = FALSE, append = FALSE,
style = "danger") style = "danger")
closeAlert(session, 'alertNAsPresent') closeAlert(session, 'alertNAsPresentCl')
return(NULL) return(NULL)
} else { } else {
createAlert(session, "alertAnchorClHierNAsPresent", "alertNAsPresent", title = "Warning", createAlert(session, "alertAnchorClHierNAsPresent", "alertNAsPresentCl", title = "Warning",
content = helpText.clHier[["alertNAsPresent"]], content = helpText.clHier[["alertNAsPresentCl"]],
append = FALSE, append = FALSE,
style = "warning") style = "warning")
closeAlert(session, 'alertNAsPresentDTW') closeAlert(session, 'alertNAsPresentClDTW')
} }
} else { } else {
closeAlert(session, 'alertNAsPresentDTW') closeAlert(session, 'alertNAsPresentClDTW')
closeAlert(session, 'alertNAsPresent') closeAlert(session, 'alertNAsPresentCl')
} }
...@@ -506,7 +505,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -506,7 +505,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
loc.dend = isolate(userFitDendHier()) loc.dend = isolate(userFitDendHier())
validate( validate(
need(!is.null(loc.dm), "Nothing to plot. Load data first!"), need(!is.null(loc.dm), "Nothing to plot. Load data first!"),
need(!is.null(loc.dend), "Did not create dendrogram") need(!is.null(loc.dend), "Could not create dendrogram")
) )
# Dummy dependency to redraw the heatmap without clicking Plot # Dummy dependency to redraw the heatmap without clicking Plot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment