Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: aNCA
Title: (Pre-)Clinical NCA in a Dynamic Shiny App
Version: 0.1.0.9173
Version: 0.1.0.9174
Authors@R: c(
person("Ercan", "Suekuer", email = "ercan.suekuer@roche.com", role = "aut",
comment = c(ORCID = "0009-0001-1626-1526")),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
* Fixed `Aggregate Subject = yes/if-needed` not aggregating reference values, and ratio columns not appearing in results (#1273)

### NCA Results & Export
* Interval parameters (e.g. `AUCINT_0-24`) now display human-readable labels in parameter selectors and boxplot y-axis, instead of raw PPTESTCDs (#1305)
* Descriptive statistics were silently ungrouped when exported before visiting the tab — now falls back to default grouping columns (#1264)
* Fixed NA `PPSTRESU` handling: descriptive statistics no longer crash on all-NA unit groups, and manual interval parameters no longer get `NA` in column names (#1216)
* `get_settings_code()` reads mapping, filters, ratio table, and units from YAML instead of hardcoded defaults (#1189)
Expand Down
11 changes: 11 additions & 0 deletions R/flexible_violinboxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@ flexible_violinboxplot <- function(res_nca,
#' @returns Formatted y-axis label.
#' @noRd
.build_ylabel <- function(parameter, unit) {
# Resolve interval parameter label (e.g. AUCINT_0-24 -> "AUC from T1 to T2 (0-24)")
parsed <- parse_interval_parameter(parameter)
if (parsed$is_interval) {
label <- metadata_nca_parameters$PPTEST[
match(parsed$base, metadata_nca_parameters$PPTESTCD)
]
if (!is.na(label)) {
parameter <- paste0(label, " (", parsed$start, "–", parsed$end, ")")
}
}

if (is.null(unit) || is.na(unit) || unit == "" || unit == "unitless") {
parameter
} else {
Expand Down
16 changes: 14 additions & 2 deletions inst/shiny/functions/selector_label.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,24 @@ selector_label <- function(input, output, session,
} else if (metadata_type == "parameter") {
req(metadata_nca_parameters)
choices_df <- data.frame(PPTESTCD = choices, stringsAsFactors = FALSE)

# Parse interval suffix (e.g. AUCINT_0-24 -> base=AUCINT) for label lookup
parsed_info <- lapply(choices_df$PPTESTCD, parse_interval_parameter)
choices_df$base_pptestcd <- vapply(parsed_info, `[[`, "base", FUN.VALUE = "")
choices_df$is_interval <- vapply(parsed_info, `[[`, "is_interval", FUN.VALUE = TRUE)

choices_df <- choices_df %>%
left_join(
metadata_nca_parameters %>% select(PPTESTCD, PPTEST) %>% distinct(),
by = "PPTESTCD"
by = c("base_pptestcd" = "PPTESTCD")
) %>%
mutate(
desc = ifelse(
is_interval & !is.na(PPTEST),
paste0(PPTEST, " (", sub(paste0("^", base_pptestcd, "_"), "", PPTESTCD), ")"),
ifelse(!is.na(PPTEST), PPTEST, PPTESTCD)
)
) %>%
mutate(desc = ifelse(is.na(PPTEST), PPTESTCD, PPTEST)) %>%
rename(val = PPTESTCD)
} else {
data.frame(val = choices, desc = choices)
Expand Down