diff --git a/.Rbuildignore b/.Rbuildignore index b821361..9ec40d8 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ ^nepExplorer\.Rcheck$ ^nepExplorer.*\.tar\.gz$ ^nepExplorer.*\.tgz$ +^LICENSE\.md$ diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 23171ad..61a7edf 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -44,7 +44,7 @@ jobs: - name: Upload test results if: failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-test-failures path: ${{ runner.temp }}/package diff --git a/DESCRIPTION b/DESCRIPTION index e01e85c..281f96e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,9 +21,7 @@ URL: https://github.com/SafetyGraphics/nepExplorer, https://safetygraphics.githu BugReports: https://github.com/SafetyGraphics/nepExplorer/issues Depends: R (>= 4.0) License: MIT + file LICENSE -Encoding: UTF-8 LazyData: true -RoxygenNote: 7.3.2 Imports: shiny, dplyr, @@ -40,4 +38,13 @@ Imports: shinyWidgets Suggests: safetyGraphics, - safetyData + safetyData, + knitr, + rmarkdown, + testthat (>= 3.0.0) +VignetteBuilder: + knitr +Config/testthat/edition: 3 +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.2 diff --git a/LICENSE b/LICENSE index 6192adc..918c83b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,2 @@ -MIT License - -Copyright (c) 2020 SafetyGraphics - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +YEAR: 2025 +COPYRIGHT HOLDER: nepExplorer authors diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..3f33129 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# MIT License + +Copyright (c) 2025 nepExplorer authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/R/creatinine_data_fcn.R b/R/creatinine_data_fcn.R index 8978c60..2d0b78a 100644 --- a/R/creatinine_data_fcn.R +++ b/R/creatinine_data_fcn.R @@ -52,17 +52,16 @@ creatinine_data_fcn <- function(df, settings) { left_join(baseline_creat, by = settings$id_col) %>% filter(.data[[settings$baseline_flag]] != settings$baseline_values) - get_highest_stage <- function(vector_of_stages) { - if ("Stage 3" %in% vector_of_stages) { - return("Stage 3") - } else if ("Stage 2" %in% vector_of_stages) { - return("Stage 2") - } else if ("Stage 1" %in% vector_of_stages) { - return("Stage 1") - } else { - "Stage 0" + stages <- c("Stage 3", "Stage 2", "Stage 1", "Stage 0") + + for (stage in stages) { + if (stage %in% vector_of_stages) { + return(stage) + } } + + "Stage 0" } #get highest stage by subject @@ -74,11 +73,8 @@ creatinine_data_fcn <- function(df, settings) { ) - return( list( patient_level_stages = patient_level_stages, creatine_level_data = processed_creatinine_data ) - ) - } diff --git a/R/creatinine_scatter_mod.R b/R/creatinine_scatter_mod.R index 61eb5de..f7eb062 100644 --- a/R/creatinine_scatter_mod.R +++ b/R/creatinine_scatter_mod.R @@ -109,7 +109,7 @@ function(el, x) { animation_time_unit = animation_time_unit()) %>% onRender(update_color_js) }) - return(processed_creatinine_data) + processed_creatinine_data } ) diff --git a/R/init_nepExplorer.R b/R/init_nepExplorer.R index cc1bc1b..8294744 100644 --- a/R/init_nepExplorer.R +++ b/R/init_nepExplorer.R @@ -33,5 +33,5 @@ init_nepExplorer <- function(data, settings) { by = c(settings[["labs"]][["id_col"]], settings[["labs"]][["treatment_col"]])) - return(list(data = anly, settings = settings)) + list(data = anly, settings = settings) } diff --git a/R/nepexplorerMod.R b/R/nepexplorerMod.R index 74bd745..f7cef0f 100644 --- a/R/nepexplorerMod.R +++ b/R/nepexplorerMod.R @@ -68,7 +68,7 @@ nepexplorer_ui <- function(id) { fluid = TRUE ) - return(ui) + ui } diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..865e3b7 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,91 @@ + + +
+ + + + +YEAR: 2025 +COPYRIGHT HOLDER: nepExplorer authors ++ +
Copyright (c) 2025 nepExplorer authors
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+devtools::install_github("safetyGraphics/nepExplorer", ref = "main")A comprehensive mapping helps nepExplorer correctly interpret your +clinical trial datasets. To ensure your data is compatible with +nepExplorer and you can effectively utilize its features, please see the +following link for detailed information about required data domains, +data format, and specific column requirements: Data +and Settings Guidelines. This resource provides a comprehensive +guide to preparing your data for analysis and visualization within +nepExplorer.
+
+custom_map <- list(
+ vitals = list(
+ "id_col" = "USUBJID", # Unique subject identifier
+ "treatment_col" = "ARM", # Treatment arm
+ "measure_col" = "TEST", # Vitals measure variable
+ "value_col" = "VSSTRESN", # Vitals result value
+ "unit_col" = "VSSTRESU", # Unit of measure
+ "visit_col" = "VISIT", # Visit name
+ "visitn_col" = "VISITNUM", # Visit number
+ "studyday_col" = "VSDY", # Study day
+ "vs_baseline_flag" = "ABLFL", # Baseline flag column
+ "vs_baseline_values" = "Y", # Baseline value
+ "measure_values" = list(
+ "SYSBP" = "Systolic Blood Pressure (mmHg)",
+ "DIABP" = "Diastolic Blood Pressure (mmHg)"
+ )
+ ),
+ labs = list(
+ "id_col" = "USUBJID",
+ "treatment_col" = "ARM",
+ "measure_col" = "LBTEST",
+ "value_col" = "LBSTRESN",
+ "unit_col" = "LBSTRESU",
+ "studyday_col" = "LBDY",
+ "visit_col" = "VISIT",
+ "visitn_col" = "VISITNUM",
+ "baseline_flag" = "LBBLFL",
+ "baseline_values" = list("Y" = "Y"),
+ "measure_values" = list(
+ "ALB" = "Albumin (mg/dL)",
+ "ALB/CREAT" = "Albumin/Creatinine",
+ "BICARB" = "Bicarbonate (umol/L)",
+ "BUN" = "Blood Urea Nitrogen (mmol/L)",
+ "BUN/CREAT" = "Blood Urea Nitrogen/Creatinine",
+ "CA" = "Calcium (mmol/L)",
+ "CL" = "Chloride (mmol/L)",
+ "CREAT" = "Creatinine (mg/dL)",
+ "CYSTC" = "Cystatin C (umol/L)",
+ "eGFR" = "eGFR (mL/min)",
+ "eGFRcys" = "eGFRcys (mL/min)",
+ "PHOS" = "Phosphate (mmol/L)",
+ "K" = "Potassium (mmol/L)",
+ "SODIUM" = "Sodium (mmol/L)"
+ )
+ ),
+ dm = list(
+ "id_col" = "USUBJID",
+ "treatment_col" = "ARM"
+ )
+)
+create_nepexplorer_app(
+ data = list(
+ dm = nepExplorer::adsl, # Demographic data
+ labs = nepExplorer::adlb, # Laboratory measurements
+ vitals = nepExplorer::advs # Vital signs
+ ),
+ mapping = custom_map
+)id_col: Unique subject identifiermeasure_col: Measurement type columnvalue_col: Numeric result columnunit_col: Measurement unitsvisit_col: Visit namevisitn_col: Visit numberstudyday_col: Study daybaseline_flag: Baseline identification columnbaseline_values: Value in baseline_flag
+column indicating a baseline recordCreatinine: Creatinine is a required lab test collected
+in measure_col. It must be in conventional units.This nepExplorer charts can be added to the {safetyGraphics} shiny +app, which allows us to create the charts with any mappings/data +combination loaded in the app. The configuration will be captured in a +YAML file.
+env: safetyGraphics
+label: Nep Explorer - Module
+name: nepexplorerMod
+type: module
+package: nepExplorer
+order: 9
+domain:
+ - labs
+- vitals
+- dm
+workflow:
+ ui: nepexplorer_ui
+server: nepexplorer_server
+links:
+ nepExplorer: https://github.com/SafetyGraphics/nep-explorerWith the nepExplorer loaded in to our session and the configuration +file saved in our working directory as nepExplorer.yaml, we can add the +charts to the safetyGraphics application as follows:
+
+library(nepExplorer)
+
+library(yaml)
+
+charts <- c(
+ safetyGraphics::makeChartConfig(),
+ safetyGraphics::makeChartConfig(
+ packages = "nepExplorer",
+ packageLocation = "./inst/config", # location of nepExplorer.yaml file
+ sourceFiles = TRUE
+ )
+)
+
+charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer
+
+safetyGraphics::safetyGraphicsApp(
+ domainData = list(
+ labs = safetyData::adam_adlbc,
+ dm = safetyData::adam_adsl,
+ vitals = safetyData::adam_advs
+ ),
+ charts = charts
+)After launching the safetyGraphics app with nepExplorer +integration:
+Navigate to the Mapping tab in the user interface
Configure the following required mappings:
All required variables must be correctly mapped for nepExplorer +visualizations to work properly. Refer to the detailed +mapping guidelines for specific requirements.
+After completing the mapping, switch to the Charts tab to view the +nepExplorer visualizations
+
For a complete tutorial on safetyGraphics mappings, see the safetyGraphics +ChartConfiguration.
+