Skip to content

feat: add option to drop end-interval concentration for regular parameters - #1411

Open
Gero1999 wants to merge 6 commits into
mainfrom
feat/drop-end-conc
Open

feat: add option to drop end-interval concentration for regular parameters#1411
Gero1999 wants to merge 6 commits into
mainfrom
feat/drop-end-conc

Conversation

@Gero1999

@Gero1999 Gero1999 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #1414

Description

Adds a global "Drop End Concentration" switch in NCA Setup → Data Imputation. When enabled, for regular (non-interval/partial) parameter calculations it drops the concentration measured exactly at the end of each main interval (time == end) before NCA runs.

Useful for multiple-dose profiles where the concentration at the interval end really belongs to the next dose (e.g. an imputed C0). Including that boundary point can distort Cmax, Tmax, and AUC. Genuine troughs are unaffected because the method is a no-op when no point sits exactly at the interval end.

Implemented via a self-contained PKNCA_impute_method_end_conc_drop() mirroring humanpred/pknca#572, with a TODO to remove it once that method ships in a released PKNCA.

Definition of Done

  • Global "Drop End Concentration" checkbox (checked = drop)
  • Applied only to main intervals; partial/interval params untouched
  • Self-contained impute method with removal TODO
  • Setting persisted/restored via settings YAML and templates
  • Covered by unit tests
  • Documented in the manual and NEWS

How to test

Added a tiny reproducer dataset for manual testing: tests/testthat/data/test-end-conc-leak-ADNCA.csv (1 subject, 2 IV-bolus dose profiles, 14 rows).

How to use in the app:

  1. Upload the CSV (default mappings apply; DOSNOP → ATPTREF).
  2. Dose 2's C0 is 1050 ng/mL at AFRLT = 24 h, and profile 1's interval end is derived as the next dose time (24 h) — so that point sits exactly on profile 1's boundary.
  3. Run NCA with Drop End Concentration OFF: profile 1's Clast/Tlast/AUClast/λz are distorted by the 1050 spike.
  4. Toggle it ON: profile 1's boundary point is dropped and results normalise, while profile 2 (the last profile) keeps its genuine terminal sample.

Notes to reviewer

  • Self-contained impute method is a temporary copy of Add end_conc_drop imputation method humanpred/pknca#572 (TODO to remove once released).
  • R unavailable in authoring env: man/*.Rd and NAMESPACE edited by hand to match roxygen; please run devtools::document() (should be no diff). Tests rely on CI.
  • Replace the #TODO in NEWS.md with the issue number once created.

@Gero1999
Gero1999 force-pushed the feat/drop-end-conc branch from 1e1c4dd to 37a4c34 Compare July 24, 2026 14:11
@Gero1999
Gero1999 force-pushed the feat/drop-end-conc branch from deeaa48 to 8162fa1 Compare July 28, 2026 12:47
@Gero1999
Gero1999 marked this pull request as ready for review July 28, 2026 12:59
@Gero1999
Gero1999 requested a review from Belubbit July 28, 2026 13:08
Comment thread inst/WORDLIST
Comment thread tests/testthat/data/test-end-conc-leak-ADNCA.csv
@Gero1999

Copy link
Copy Markdown
Collaborator Author

@Shaakon35 both comments do not need to be addressed, should be fine

@Shaakon35
Shaakon35 requested a review from h5hoang as a code owner August 4, 2026 09:46
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: Drop end-of-interval concentration belonging to the next dose

2 participants