diff --git a/.RData b/.RData deleted file mode 100644 index 48d9652..0000000 Binary files a/.RData and /dev/null differ diff --git a/.Rhistory b/.Rhistory deleted file mode 100644 index 22b81ba..0000000 --- a/.Rhistory +++ /dev/null @@ -1,512 +0,0 @@ -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -library(nepExplorer) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -if (!interactive()) { -sink(stderr(), type = "output") -tryCatch({ -library("nepExplorer") -}, error = function(e) { -devtools::load_all() -}) -} else { -devtools::load_all() -} -mapping <- list(labs = list("id_col" = "USUBJID", "measure_col" = "PARAM", -"measure_values" = list("CREAT" = "Creatinine", -"CYSTC" = "Cystatin C", -"eGFR" = "eGFR", -"eGFRcys" = "eGFRcys", -"Albumin/Creatinine" = "Albumin/Creatinine", -"BICARB" = "Bicarbonate", -"BUN" = "Blood Urea Nitrogen", -"CA" = "Calcium", -"CL" = "Chloride", -"PHOS" = "Phosphorus", -"K" = "Potassium", -"SODIUM" = "Sodium" -), -"value_col" = "STRESN", -"unit_col" = "STRESU", -"studyday_col" = "DY", -"visit_col" = "VISIT", -"visit_order_col" = "VISITN", -"baseline_flag" = "BLFL", -"baseline_values" = list("Y" = "TRUE"), -"normal_col_high" = "STNRHI", -"id_col" = "USUBJID", -"age_col" = "AGE", -"sex_col" = "SEX", -"race_col" = "RACE", -"treatment_col" = "ARM" -), -dm = list("id_col" = "USUBJID", "treatment_col" = "ARM"), -vitals = list("id_col" = "USUBJID", "treatment_col" = "ARM", "measure_col" = "PARAM", -"measure_values" = list("DIABP" = "Diastolic Blood Pressure", -"SYSBP" = "Systolic Blood Pressure" -) -) -) -mapping <- list(labs = list("id_col" = "USUBJID", "measure_col" = "PARAM", -"measure_values" = list("CREAT" = "Creatinine", -"CYSTC" = "Cystatin C", -"eGFR" = "eGFR", -"eGFRcys" = "eGFRcys", -"Albumin/Creatinine" = "Albumin/Creatinine", -"BICARB" = "Bicarbonate", -"BUN" = "Blood Urea Nitrogen", -"CA" = "Calcium", -"CL" = "Chloride", -"PHOS" = "Phosphorus", -"K" = "Potassium", -"SODIUM" = "Sodium" -), -"value_col" = "STRESN", -"unit_col" = "STRESU", -"studyday_col" = "DY", -"visit_col" = "VISIT", -"visit_order_col" = "VISITN", -"baseline_flag" = "BLFL", -"baseline_values" = list("Y" = "TRUE"), -"normal_col_high" = "STNRHI", -"id_col" = "USUBJID", -"age_col" = "AGE", -"sex_col" = "SEX", -"race_col" = "RACE", -"treatment_col" = "ARM" -), -dm = list("id_col" = "USUBJID", "treatment_col" = "ARM"), -vitals = list("id_col" = "USUBJID", "treatment_col" = "ARM", "measure_col" = "TEST", -"measure_values" = list("DIABP" = "Diastolic Blood Pressure", -"SYSBP" = "Systolic Blood Pressure" -) -) -) -create_nepexplorer_app -mapping_new <- list(labs = list("id_col" = "USUBJID", "measure_col" = "PARAM", -"measure_values" = list("CREAT" = "Creatinine", -"CYSTC" = "Cystatin C", -"eGFR" = "eGFR", -"eGFRcys" = "eGFRcys", -"Albumin/Creatinine" = "Albumin/Creatinine", -"BICARB" = "Bicarbonate", -"BUN" = "Blood Urea Nitrogen", -"CA" = "Calcium", -"CL" = "Chloride", -"PHOS" = "Phosphorus", -"K" = "Potassium", -"SODIUM" = "Sodium" -), -"value_col" = "STRESN", -"unit_col" = "STRESU", -"studyday_col" = "DY", -"visit_col" = "VISIT", -"visit_order_col" = "VISITN", -"baseline_flag" = "BLFL", -"baseline_values" = list("Y" = "TRUE"), -"normal_col_high" = "STNRHI", -"id_col" = "USUBJID", -"age_col" = "AGE", -"sex_col" = "SEX", -"race_col" = "RACE", -"treatment_col" = "ARM" -), -dm = list("id_col" = "USUBJID", "treatment_col" = "ARM"), -vitals = list("id_col" = "USUBJID", "treatment_col" = "ARM", "measure_col" = "TEST", -"measure_values" = list("DIABP" = "Diastolic Blood Pressure", -"SYSBP" = "Systolic Blood Pressure" -) -) -) -create_nepexplorer_app(data = list(dm = nepExplorer::adsl, labs = nepExplorer::adlb, -vitals = nepExplorer::advs), mapping = mapping_new) -devtools::load_all(".") -create_nepexplorer_app(data = list(dm = nepExplorer::adsl, labs = nepExplorer::adlb, -vitals = nepExplorer::advs), mapping = mapping_new) -devtools::load_all(".") -if (!interactive()) { -sink(stderr(), type = "output") -tryCatch({ -library("nepExplorer") -}, error = function(e) { -devtools::load_all() -}) -} else { -devtools::load_all() -} -mapping_new <- list(labs = list("id_col" = "USUBJID", "measure_col" = "TEST", -"measure_values" = list("CREAT" = "Creatinine", -"CYSTC" = "Cystatin C", -"eGFR" = "eGFR", -"eGFRcys" = "eGFRcys", -"Albumin/Creatinine" = "Albumin/Creatinine", -"BICARB" = "Bicarbonate", -"BUN" = "Blood Urea Nitrogen", -"CA" = "Calcium", -"CL" = "Chloride", -"PHOS" = "Phosphorus", -"K" = "Potassium", -"SODIUM" = "Sodium" -), -"value_col" = "STRESN", -"unit_col" = "STRESU", -"studyday_col" = "DY", -"visit_col" = "VISIT", -"visit_order_col" = "VISITN", -"baseline_flag" = "BLFL", -"baseline_values" = list("Y" = "TRUE"), -"normal_col_high" = "STNRHI", -"id_col" = "USUBJID", -"age_col" = "AGE", -"sex_col" = "SEX", -"race_col" = "RACE", -"treatment_col" = "ARM" -), -dm = list("id_col" = "USUBJID", "treatment_col" = "ARM"), -vitals = list("id_col" = "USUBJID", "treatment_col" = "ARM", "measure_col" = "TEST", -"measure_values" = list("DIABP" = "Diastolic Blood Pressure", -"SYSBP" = "Systolic Blood Pressure" -) -) -) -#launch nepexplorer stand-alone app -# -# neplab <- nepExplorer::adlb %>% -# mutate( -# PARAM = TEST, BLFL = ifelse(BLFL == TRUE, "Y", BLFL) -# ) -# -# nepvitals <- nepExplorer::advs %>% -# mutate( -# PARAM = -# ifelse( -# TEST == "Systolic Blood Pressure", -# "Systolic Blood Pressure", -# ifelse( -# TEST == "Diastolic Blood Pressure", -# "Diastolic Blood Pressure", -# TEST -# ) -# ), -# BLFL = ifelse(BLFL == TRUE, "Y", BLFL) -# ) -# create_nepexplorer_app(data = list(dm = nepExplorer::adsl, labs = neplab, vitals = nepvitals)) -create_nepexplorer_app(data = list(dm = nepExplorer::adsl, labs = nepExplorer::adlb, -vitals = nepExplorer::advs), mapping = mapping_new) -library(nepExplorer) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -# Note: expected to be run from the root package directory -library(tidyverse) -library(usethis) -#Copy metadata to /data -#Chart-level metadata -#nepExplorer -meta_nepExplorer<-read_csv("data-raw/meta_nepExplorer.csv")[] -usethis::use_data(meta_nepExplorer, overwrite = TRUE) -document() -library(nepExplorer) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -# Note: expected to be run from the root package directory -library(tidyverse) -library(usethis) -#Copy metadata to /data -#Chart-level metadata -#nepExplorer -meta_nepExplorer<-read_csv("data-raw/meta_nepExplorer.csv")[] -usethis::use_data(meta_nepExplorer, overwrite = TRUE) -library(nepExplorer) -document() -library(nepExplorer) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -# Note: expected to be run from the root package directory -library(tidyverse) -library(usethis) -#Copy metadata to /data -#Chart-level metadata -#nepExplorer -meta_nepExplorer<-read_csv("data-raw/meta_nepExplorer.csv")[] -usethis::use_data(meta_nepExplorer, overwrite = TRUE) -document9 -document() -library(nepExplorer) -#' Nep Explorer Module - UI -#' -#' @param id module id -#' -#' @return returns shiny module UI -#' @import shiny -#' @importFrom shinyjs useShinyjs -#' @importFrom shinyjs hidden -#' @export -nepexplorer_ui <- function(id) { -ns <- NS(id) -#future home of settings panel -sidebar <- sidebarPanel( -selectizeInput( -ns("measures"), -"Select Measures", -multiple = TRUE, -choices = c("") -), -radioButtons( -ns("animate"), -"Time Animation:", -c("Off" = "off", "On" = "on"), -inline = TRUE), -hidden( -radioButtons( -ns("animation_time_unit"), -"Animation Time Unit:", -c("Study Day", "Visit"), -inline = TRUE), -sliderInput( -ns("animation_transition_time"), -"Animation Transition Speed (secs):", -min = .1, -max = 2, -value = .5, -ticks = FALSE) -), -width = 2 -) -main <- mainPanel( -useShinyjs(), -# Scatter PLot + Summary Table UI -creatinineScatterUI(ns("scatter")), -br(), -br(), -# Patient Profile (demography table + lab line charts) UI -patientProfileUI(ns("patprofile")), -width = 10 -) -ui <- sidebarLayout( -sidebar, -main, -position = c("right"), -fluid = TRUE -) -return(ui) -} -#' Nep Explorer Module - Server -#' -#' @param input module input -#' @param output module output -#' @param session module session -#' @param params parameters object with `data` and `settings` options. -#' -#' @return returns shiny module Server function -#' -#' @import shiny -#' @importFrom shinyjs show -#' @importFrom shinyjs hide -#' @importFrom plotly event_data -#' @export -nepexplorer_server <- function(input, output, session, params) { -ns <- session$ns -param <- reactive({ -init_nepExplorer(data = params()$data, -settings = params()$settings) -}) -observe({ -if (!is.null(input$animate)) { -if (input$animate == "on") { -shinyjs::show(id = "animation_time_unit") -shinyjs::show(id = "animation_transition_time") -} else { -shinyjs::hide(id = "animation_time_unit") -shinyjs::hide(id = "animation_transition_time") -} -} -}) -# Populate sidebar control with measures and select all by default -observe({ -measure_col <- param()$settings$labs$measure_col -measures <- unique(param()$data$labs[[measure_col]]) -updateSelectizeInput(session, -"measures", -choices = measures, -selected = measures -) -}) -animate <- reactive(input$animate) -animation_time_unit <- reactive({ -if (input$animation_time_unit == "Study Day") { -param()$settings$labs$studyday_col -} else { -param()$settings$labs$visit_col -} -}) -# get processed data to use for subsetting to subject on scatterplot click -processed_creatinine_data <- reactive({ -creatinineScatterServer("scatter", df = param()$data$labs, settings = param()$settings$labs, -animate = animate, -animation_transition_time = reactive(input$animation_transition_time), -animation_time_unit = animation_time_unit) -}) -# subject id return from plotly click event -selected_subject <- reactive({ -processed_creatinine_data()[event_data("plotly_click", source = "scatter")$pointNumber, ]$USUBJID -}) -#Patient Profile (demo tables + lab line charts) -observeEvent(selected_subject(), { -if (length(selected_subject()) == 1) { # avoid triggering patient profiles if there isn't a subject -patientProfileServer("patprofile", df = param()$data$labs, -settings = param()$settings$labs, subj_id = selected_subject()) -} -}, ignoreInit = TRUE) -} -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -safetyData::adam_advs$ABLFL -# Note: expected to be run from the root package directory -library(tidyverse) -library(usethis) -#Copy metadata to /data -#Chart-level metadata -#nepExplorer -meta_nepExplorer<-read_csv("data-raw/meta_nepExplorer.csv")[] -usethis::use_data(meta_nepExplorer, overwrite = TRUE) -document() -rm(list = c("nepexplorer_server", "nepexplorer_ui")) -document() -library(nepExplorer) -library(dplyr) -library(safetyGraphics) -# Safety Graphics app with nep-explorer included -charts <- c( -safetyGraphics::makeChartConfig(), -safetyGraphics::makeChartConfig(packages = "nepExplorer") -) -charts$nepexplorerMod$meta <- nepExplorer::meta_nepExplorer -adam_adlbc <- safetyData::adam_adlbc |> -mutate(STRESU = gsub("[\\(\\)]", "", regmatches(PARAM, gregexpr("\\(.*?\\)", PARAM))[[1]])) -safetyGraphics::safetyGraphicsApp(domainData = list( -labs = adam_adlbc, -aes = safetyData::adam_adae, -dm = safetyData::adam_adsl, -vitals = safetyData::adam_advs -), -charts = charts) -safetyCharts::meta_labs diff --git a/DESCRIPTION b/DESCRIPTION index 37f00ab..e01e85c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,16 +1,24 @@ Package: nepExplorer Type: Package -Title: Interactive Graphic for Exploring Kidney Function Data in Clinical Trials -Version: 0.1.0 +Title: Kidney Function Data Exploration in Clinical Trials +Version: 1.0.0 Authors@R: c( person("Preston", "Burns", email = "s.preston.burns@gmail.com", role = c("cre","aut")), person("Lovemore", "Gakava", email = "lovemore.gakava@gmail.com", role = "aut"), person("Jared", "Woolfork", email = "jaredwoolfolk@gmail.com", role = "aut"), person("Eli", "Miller", email = "eli.miller@atorusresearch.com", role = "aut"), - person("James", "Buchanan", email = "jbuchanan@covilance.com", role = "aut")) -Description: Shiny app of interactive creatinine scatterplot for exploring kidney function data in clinical trials. -URL: https://github.com/SafetyGraphics/nep-explorer, https://safetygraphics.github.io/nepExplorer/ -BugReports: https://github.com/SafetyGraphics/nep-explorer/issues + person("James", "Buchanan", email = "jbuchanan@covilance.com", role = "aut"), + person("Barbara", "Hendrickson", email = "bhendric@bsd.uchicago.edu", role = "aut"), + person("Siu-Chi", "Sun", email = "Siu-Chi.Sun@gilead.com", role = "aut")) +Description: nepExplorer enables safety professionals to explore clinical trial laboratory + data and identify instances of acute declines in renal function. "Drill down" capabilities + provide a means to evaluate subject-level data. The tool is accompanied by a comprehensive + clinical workflow that guides the user through a series of evaluations each with a textual + discussion regarding the goal of the evaluation step and the relevance of any findings with + references to the supporting nephrology literature. nepExplorer is designed as a Shiny + application that can be used stand-alone or configured within the safetyGraphics framework. +URL: https://github.com/SafetyGraphics/nepExplorer, https://safetygraphics.github.io/nepExplorer/ +BugReports: https://github.com/SafetyGraphics/nepExplorer/issues Depends: R (>= 4.0) License: MIT + file LICENSE Encoding: UTF-8