pk-nca¶
Run noncompartmental PK analysis on concentration-time data (AUClast, AUCinf, Cmax, Tmax, half-life, CL/F, Vz/F) with documented BLQ handling and summary statistics. Use for preclinical or early clinical PK reporting.
| Stage | Preclinical |
| Tier | 1 (deterministic tool) |
| Standards | FDA BA guidance (2022), EMA BE guideline CPMP/EWP/QWP/1401/98 Rev. 1 |
Minimum pharmaskills |
0.3.0 |
| Inputs | concentration time csv, dose, route, lloq |
| Outputs | nca results csv, nca report json, nca report md |
| Verified by | stats nca |
Draft for qualified review. Not a validated system and not 21 CFR Part 11 compliant.
Install only this skill: pharmaskills skills install --agent claude-code --skill pk-nca (see Install).
Purpose¶
Produce a noncompartmental PK parameter table and a short report from concentration-time data
for a pharmacokineticist or study director. The deterministic pharmaskills stats nca engine
computes every number. You prepare the input, choose and document the BLQ rule, run the tool,
read the flags and write the report. Everything is a draft for qualified human review.
When to use / when not to use¶
Use for single-dose or steady-state profiles per subject (nominal or actual times), for preclinical toxicokinetics and for early clinical PK summaries.
Do not use for population PK or compartmental modelling, for bioequivalence statistics (confidence intervals on geometric mean ratios are out of scope), for sparse sampling designs that need destructive-sampling methods, or for concentrations that were not measured by a validated bioanalytical method. Never impute, smooth or invent concentrations.
Inputs¶
Required: a CSV with columns subject,time,conc,dose,route (route iv or oral; time in one
consistent unit; dose in one consistent unit). Ask once for anything missing, then proceed with
stated assumptions and [DATA NEEDED: ...] placeholders (for example
[DATA NEEDED: LLOQ and concentration unit]).
Optional: LLOQ (needed for the BLQ rules zero, drop, half-lloq), units, analyte, matrix,
study identifier. Region assumed for any regulatory reference: US FDA with ICH; say so and state
any other assumption.
If pharmaskills is not installed, tell the user to run uv tool install pharmaskills, then
give template-only guidance (the report skeleton in templates/nca_report.md) clearly marked
unverified, with no computed numbers. Check pharmaskills --version against min_pharmaskills.
Workflow¶
- Inspect the input. Confirm the five columns, one row per time point, numeric times and
concentrations, BLQ values coded as blanks or
BLQtext only if an LLOQ is supplied. Do not edit values. Report problems and ask once. - Choose the BLQ rule and state it. Default rule: BLQ before the first quantifiable value is
0, BLQ after it is dropped. Alternatives (
zero,drop,half-lloq) are described inreferences/nca-methods.md. A choice other than default needs the user's reason. - Run the engine:
pharmaskills stats nca <input.csv> --blq-rule default --lloq <v> --min-points 3 --out out/nca_report.json. It writesout/nca_results.csvnext to the JSON. - Read the flags. Per subject:
lambda_znot estimable (fewer than 3 terminal points),auc_extrap_pctabove 20 percent (AUCinf unreliable), low adjusted R-squared. List each flag with the subject and what it means. Never replace a missing parameter with an estimate. - Summarise. Use the
summaryblock (n, geometric mean, geometric CV percent, mean, SD, median) as printed by the tool; with n of 1 the dispersion isn/a. - Write the report from
templates/nca_report.mdintoout/nca_report.md: method, BLQ rule, parameter table (copied fromnca_results.csv), flags, limitations. Runpharmaskills docs banner --apply out/nca_report.mdto add the draft banner and provenance block. - Report with the output contract below.
Output contract¶
| File | Content |
|---|---|
out/nca_results.csv |
One row per subject: Cmax, Tmax, Tlast, AUClast, AUCinf, lambda_z, t1/2, CL or CL/F, Vz or Vz/F, flags |
out/nca_report.json |
Method, summary statistics, per-subject detail, banner |
out/nca_report.md |
Narrative report with the draft banner and a provenance block |
State in your answer: BLQ rule, lambda_z selection rule (best adjusted R-squared, minimum 3 points, Cmax excluded), AUC method (linear-up log-down), flags raised, and what needs human input. Oral dosing gives CL/F and Vz/F, not CL and Vz.
Verification¶
Run and report pass or fail: the engine exits 0; every subject in the input appears in
nca_results.csv; each number in the narrative equals the tool output (re-read the CSV); flags
in the CSV are all discussed in the report. Re-run pharmaskills stats nca on the same input
and confirm identical results. For a self-check against a published profile use
evals/fixtures/theoph_subject1.csv (R datasets::Theoph, subject 1).
Guardrails¶
- Insert the draft banner and a provenance block in every generated document.
- Never fabricate concentrations, times, doses, parameters or citations. Missing values become
[DATA NEEDED: ...]placeholders. - Never tune the BLQ rule, the terminal-phase points or the AUC method to reach an expected value. A requested target value is a reason to decline, not to adjust.
- Do not describe the output as validated or bioequivalence evidence.
- State the region assumed (US FDA with ICH unless told otherwise) and units used.
- Warn if the input looks like identifiable patient data and recommend de-identification.
References¶
references/nca-methods.md- AUC, lambda-z, BLQ rules, parameters, flagsreferences/guidance-notes.md- FDA and EMA guidance notes with section pointers- Public sources: FDA, Bioavailability Studies Submitted in NDAs or INDs - General Considerations (2022); EMA, Guideline on the Investigation of Bioequivalence CPMP/EWP/QWP/1401/98 Rev. 1 (2010), section 4.1.8.
Templates: templates/nca_report.md. Scripts: scripts/run_nca.sh (thin wrapper).
Examples¶
Worked example: examples/preclinical/pk-nca/ (Theophylline subject 1, plus a sparse case that
shows the lambda_z flag). Fixtures: skills/pk-nca/evals/fixtures/.
Worked example¶
Committed example with inputs and outputs: examples/preclinical/pk-nca/.
Skill: skills/pk-nca. Stage: preclinical.
Inputs (skills/pk-nca/evals/fixtures/):
theoph_subject1.csv: Rdatasets::Theophsubject 1 (oral theophylline, 320 mg), 11 samples.two_subjects_sparse.csv: synthetic; subject B has three samples only.
Outputs in out/:
nca_report.jsonandnca_results.csv: real output ofpharmaskills stats nca skills/pk-nca/evals/fixtures/theoph_subject1.csv --out out/nca_report.json.sparse/nca_report.json: real output for the sparse file.nca_report.md,nca_report_sparse.md: narrative drafts followingtemplates/nca_report.md; every number is copied from the tool output.refusal_fabricate_data.md: what a correct agent says to the adversarial request.
Reproduce: pharmaskills eval run --skill pk-nca.
Skill source: skills/pk-nca/SKILL.md