Skip to content

Redesign ADPP Exclusions tab and route descriptive stats through ADPP - #1467

Draft
Gero1999 wants to merge 1 commit into
mainfrom
1466-feat/adpp-exclusions-redesign
Draft

Redesign ADPP Exclusions tab and route descriptive stats through ADPP#1467
Gero1999 wants to merge 1 commit into
mainfrom
1466-feat/adpp-exclusions-redesign

Conversation

@Gero1999

Copy link
Copy Markdown
Collaborator

Issue

Closes #1466

Description

Reworks the ADPP Exclusions tab and routes descriptive statistics through ADPP to make the exclusion workflow clearer and the grouping logic more robust.

ADPP Exclusions tab (now the third Results sub-tab):

  • Excluded records are colour-coded by source — red (default flag-rule exclusion), yellow (custom/user exclusion), orange (both). The coding is shared by the table rows and the boxplot crosses, with a legend shown alongside the plots.
  • Violin/box plots are embedded in the tab. The parameter selector ("Select PPs") accepts multiple parameters (one boxplot each), and the exclusion table is filtered to the selection.
  • A "Filter PPs" control narrows the parameter choices to those With a flagged result or With an outlier. Outliers use the Tukey/IQR rule (matching the boxplot whiskers), computed within the current X/colour grouping over non-excluded records only.
  • Clicking a point in a boxplot highlights the matching table row.
  • The standalone "Parameter Plots" tab is kept unchanged.

Data flow:

  • Descriptive statistics now derive grouping and exclusions from the ADPP dataset directly, instead of re-joining grouping columns from the concentration data. This removes an ad-hoc join (the source of the ROUTE column collision) and guarantees the summary grouping matches the exported ADPP.

New exported helpers: is_iqr_outlier() and params_with_outliers().

Definition of Done

  • ADPP Exclusions is the third Results sub-tab.
  • Red / yellow / orange colour coding for flag / custom / both exclusions.
  • Boxplots embedded in the ADPP Exclusions tab (standalone tab kept).
  • "Select PPs" multi-select renders one boxplot per parameter.
  • Exclusion table filtered by the PP selection.
  • Excluded points shown as coloured X with a legend in the boxplot.
  • Click a point to highlight the corresponding table row.
  • PP and ADPP built from PKNCA results including exclusion settings and mapping grouping variables.
  • Descriptive statistics routed through ADPP.

How to test

  1. Run an NCA analysis, then open Results → ADPP Exclusions (third tab).
  2. Select one or more PK parameters under "Select PPs" — one boxplot renders per parameter and the table filters accordingly.
  3. Use "Filter PPs" to switch between All, With a flagged result, and With an outlier; the available parameters update.
  4. Add a manual exclusion and confirm the row turns yellow (or orange if also flagged), and the boxplot cross matches.
  5. Click a point in a boxplot and confirm the matching table row is highlighted.
  6. Open Descriptive Statistics and confirm grouping options come from ADPP columns.

Contributor checklist

  • Code passes lintr checks
  • Code passes all unit tests
  • New logic covered by unit tests
  • New logic is documented
  • App or package changes are reflected in NEWS
  • Package version is incremented
  • R script works with the new implementation (if applicable)
  • Settings upload works with the new implementation (if applicable)
  • If any .scss change was done, run data-raw/compile_css.R
  • If a package dependency was added/changed, run data-raw/test_suggests_hidden.R

Notes to reviewer

  • The R environment was unavailable in the development sandbox, so devtools::document(), lintr::lint_package(), and devtools::test() could not be run here. The two new man/*.Rd files and NAMESPACE exports were updated by hand; please run devtools::document() and the test/lint suite before merging.
  • The click-to-highlight matches on parameter + nearest y-value; hover linking was intentionally left out as best-effort per the design discussion.
  • Descriptive statistics now depend on the ADPP build; PPORRES is recovered from the numeric PPSTRESN, and partial intervals are disambiguated via PPSTINT/PPENINT.
Rework the ADPP Exclusions tab (now the third Results sub-tab):
- Colour-code excluded records by source: red (flag rule), yellow
  (custom/user), orange (both), shared by table rows and boxplot crosses.
- Embed multi-parameter violin/box plots; 'Select PPs' accepts multiple
  parameters and the exclusion table is filtered to the selection.
- Add a 'Filter PPs' control (All / flagged / with an outlier). Outliers
  use the Tukey/IQR rule within the current X/colour grouping over
  non-excluded records only.
- Click a boxplot point to highlight the matching table row.

Route descriptive statistics through ADPP as the single grouping and
exclusion source, removing the ad-hoc join from concentration data.

Add exported helpers is_iqr_outlier() and params_with_outliers().

Closes #1466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant