pkpd-modeling

Analyze pharmacokinetic and pharmacodynamic data with NCA, compartmental fitting, and population PK scripts.

41.1k|3.8k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill pkpd-modeling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pkpd-modeling
Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/skills/pkpd-modeling
Command: npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill pkpd-modeling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Pharmacokinetic and pharmacodynamic analyses are full of silent errors: lambda_z windows chosen by plain r-squared, AUCinf reported when a quarter of it is extrapolated, AIC selecting unidentifiable compartments, and NM-TRAN reading BLQ as a real zero. This Skill provides validated Python scripts and references that compute exposure metrics, fit structural models, and flag exactly these failure modes before they reach a report.

Core Features & Use Cases

  • Non-compartmental analysis and compartmental fitting: nca.py derives AUC, Cmax, lambda_z, and half-life with explicit BLQ and lambda_z rules, while fit_compartmental.py compares 1-, 2-, and 3-compartment models with AIC/BIC, F tests, and identifiability diagnostics.
  • Regimen simulation, exposure-response, and bioequivalence: simulate_regimen.py projects steady-state attainment across a population, exposure_response.py fits Emax and concentration-QTc models, and bioequivalence.py applies average BE, EMA ABEL, and FDA RSABE criteria with exact power calculations.
  • Scaling, DDI, and therapeutic drug monitoring: allometry_and_fih.py handles allometric scaling with maturation and first-in-human dose, ddi_static.py applies ICH M12 basic and mechanistic static models, and tdm_bayes.py performs MAP Bayesian estimation from measured levels.
  • Use Case: Given a concentration-time CSV from a single-dose study, run nca.py to get exposure metrics with findings about extrapolated AUC, then fit_compartmental.py to select a defensible structural model with parameter RSEs and residual diagnostics.

Quick Start

Ask the agent to run a non-compartmental analysis on your concentration-time CSV with a stated dose and route, and report the exposure metrics with any findings.

Frequently Asked Questions about pkpd-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a non-compartmental analysis on concentration-time data in Python?

Run nca.py with your CSV, dose, and route, for example: python3 nca.py -i profile.csv --dose 100 --route extravascular. It reports AUC, Cmax, lambda_z, and half-life, and flags excessive extrapolation or short lambda_z windows.

How do I choose between one-, two-, and three-compartment PK models?

Use fit_compartmental.py with --compare 1cmt,2cmt,3cmt to get AIC, BIC, and F-test comparisons plus parameter RSEs. BIC and the F test are preferred because AIC tends to select overparameterized models at typical sample sizes.

Does this skill replace NONMEM or Monolix for population PK?

No. It validates NONMEM datasets with check_popk_dataset.py and documents estimation methods in references, but NLME estimation itself is delegated to NONMEM, nlmixr2, or Monolix, which are licensed separately and never invoked by the scripts.

Can reference-scaled bioequivalence be applied to a 2x2 crossover study?

No. Both EMA ABEL and FDA RSABE require a replicate design because a 2x2 study provides no estimate of within-subject reference variability. bioequivalence.py refuses to run scaling on a 2x2 design and raises an error explaining why.

Why does allometric scaling overpredict clearance in neonates?

Below roughly two years of age, clearance is limited by enzyme and renal maturation rather than body size. Supplying --pma-weeks to allometry_and_fih.py adds the Anderson-Holford sigmoidal maturation term; omitting it below 20 kg raises a finding.

What are the limitations of the Bayesian TDM script?

tdm_bayes.py is a modeling aid, not a dosing decision tool. A single level cannot separate clearance from volume, and the bundled vancomycin parameterization is illustrative, so a model validated in your population must be substituted before results are meaningful.