PatientLevelPrediction icon indicating copy to clipboard operation
PatientLevelPrediction copied to clipboard

Shiny App crashes after attempting to viewPlp report

Open iamalonso opened this issue 4 months ago • 2 comments

Describe the bug

After successfully loading a patient-level prediction (PLP) evaluation using the loadPlpResult function, attempting to view the report in the Shiny App results in two different behaviors:

  • Shiny App opens and then closes abruptly.
  • When accessing the Shiny App through a web browser, clicking the "View Report" option within the "Actions" section results in a blank gray screen.

The error from the R console is:

Listening on http://127.0.0.1:6603
Warning: Ignoring explicitly provided widget ID "resultDataFiltered"; Shiny doesn't use themWarning: Ignoring explicitly provided widget ID "resultDataFiltered"; Shiny doesn't use themWarning: Error in .make_numeric_version: invalid non-character version specification 'x' (type: double)  4: shiny::runApp
  3: ShinyAppBuilder::viewShiny [/private/var/folders/1b/3plyy51n7yq4l71722c2xvl80000gn/T/RtmpEasC7f/R.INSTALL1224721efe5df/OHDSI-ShinyAppBuilder-9360b5f/R/ViewShiny.R#138]
  2: viewPlps [/private/var/folders/1b/3plyy51n7yq4l71722c2xvl80000gn/T/RtmpawxSw7/R.INSTALL57313205f01d/PatientLevelPrediction/R/ViewShinyPlp.R#168]
  1: viewPlp [/private/var/folders/1b/3plyy51n7yq4l71722c2xvl80000gn/T/RtmpawxSw7/R.INSTALL57313205f01d/PatientLevelPrediction/R/ViewShinyPlp.R#71]

chrome-capture-2024-10-21

Set up (please run in R "sessionInfo()" and copy the output here):

> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin20

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] shiny_1.9.1                  memuse_4.2-3                 ResultModelManager_0.5.11    R6_2.5.1                     PatientLevelPrediction_6.3.9 FeatureExtraction_3.7.1     
[7] Andromeda_0.6.6              dplyr_1.1.4                  DatabaseConnector_6.3.2     

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1        viridisLite_0.4.2       blob_1.2.4              fastmap_1.2.0           lazyeval_0.2.2          promises_1.3.0          digest_0.6.37           mime_0.12              
 [9] lifecycle_1.0.4         processx_3.8.4          RSQLite_2.3.7           magrittr_2.0.3          compiler_4.4.1          rlang_1.1.4             sass_0.4.9              tools_4.4.1            
[17] utf8_1.2.4              yaml_2.3.10             data.table_1.16.2       knitr_1.48              htmlwidgets_1.6.4       bit_4.5.0               xgboost_1.7.8.1         withr_3.0.1            
[25] purrr_1.0.2             shinyWidgets_0.8.7      grid_4.4.1              fansi_1.0.6             xtable_1.8-4            colorspace_2.1-1        ggplot2_3.5.1           scales_1.3.0           
[33] cli_3.6.3               crayon_1.5.3            rmarkdown_2.28          generics_0.1.3          rstudioapi_0.17.0       httr_1.4.7              tzdb_0.4.0              DBI_1.2.3              
[41] cachem_1.1.0            drat_0.2.4              ShinyAppBuilder_3.1.0   vctrs_0.6.5             Matrix_1.7-0            jsonlite_1.8.9          tippy_0.1.0             hms_1.1.3              
[49] bit64_4.5.2             ParallelLogger_3.3.1    crosstalk_1.2.1         plotly_4.10.4           fontawesome_0.5.2       jquerylib_0.1.4         tidyr_1.3.1             glue_1.8.0             
[57] reactR_0.6.1            ps_1.8.0                rJava_1.0-11            gtable_0.3.5            later_1.3.2             shinycssloaders_1.1.0   shinydashboard_0.7.2    pool_1.0.4             
[65] munsell_0.5.1           tibble_3.2.1            pillar_1.9.0            htmltools_0.5.8.1       reactable_0.4.4         dbplyr_2.5.0            evaluate_1.0.1          lattice_0.22-6         
[73] readr_2.1.5             backports_1.5.0         OhdsiShinyModules_3.1.0 memoise_2.0.1           renv_1.0.7              httpuv_1.6.15           bslib_0.8.0             Rcpp_1.0.13            
[81] checkmate_2.3.2         SqlRender_1.19.0        xfun_0.48               pkgconfig_2.0.3 

To Reproduce

The code:

library(FeatureExtraction)
library(PatientLevelPrediction)
library(ResultModelManager)

outputFolder = "~/My path ot the model"
gmbResult = loadPlpResult(file.path(outputFolder, '1', 'plpResult'))
viewPlp(gmbResult)

In the Shiny app or the web browser:

  1. Navigate to the prediction section
  2. Select the target, outcome cohort, click "Generate Report"
  3. Select "View Report" from the "Actions" section.

PLP Log File The "PLP Log File" doesn't apply in this case.

Additional context This issue occurs when attempting to view a previously loaded PLP evaluation, not when running the PatientLevelPrediction package directly.

iamalonso avatar Oct 21 '24 09:10 iamalonso