Skip to content

feat: Analyte Comparison slides in PPT/QMD export#1175

Draft
Gero1999 wants to merge 6 commits intomainfrom
1174-enhancement/analyte-comparison-slides
Draft

feat: Analyte Comparison slides in PPT/QMD export#1175
Gero1999 wants to merge 6 commits intomainfrom
1174-enhancement/analyte-comparison-slides

Conversation

@Gero1999
Copy link
Copy Markdown
Collaborator

@Gero1999 Gero1999 commented Apr 2, 2026

Issue

Closes #1174

Description

Adds an "Analyte Comparison" slide type under Summary Slides in the export customisation modal. When selected, it generates mean concentration-time plots faceted by DOSETRT × PARAM, allowing side-by-side comparison of analytes within each treatment group.

Changes:

  • inst/shiny/modules/tab_nca/zip.R — Added analyte_comparison subsection to .build_slide_types() under Summary Slides
  • inst/shiny/functions/zip-utils.R — Added exploration_meanplot() call with facet_by = c("DOSETRT", analyte_col) in get_dose_esc_results(), stored as analyte_comparison in each group's output
  • R/officer-utils.R — Renders the analyte comparison plot slide in PPTX between the main mean plot and spaghetti plot; updates has_summary check and slide count
  • R/quarto-utils.R — Renders the analyte comparison plot slide in QMD between the mean plot and spaghetti plot; updates has_summary check
  • tests/testthat/test-officer-utils.R — 4 new tests for PPTX analyte comparison inclusion/exclusion
  • tests/testthat/test-quarto-utils.R — 4 new tests for QMD analyte comparison inclusion/exclusion

Definition of Done

  • "Analyte Comparison" subsection added to .build_slide_types() in zip.R
  • Analyte comparison mean plots generated in get_dose_esc_results() in zip-utils.R
  • Analyte comparison slides rendered in PPTX export (officer-utils.R)
  • Analyte comparison slides rendered in QMD export (quarto-utils.R)
  • Unit tests cover the new slide type
  • NEWS.md updated

How to test

  1. Upload a dataset with multiple analytes (e.g., parent + metabolite)
  2. Run NCA analysis
  3. Click Save → Export → select "Result Slides" → click "Export ZIP with Results"
  4. In the "Customise Slide Contents" modal, verify "Analyte Comparison" appears under Summary Slides and is selected by default
  5. Export and verify the PPTX/QMD contains a mean plot faceted by DOSETRT × PARAM for each group
  6. Deselect "Analyte Comparison" and verify the slide is omitted

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

Notes to reviewer

No new dependencies added. The analyte comparison plot reuses the existing exploration_meanplot() function with different faceting parameters. R is not available in the dev container so lintr/tests could not be run locally — CI will validate.

Gero1999 and others added 6 commits April 2, 2026 08:32
Add 'Analyte Comparison' as a new subsection under Summary Slides
in .build_slide_types(). This makes it available in the slide
customisation modal when exporting results.

Co-authored-by: Ona <no-reply@ona.com>
Add exploration_meanplot call with facet_by = c('DOSETRT', PARAM)
to produce analyte comparison plots for each dose group. The plot
is stored as 'analyte_comparison' in the group output list.

Co-authored-by: Ona <no-reply@ona.com>
Insert analyte comparison plot slide (faceted by DOSETRT × PARAM)
into the group summary section, between the main mean plot and the
spaghetti plot. Update has_summary check and slide count accordingly.

Co-authored-by: Ona <no-reply@ona.com>
Insert analyte comparison plot slide into the QMD summary section,
between the mean plot and the spaghetti plot. Update has_summary
check to include analyte_comparison.

Co-authored-by: Ona <no-reply@ona.com>
Test that the analyte_comparison slide is included/excluded based on
slide_sections selection, and that it works with NULL slide_sections
(backwards compat). Also add analyte_comparison to base_slides
fixture in both test files.

Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Analyte Comparison slide type in PPT/QMD export

1 participant