pharmaverse / pharmaverse/aNCA

Enhancement: Reconsider default names for Ratio-interval parameters

Open
#1,237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
44
Forks
17
Avg merge
3d 15h
Merged PRs (30d)
17

Description

⚠️ Blocked until hackathon starts. Please don't claim or start this yet — it will be moved out of the Blocked column on the aNCA project board when the hackathon begins.

Description

When ratio parameters are auto-generated without a custom PPTESTCD, the default name format is RA{test_parameter} (e.g., RAAUCINT_0-12). For interval parameters with two intervals, this produces confusing names like MRAUCINT_0-12_0-12 that are hard to interpret.

The naming should be reconsidered to be more readable — e.g., separating the test/ref intervals clearly or using a different delimiter.

Where in the app

  1. Go to NCA > Setup > Ratio Calculations
  2. Add a ratio with two interval parameters (e.g., AUCINT_0-12 as test and AUCINT_0-24 as ref)
  3. Leave the custom PPTESTCD field empty
  4. Run NCA → observe the auto-generated name in the Results table

Files to modify

File Lines What to change
R/ratio_calculations.R 214–216 The auto-naming logic: paste0("RA", test_parameter) and paste0("RA", test_parameter, " (mean)"). This is where the default PPTESTCD is built when custom_pptestcd is NULL.

Current auto-naming logic

PPTESTCD = if (!is.null(custom_pptestcd)) {
  custom_pptestcd
} else {
  ifelse(n > 1, paste0("RA", test_parameter, " (mean)"), paste0("RA", test_parameter))
}

Suggested approach

Include both test and ref parameter names in the auto-generated PPTESTCD with a clear delimiter, e.g.:

  • RA_AUCINT_0-12_vs_AUCINT_0-24 instead of RAAUCINT_0-12
  • Or RA_AUCINT(0-12/0-24) — discuss preferred format

This is a naming convention decision — propose a format and get team agreement before implementing.

Definition of Done

  • Auto-generated ratio PPTESTCDs are readable for interval parameters
  • Non-interval ratio names are unaffected or also improved
  • All existing tests pass

Context

Medium issue for the Hackathon Hub. Requires understanding the ratio calculation pipeline in R/ratio_calculations.R.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in R/ratio_calculations.R around lines 214–216 and trace how test_parameter, ref parameters, and custom_pptestcd feed the generated PPTESTCD. Review the ratio calculation pipeline and discuss the preferred delimiter or naming convention with the team before implementing. Confirm that interval names are readable, non-interval behavior is addressed as intended, and all existing tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.