From 6f5bd511220a699a5fd002ebffe7c680144b3242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zxBIB=20Lech=C3=B3n=2CMiguel=20=28MED=20BDS=29=20EXTERNAL?= Date: Tue, 3 Sep 2024 15:34:37 +0200 Subject: [PATCH 1/5] Ignore local vim configuration. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c706a3d..5421541 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode +.vimlocal .Rproj.user .Rhistory *.Rproj From 1533ae18b9cbaaa550bd0f687e685cc85ed735a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zxBIB=20Lech=C3=B3n=2CMiguel=20=28MED=20BDS=29=20EXTERNAL?= Date: Tue, 3 Sep 2024 15:44:44 +0200 Subject: [PATCH 2/5] Correlation heatmap: Improved error checking and clear feedback for repeat input records. --- NEWS.md | 5 +++++ R/mod_corr_hm.R | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index b1df3c5..339d01e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# dv.explorer.parameter 0.0.6 + +* Correlation heatmap: + * Provide clear error message when handed records with identical subject IDs, category, parameter and visit values. + # dv.explorer.parameter 0.0.5 * First Github release diff --git a/R/mod_corr_hm.R b/R/mod_corr_hm.R index cdf3391..e3753ed 100644 --- a/R/mod_corr_hm.R +++ b/R/mod_corr_hm.R @@ -60,7 +60,11 @@ CH_MSG <- poc( # nolint N_SUBJECT_EMPTY_RESPONSES = function(x) { paste(x, "subjects with empty responses!") }, - LESS_THAN_2_PARAMETER = "Please select at least 2 parameters" + LESS_THAN_2_PARAMETER = "Please select at least 2 parameters", + TOO_MANY_ROWS = paste( + "The dataset provided contains repeat rows with identical subject, category, parameter and", + "visit values. This module expects those to be unique. Here are the first few duplicates:" + ) ) ) # UI and server functions @@ -555,6 +559,21 @@ corr_hm_server <- function(id, ) checkmate::assert_factor(bm_dataset()[[VAR$SBJ]], .var.name = ns("bm_dataset"), add = ac) checkmate::reportAssertions(ac) + + supposedly_unique <- bm_dataset()[c(VAR$SBJ, VAR$CAT, VAR$PAR, VAR$VIS)] + dups <- duplicated(supposedly_unique) + shiny::validate( + shiny::need( + !any(dups), + paste0( + c( + CH_MSG$VALIDATE$TOO_MANY_ROWS, + capture.output(print(head(supposedly_unique[dups, ], 5))) + ) + ) + ) + ) + bm_dataset() }, label = ns("v_ch_dataset") From ca22e76fa2c00e49d43301c835cffd9bdad3139a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zxBIB=20Lech=C3=B3n=2CMiguel=20=28MED=20BDS=29=20EXTERNAL?= Date: Tue, 3 Sep 2024 15:47:16 +0200 Subject: [PATCH 3/5] Lineplot: Prevent gratuitous error message at startup. --- NEWS.md | 3 +++ R/mod_lineplot.R | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 339d01e..e35d17f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # dv.explorer.parameter 0.0.6 +* Lineplot: + * Prevent false-positive opaque error message at module startup. + * Correlation heatmap: * Provide clear error message when handed records with identical subject IDs, category, parameter and visit values. diff --git a/R/mod_lineplot.R b/R/mod_lineplot.R index ba6cfc9..f577cad 100644 --- a/R/mod_lineplot.R +++ b/R/mod_lineplot.R @@ -1084,11 +1084,8 @@ lineplot_server <- function(id, # nolint cyclomatic # Plot type it_relabel_button( id = LP_ID$PLOT_BUTTON, - label_if_valid = shiny::reactive({ - res <- centrality() - shiny::req(res) - res - }) + is_valid = shiny::reactive(test_not_empty(centrality())), + label_if_valid = shiny::reactive(centrality()) ) # Reactivity must be solved inside otherwise the function does not depend on the value From e3e0733c7b159bdb15fd9822ef861a4ec75b0ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zxBIB=20Lech=C3=B3n=2CMiguel=20=28MED=20BDS=29=20EXTERNAL?= Date: Tue, 3 Sep 2024 16:06:12 +0200 Subject: [PATCH 4/5] Bump package version. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9733733..fd7371e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: dv.explorer.parameter Type: Package Title: Parameter exploration modules -Version: 0.0.5 +Version: 0.0.6 Authors@R: c( person("Boehringer-Ingelheim Pharma GmbH & Co.KG", role = c("cph", "fnd")), person(given = "Luis", family = "Moris Fernandez", role = c("aut", "cre"), email = "luis.moris.fernandez@gmail.com"), From 7ffbd7c877fa111245fae3292e3667a55518f382 Mon Sep 17 00:00:00 2001 From: ml-ebs-ext <157474668+ml-ebs-ext@users.noreply.github.com> Date: Wed, 4 Sep 2024 10:04:48 +0200 Subject: [PATCH 5/5] Grammar tweak Co-authored-by: Korbinian Matthias <123395522+mattkorb@users.noreply.github.com> --- R/mod_corr_hm.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mod_corr_hm.R b/R/mod_corr_hm.R index e3753ed..db80b2e 100644 --- a/R/mod_corr_hm.R +++ b/R/mod_corr_hm.R @@ -62,7 +62,7 @@ CH_MSG <- poc( # nolint }, LESS_THAN_2_PARAMETER = "Please select at least 2 parameters", TOO_MANY_ROWS = paste( - "The dataset provided contains repeat rows with identical subject, category, parameter and", + "The dataset provided contains repeated rows with identical subject, category, parameter and", "visit values. This module expects those to be unique. Here are the first few duplicates:" ) )