Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Refactor Visualisation Tab #136

Merged
merged 11 commits into from
Dec 19, 2024
4 changes: 4 additions & 0 deletions inst/shiny/global.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ source("modules/tab_data.R")
source("modules/slope_selector.R")

source("functions/partial_auc_input.R")

source("modules/tab_visuals.R")

source("functions/mapping_selectize_inputs.R")

146 changes: 106 additions & 40 deletions inst/shiny/modules/column_mapping.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,40 @@ column_mapping_ui <- function(id) {
tagList(
h3("Data Mapping"),
br(),
"The following columns are required for data analysis.
Please ensure each of these columns has been assigned
a corresponding column from your dataset",
p(
"The following columns are required for data analysis. Please ensure each of these columns",
" has been assigned a corresponding column from your dataset"
),
br(),
fluidRow(
h4("Group Identifiers"),
column(12,
tooltip(
selectizeInput(ns("select_STUDYID"), "STUDYID",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_STUDYID"),
"STUDYID",
choices = NULL,
options = list(placeholder = "Select Column")
),
js3110 marked this conversation as resolved.
Show resolved Hide resolved
"Select Study ID Column"
),
tooltip(
selectizeInput(ns("select_USUBJID"), "USUBJID",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_USUBJID"),
"USUBJID",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Unique subject identifier."
),
tooltip(
selectizeInput(ns("select_Grouping_Variables"), "Grouping Variables",
choices = NULL, multiple = TRUE,
options = list(placeholder = "Select Column(s)")),
selectizeInput(
ns("select_Grouping_Variables"),
"Grouping Variables",
choices = NULL,
multiple = TRUE,
options = list(placeholder = "Select Column(s)")
),
"Select the additional column(s) that will be used to group the data
for tables, listings and graphs. E.g. Treatment Arm, Age, Sex, Race"
)
Expand All @@ -76,18 +89,29 @@ a corresponding column from your dataset",
h4("Sample Variables"),
column(12,
tooltip(
selectizeInput(ns("select_ANALYTE"), "ANALYTE",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_ANALYTE"),
"ANALYTE",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Analyte"
),
tooltip(
selectizeInput(ns("select_PCSPEC"), "PCSPEC",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_PCSPEC"),
"PCSPEC",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Matrix"
),
tooltip(
selectizeInput(ns("select_AVAL"), "AVAL",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_AVAL"), "AVAL",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Analysis value in numeric format."
)
)
Expand All @@ -96,24 +120,38 @@ a corresponding column from your dataset",
h4("Dose Variables"),
column(12,
tooltip(
selectizeInput(ns("select_DOSNO"), "DOSNO",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_DOSNO"),
"DOSNO",
choices = NULL, options = list(placeholder = "Select Column")
),
"Numeric format."
),
tooltip(
selectizeInput(ns("select_ROUTE"), "ROUTE",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_ROUTE"),
"ROUTE",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Route of administration, stating either 'intravascular' or 'extravascular'."
),
tooltip(
selectizeInput(ns("select_DOSEA"), "DOSEA",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_DOSEA"),
"DOSEA",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Actual Dose amount in numeric format."
),
tooltip(
selectizeInput(ns("select_ADOSEDUR"), "ADOSEDUR",
choices = c("Select Column" = "", "NA"),
options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_ADOSEDUR"),
"ADOSEDUR",
choices = c("Select Column" = "", "NA"),
options = list(placeholder = "Select Column")
),
"Duration of dose administration. Only required for infusion studies,
otherwise select NA"
)
Expand All @@ -123,23 +161,39 @@ otherwise select NA"
h4("Time Variables"),
column(12,
tooltip(
selectizeInput(ns("select_AFRLT"), "AFRLT",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_AFRLT"),
"AFRLT",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Numeric format"
),
tooltip(
selectizeInput(ns("select_ARRLT"), "ARRLT",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_ARRLT"),
"ARRLT",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Numeric format"
),
tooltip(
selectizeInput(ns("select_NFRLT"), "NFRLT",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_NFRLT"),
"NFRLT",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Numeric format"
),
tooltip(
selectizeInput(ns("select_NRRLT"), "NRRLT",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_NRRLT"),
"NRRLT",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Numeric format"
)
)
Expand All @@ -148,20 +202,32 @@ otherwise select NA"
h4("Unit Variables"),
column(12,
tooltip(
selectizeInput(ns("select_AVALU"), "AVALU",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_AVALU"),
"AVALU",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Unit of analysis value. If a column is not available, type and select the unit
used in the dataset from the manual units."
),
tooltip(
selectizeInput(ns("select_DOSEU"), "DOSEU",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_DOSEU"),
"DOSEU",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Unit of dose amount. If a column is not available, type and select the unit
used in the dataset from the manual units"
),
tooltip(
selectizeInput(ns("select_RRLTU"), "RRLTU",
choices = NULL, options = list(placeholder = "Select Column")),
selectizeInput(
ns("select_RRLTU"),
"RRLTU",
choices = NULL,
options = list(placeholder = "Select Column")
),
"Unit of time. If a column is not available, type and select the unit
used in the dataset from the manual units"
)
Expand Down Expand Up @@ -234,7 +300,7 @@ column_mapping_server <- function(id, data, manual_units, on_submit) {
}

# Extract and store the "Grouping Variables" column
grouping_variables(selected_cols[["Group Identifiers"]][["Grouping Variables"]])
grouping_variables(input$select_Grouping_Variables)

# Remove "Grouping Variables" from selected columns to prevent renaming
selected_cols[["Group Identifiers"]] <- selected_cols[["Group Identifiers"]][
Expand Down
Loading
Loading