Commit e20b40eb authored by dmattek's avatar dmattek

Fixes in help text

parent ceafd450
...@@ -6,7 +6,17 @@ ...@@ -6,7 +6,17 @@
helpText.clHier = c(alertNAsPresentClDTW = paste0("NAs (still) present. DTW cannot calculate the distance. ", helpText.clHier = c(alertNAsPresentClDTW = paste0("NAs (still) present. DTW cannot calculate the distance. ",
"If interpolation is active in the left panel, missing data can be due to removed outlier time points."), "If interpolation is active in the left panel, missing data can be due to removed outlier time points."),
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.")) 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."),
alLearnMore = paste0("<p>Clustering consists of two steps. First, a distance between all pairs ",
"of time series is calculated with one of the metrics, such as ",
"Euclidean (<a href=\"https://en.wikipedia.org/wiki/Euclidean_distance\" target=\"_blank\" title=\"External link\">L2 norm</a>) ",
"or Manhattan (<a href=\"https://en.wikipedia.org/wiki/Taxicab_geometry\" target=\"_blank\" title=\"External link\">L1 norm</a>) distance. ",
"<a href=\"https://en.wikipedia.org/wiki/Dynamic_time_warping\" target=\"_blank\" title=\"External link\">Dynamic Time Warping</a> (DTW) ",
"also quantifies similarity between two time series but ",
"contrary to other distance measures it accounts for the order of time points.</p>",
"<p>In the second step, distances are arranged hierarchicaly and visualised as a dendrogram ",
"using one of <a href=\"https://en.wikipedia.org/wiki/Hierarchical_clustering\" target=\"_blank\" title=\"External link\">linkage methods</a>.</p>"))
# UI ---- # UI ----
...@@ -18,12 +28,16 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") { ...@@ -18,12 +28,16 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") {
p("Standard approach using R's ", p("Standard approach using R's ",
a("dist", a("dist",
href = "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/dist.html", href = "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/dist.html",
title="External link"), title ="External link",
target = "_blank"),
" and ", " and ",
a("hclust", a("hclust",
href = "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/hclust.html", href = "https://stat.ethz.ch/R-manual/R-devel/library/stats/html/hclust.html",
title="External link"), title = "External link",
" functions."), target = "_blank"),
" functions. ",
actionLink(ns("alLearnMore"), "Learn more")
),
br(), br(),
fluidRow( fluidRow(
column(3, column(3,
...@@ -192,6 +206,8 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") { ...@@ -192,6 +206,8 @@ clustHierUI <- function(id, label = "Hierarchical Clustering") {
# SERVER ---- # SERVER ----
clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataStim) { clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataStim) {
ns <- session$ns
# Return the number of clusters from the slider # Return the number of clusters from the slider
# and delay by a constant in milliseconds defined in auxfunc.R # and delay by a constant in milliseconds defined in auxfunc.R
returnNclust = reactive({ returnNclust = reactive({
...@@ -200,8 +216,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -200,8 +216,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
# not functional; see th note in UI # not functional; see th note in UI
output$uiPlotHierClAss = renderUI({ output$uiPlotHierClAss = renderUI({
ns <- session$ns
if(input$chBPlotHierClAss) { if(input$chBPlotHierClAss) {
selectInput(ns('inPlotHierClAss'), 'Assign cluster order', selectInput(ns('inPlotHierClAss'), 'Assign cluster order',
choices = seq(1, returnNclust(), 1), choices = seq(1, returnNclust(), 1),
...@@ -211,9 +226,8 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -211,9 +226,8 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
}) })
output$uiPlotHierClSel = renderUI({ output$uiPlotHierClSel = renderUI({
ns <- session$ns
if(input$chBPlotHierClSel) {
if(input$chBPlotHierClSel) {
selectInput(ns('inPlotHierClSel'), 'Select clusters to display', selectInput(ns('inPlotHierClSel'), 'Select clusters to display',
choices = seq(1, returnNclust(), 1), choices = seq(1, returnNclust(), 1),
multiple = TRUE, multiple = TRUE,
...@@ -225,8 +239,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -225,8 +239,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
# UI for setting lower and upper bounds for heat map colour scale # UI for setting lower and upper bounds for heat map colour scale
output$uiSetColBoundsLow = renderUI({ output$uiSetColBoundsLow = renderUI({
ns <- session$ns
if(input$chBsetColBounds) { if(input$chBsetColBounds) {
loc.dt = in.dataLong() loc.dt = in.dataLong()
...@@ -244,8 +257,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -244,8 +257,7 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
output$uiSetColBoundsHigh = renderUI({ output$uiSetColBoundsHigh = renderUI({
ns <- session$ns
if(input$chBsetColBounds) { if(input$chBsetColBounds) {
loc.dt = in.dataLong() loc.dt = in.dataLong()
...@@ -642,6 +654,13 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS ...@@ -642,6 +654,13 @@ clustHier <- function(input, output, session, in.dataWide, in.dataLong, in.dataS
in.data = data4clDistPlot, in.data = data4clDistPlot,
in.colors = getClColHier, in.colors = getClColHier,
in.fname = createFnameDistPlot) in.fname = createFnameDistPlot)
# Pop-overs ----
addPopover(session,
ns("alLearnMore"),
title = "Hierarchical clustering",
content = helpText.clHier[["alLearnMore"]],
trigger = "click")
} }
\ No newline at end of file
...@@ -25,7 +25,8 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical Clustering") { ...@@ -25,7 +25,8 @@ clustHierSparUI <- function(id, label = "Sparse Hierarchical Clustering") {
"Sparse hierarchical clustering using ", "Sparse hierarchical clustering using ",
a("sparcl", a("sparcl",
href = "https://cran.r-project.org/web/packages/sparcl/", href = "https://cran.r-project.org/web/packages/sparcl/",
title="External link") title="External link",
target = "_blank")
), ),
p("Columns in the heatmap labeled according to their ", p("Columns in the heatmap labeled according to their ",
actionLink(ns("alImportance"), "importance.")), actionLink(ns("alImportance"), "importance.")),
......
...@@ -49,7 +49,8 @@ clustValidUI <- function(id, label = "Validation") { ...@@ -49,7 +49,8 @@ clustValidUI <- function(id, label = "Validation") {
"Cluster validation using ", "Cluster validation using ",
a("factoextra", a("factoextra",
href="https://cran.r-project.org/web/packages/factoextra/", href="https://cran.r-project.org/web/packages/factoextra/",
title="External link") title="External link",
target = "_blank")
), ),
actionLink(ns("alLearnMore"), "Learn more"), actionLink(ns("alLearnMore"), "Learn more"),
br(), br(),
......
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