[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTNK54QCD25EM9J71CNNTE":3,"skill-same:01M7CTNK54QCD25EM9J71CNNTE":162},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":33,"install":34,"resources":47},"01M7CTNK54QCD25EM9J71CNNTE","pkpd-modeling",null,"Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK\u002FPD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when analysing concentration-time data, deriving exposure metrics, fitting PK or PD models, or evaluating dosing regimens. Triggers include \"pharmacokinetics\", \"pharmacodynamics\", \"PK\u002FPD\", \"NCA\", \"non-compartmental\", \"AUC\", \"Cmax\", \"lambda z\", \"half-life\", \"clearance\", \"volume of distribution\", \"compartmental model\", \"population PK\", \"popPK\", \"NONMEM\", \"nlmixr2\", \"Pharmpy\", \"Monolix\", \"exposure-response\", \"Emax\", \"EC50\", \"indirect response\", \"effect compartment\", \"TMDD\", \"PBPK\", \"bioequivalence\", \"RSABE\", \"ABEL\", \"allometric scaling\", \"first-in-human\", \"MABEL\", \"drug-drug interaction\", \"DDI\", \"ICH M12\", \"concentration-QTc\", \"therapeutic drug monitoring\", \"MIPD\", and \"dosing regimen\".","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pkpd-modeling\ndescription: Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK\u002FPD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when analysing concentration-time data, deriving exposure metrics, fitting PK or PD models, or evaluating dosing regimens. Triggers include \"pharmacokinetics\", \"pharmacodynamics\", \"PK\u002FPD\", \"NCA\", \"non-compartmental\", \"AUC\", \"Cmax\", \"lambda z\", \"half-life\", \"clearance\", \"volume of distribution\", \"compartmental model\", \"population PK\", \"popPK\", \"NONMEM\", \"nlmixr2\", \"Pharmpy\", \"Monolix\", \"exposure-response\", \"Emax\", \"EC50\", \"indirect response\", \"effect compartment\", \"TMDD\", \"PBPK\", \"bioequivalence\", \"RSABE\", \"ABEL\", \"allometric scaling\", \"first-in-human\", \"MABEL\", \"drug-drug interaction\", \"DDI\", \"ICH M12\", \"concentration-QTc\", \"therapeutic drug monitoring\", \"MIPD\", and \"dosing regimen\".\nlicense: MIT\nmetadata:\n  version: \"1.0.0\"\n  last-reviewed: \"2026-07-27\"\n---\n\n\n\n# Pharmacokinetic and Pharmacodynamic Modelling\n\n## When to use\n\nAny question about what the body does to a drug or what the drug does to the body: deriving\nexposure metrics from concentration-time data, fitting a structural model, building or checking a\npopulation analysis, choosing a dose or a regimen, relating exposure to effect, comparing\nformulations, or scaling to a new population.\n\n## The three rules\n\n**1. Fix the exposure metric and the analysis population before computing anything.** AUC(0-t),\nAUC(0-inf), AUC(0-tau) at steady state, and Cavg are different quantities and answer different\nquestions. So do AUCinf based on observed versus predicted Clast. Choosing after seeing the\nnumbers is how a negative study becomes positive.\n\n**2. Structural model, variability model, and covariate model are three separate decisions.** They\nget conflated constantly — an extra compartment added to absorb what is really unmodelled\nbetween-occasion variability, a covariate added to fix what is really a misspecified absorption\nmodel. Diagnose which one is wrong before changing any of them.\n\n**3. Convergence is not identifiability.** A fit that converges with 200% relative standard error\non a parameter, or a correlation of 0.99 between two, has told you the data cannot separate them.\nEvery fitting script here reports both and flags them, because the parameter table alone looks\nfine in exactly this situation.\n\n## Scope\n\nThis skill computes, diagnoses, and structures. It does **not** decide that a formulation is\nbioequivalent, select a dose for a trial, recommend a dose for a patient, conclude that a drug has\nno QT liability, or replace a qualified pharmacometrician, clinical pharmacologist, or the\nregulatory review. The scripts report; none of them concludes. `tdm_bayes.py` in particular is a\nmodelling aid — any change to a patient's regimen is the treating clinician's decision.\n\n## Scripts\n\n```bash\ncd skills\u002Fpkpd-modeling\u002Fscripts\n```\n\n| Script | Question answered |\n| --- | --- |\n| `nca.py` | What are the exposure metrics, and is the terminal phase good enough to report them? |\n| `fit_compartmental.py` | Which structural model do these data support, and are its parameters identifiable? |\n| `simulate_regimen.py` | What does this regimen do at steady state, and to what fraction of the population? |\n| `check_popk_dataset.py` | Will NONMEM read this dataset the way I think it will? |\n| `exposure_response.py` | Is there an exposure-response relationship, and is the plateau in the data? |\n| `bioequivalence.py` | Does the 90% CI meet the criterion, and which criterion applies? |\n| `allometry_and_fih.py` | What is the starting dose, or the dose in a smaller\u002Fyounger population? |\n| `ddi_static.py` | Does the in vitro data trigger a clinical DDI study under ICH M12? |\n| `tdm_bayes.py` | What are this patient's individual parameters from their measured levels? |\n\nAll take `--format table|tsv|json`. Data goes to stdout, provenance and findings to stderr, so\n`> out.tsv` keeps them separate. Exit code is `0` for no findings, `1` when findings were raised,\n`2` for bad input, so any of them can gate a workflow.\n\nTwo private modules carry the shared machinery: `_models.py` (analytical solutions for linear\nmammillary models, plus integrated Michaelis-Menten, TMDD and indirect-response structures) and\n`_common.py` (I\u002FO and reporting). Import them rather than re-deriving a Bateman function.\n\n## Workflow\n\n### 1. Non-compartmental analysis\n\n```bash\npython3 nca.py -i profile.csv --dose 100 --route extravascular --partial-auc 0-24\n```\n\nFour choices decide the answer and are usually left implicit. This script makes all four explicit:\n`--auc-method` (default `linup-logdown`), `--blq-rule`, `--lambda-z-points` or an explicit\n`--lambda-z-window`, and whether you report `auc_inf_obs` or `auc_inf_pred`.\n\nLambda_z selection uses the standard rule: start from the last three quantifiable points, extend\nbackwards, keep the longer window only if **adjusted** r-squared improves by more than 0.0001.\nPlain r-squared can only rise as points are added, so it would always pick the longest window.\nPoints at or before Tmax are never eligible — including Tmax fits the tail of absorption and\nbiases half-life, Vz and AUCinf downward.\n\nOn a noiseless simulated one-compartment oral profile with CL\u002FF = 5, V\u002FF = 20, ka = 1.2:\n\n```\nid  cmax     tmax  auc_last  lambda_z  t_half   r2_adj  auc_inf_obs  pct_auc_extrap  cl_f     vz_f\n1   3.29678  1.5   19.8737   0.25      2.77259  1       19.8739      0.000781037     5.03173  20.1269\n```\n\nThe 0.6% overestimate of CL\u002FF is the trapezoidal rule on a sparsely sampled absorption phase, not\nan error — it is the irreducible bias of NCA on that sampling schedule, and it is why NCA and\ncompartmental estimates of clearance never agree exactly.\n\nThe findings are the point. A steady-state profile truncated at tau produces:\n\n```\nfinding: subject A: 25.2% of AUCinf is extrapolated (above 20%); AUCinf is driven by the\n         lambda_z fit, not by data\nfinding: subject A: lambda_z window spans 0.58 half-lives (below 2.0); the terminal phase may\n         not have been reached\n```\n\nBoth are correct and both are routinely ignored. At steady state the reportable exposure metric is\nAUC(0-tau), not AUCinf; the script computes AUCinf anyway and tells you not to trust it.\n\n### 2. Compartmental fitting and model selection\n\n```bash\npython3 fit_compartmental.py -i profile.csv --dose 500 --route iv-bolus --compare 1cmt,2cmt,3cmt\n```\n\nParameters are estimated on the log scale, so they cannot go negative and their confidence\nintervals come out asymmetric. Weighting defaults to `1\u002Fy2` (constant CV), which is the right\ndefault for PK and the wrong one for a homoscedastic PD endpoint.\n\nFitting simulated two-compartment data (CL 4, V1 12, Q 6, V2 40, 8% proportional error):\n\n```\nmodel  parameters  wssr       aic       bic       f_vs_simpler  f_p_value    compared_with\n1cmt   2           3.13201    -19.4956  -18.0795  n\u002Fa           n\u002Fa          n\u002Fa\n2cmt   4           0.0309579  -84.7477  -81.9155  550.936       9.38016e-12  1cmt\n3cmt   6           0.0232859  -85.0193  -80.771   1.4826        0.27762      2cmt\n```\n\n**AIC picks the three-compartment model. BIC and the F test both reject it.** AIC's fixed penalty\nof 2 per parameter is weak at this sample size, and it selects the overparameterised model more\noften than practitioners expect. The parameter table settles it:\n\n```\nfinding: fit: Q3 has 98% RSE - not estimable from these data at this model size\nfinding: fit: V3 has 71% RSE - not estimable from these data at this model size\n```\n\nThe one-compartment fit meanwhile earns:\n\n```\nfinding: fit: residual signs are not random (runs test p = 0.0036) - a structural\n         misspecification, which no amount of reweighting will fix\n```\n\nThat distinction — structural misspecification versus a wrong error model — is the one to get\nright. A residual-versus-time plot with runs of the same sign means the *model shape* is wrong.\nHeteroscedastic residuals with random signs mean the *weighting* is wrong. Reweighting the first\ncase hides it without fixing it.\n\n### 3. Population PK\n\nCheck the dataset before running anything. This is where the time actually goes.\n\n```bash\npython3 check_popk_dataset.py -i nmdata.csv --covariates WT,CRCL --time-varying WT\n```\n\nThe defects that matter are the silent ones. NM-TRAN does not reject a non-numeric DV — it reads\n`BLQ` as zero and fits it as a genuine zero concentration. A blank covariate becomes 0, so a\nmissing body weight becomes a 0 kg patient. `ADDL` without `II` places no additional doses.\nRecords sharing a timestamp are applied in file order, so whether a level is pre- or post-dose\ndepends on which row came first. None of these stop a run.\n\n```\nseverity  check                            detail\nerror     non-numeric DV                   DV contains text... NM-TRAN reads them as 0\nerror     subject with no dose             1 subject(s) have observations but no dose: 2\nerror     TIME not sorted                  1 subject(s) have out-of-order TIME: 1\nerror     covariate WT missing             1 record(s) have no value...\nwarning   duplicate TIME within a subject  NONMEM applies them in file order...\n```\n\nFor the estimation itself, this skill does not reimplement NLME — see\n`references\u002Fpopulation-pk.md` for estimation methods, the BLQ M1-M7 methods, covariate model\nbuilding, and the diagnostics that decide whether a model is acceptable, and\n`references\u002Fsoftware-ecosystem.md` for which tool to reach for.\n\n### 4. Simulation and regimen selection\n\n```bash\npython3 simulate_regimen.py --cl 5 --v 40 --dose 500 --interval 12 --n-doses 10 --steady-state\npython3 simulate_regimen.py --cl 5 --v 40 --dose 500 --interval 12 --n-doses 10 \\\n    --simulate 2000 --omega-cl 0.35 --omega-v 0.25 --target-trough 4.0\n```\n\nDeterministic simulation answers \"what does the typical patient look like\", which is almost never\nthe question:\n\n```\nmetric             p5        p25      median   p75      p95      geo_mean\npeak               11.861    14.6018  16.6702  19.1476  22.9339  16.6453\ntrough             0.863226  2.15191  3.64412  5.49655  9.21053  3.27035\n\ntarget       fraction_attaining\ntrough >= 4  0.444\n```\n\nThe typical trough is 3.6 and the target is 4, so **44% of the population attains it**. A regimen\ntuned on the typical patient leaves about half the population on the wrong side of the target.\nReported attainment is still optimistic here: this is between-subject variability only, with no\nresidual or between-occasion component.\n\nLinear models are solved analytically and superposed, which is exact. `--nonlinear` switches to\nintegrated Michaelis-Menten elimination, where superposition is invalid and multiple-dose\nbehaviour cannot be inferred from a single dose at all.\n\n### 5. Exposure-response\n\n```bash\npython3 exposure_response.py --emax -i er.csv --sigmoid\npython3 exposure_response.py --cqtc -i qt.csv --cmax 250\n```\n\nThe Emax fit reports `fraction_of_emax_reached` and flags a fit whose plateau is outside the data.\nWhen the highest observed exposure reaches only a third of the estimated Emax, Emax and EC50 are\nextrapolations that are strongly correlated with each other; quoting them as independent estimates\nis not supportable, and a \"linear\" exposure-response is simply the low-concentration limb of the\nsame curve.\n\n`--cqtc` evaluates the **upper bound of the two-sided 90% confidence interval** of predicted\nplacebo-corrected change-from-baseline QTc against the 10 ms threshold, which is the question ICH\nE14 actually asks. A point estimate, or a 95% interval, answers a different one. The bundled model\nis an ordinary linear regression for screening; a submission-grade C-QTc analysis needs a mixed\nmodel with random intercept and slope per subject.\n\nEvery mode carries the same caveat, because it is the one that gets forgotten: patients are\nrandomised to **dose**, not to **exposure**. Exposure-response across quantiles is observational\neven inside a randomised trial, and can reflect the covariates that drive clearance.\n\n### 6. Bioequivalence\n\n```bash\npython3 bioequivalence.py -i be.csv --design 2x2 --metric AUC\npython3 bioequivalence.py -i be.csv --design replicate --metric Cmax --scaling both\npython3 bioequivalence.py --power --cv 0.30 --gmr 0.95 --target-power 0.80\n```\n\nThree criteria share the word \"bioequivalence\" and are not interchangeable: average BE (90% CI\ninside 80.00-125.00%), EMA's ABEL (limits widened as a function of CVwR, capped at\n69.84-143.19%, point estimate still within 80-125%), and FDA's RSABE (a scaled linearised bound\nvia Hyslop's method, not an interval at all). `--scaling` refuses to run on a 2x2 design:\n\n```\nerror: reference-scaling requires --design replicate. High observed variability in a 2x2 study\ndoes not license widening: without replicated reference administrations there is no estimate of\nwithin-subject reference variability to scale to.\n```\n\nSample size reproduces the published tables exactly (CV 30%, GMR 0.95, 80% power → N = 40 for a\n2x2). Power is computed by integrating over the sampling distribution of the estimated standard\ndeviation rather than treating the standard error as known — the normal approximation overstates\npower at realistic sample sizes. Note that **N is driven far more by the assumed GMR than by CV**;\nassuming 1.00 instead of 0.95 roughly halves the calculated N and is the usual reason a BE study\ncomes in underpowered.\n\n### 7. Scaling, paediatrics, and first-in-human\n\n```bash\npython3 allometry_and_fih.py --scale --cl 5 --weight-from 70 --weight-to 6 --pma-weeks 44\npython3 allometry_and_fih.py --fih --noael rat=50,dog=10 --safety-factor 10\n```\n\nScaling by size alone below about 2 years of age overpredicts clearance, in a neonate by several\nfold, because clearance is limited by enzyme and renal maturation rather than by size. Supplying\n`--pma-weeks` adds the Anderson-Holford sigmoidal maturation term; omitting it below 20 kg raises\na finding.\n\n```\nparameter  reference  exponent  size_scaled  maturation_factor  final\nCL         5          0.75      0.792063     0.30634            0.242641\nV          40         1         3.42857      1                  3.42857\n```\n\nSize alone would predict 0.79 L\u002Fh; with maturation at 44 weeks post-menstrual age it is 0.24 L\u002Fh,\na 3.3-fold difference. Volume is not matured — maturation describes eliminating capacity, not\ndistribution space.\n\n`--fih` uses the body-surface-area conversion from FDA's 2005 maximum-safe-starting-dose guidance\nand always emits a finding that a NOAEL-derived MRSD is not sufficient on its own for agonist\nimmunomodulators: compute MABEL with `--mabel` and take the lower value.\n\n### 8. Drug interactions\n\n```bash\npython3 ddi_static.py --basic --ki 0.5 --imax 2.0 --fu 0.05 --dose 0.4\npython3 ddi_static.py --msm --ki 0.5 --imax 2.0 --fu 0.05 --dose 0.4 --fm 0.9 --fg 0.7\n```\n\nICH M12 basic models with their cut-offs (R1 ≥ 1.02 hepatic, ≥ 11 intestinal; R2 ≥ 1.25 for TDI;\nR3 ≤ 0.8 for induction; transporter cut-offs by site), plus the mechanistic static model. The\nbasic models are deliberately conservative: a negative is meaningful, a positive is a trigger for\nfurther work, not a prediction of clinical magnitude.\n\nThe mechanistic static model reports the ceiling alongside the prediction:\n\n```\nnote: With fm = 0.9, no inhibitor of this pathway can raise the victim AUC above 10.00-fold. If\nthe prediction approaches that ceiling, fm is doing more work than the inhibition constants.\n```\n\n`fm` and `Fg` dominate the answer far more than the inhibition constants, and are usually the\nleast well established numbers in the calculation.\n\n### 9. Therapeutic drug monitoring\n\n```bash\npython3 tdm_bayes.py --model vancomycin-adult --weight 80 --crcl 75 \\\n    --dose 1500 --interval 12 --level 18.2@11.5 --level 42@2 --target-auc24 500\n```\n\nMAP Bayesian estimation shrinks towards the population when the data are uninformative and follows\nthe data when they are not, which is why it beats both a trough read against population parameters\nand log-linear regression on two points. A single level raises a finding: it cannot separate\nclearance from volume, and whichever parameter the sample is uninformative about has simply\nreturned its prior.\n\nThe bundled vancomycin parameterisation is explicitly labelled illustrative. Substitute a model\nvalidated in your population before the output means anything.\n\n## Software ecosystem\n\nVerified against live sources on 2026-07-27; see `references\u002Fsoftware-ecosystem.md` for the full\nmap and `references\u002Fsource-ledger.md` for provenance.\n\n- **Pharmpy 2.1.1** (2026-05-19) is the practical Python entry point — model-agnostic, drives\n  NONMEM\u002Fnlmixr2\u002Frxode2, and ships 19 `run_*` tools including `run_amd`, `run_modelsearch`,\n  `run_covsearch`, `run_structsearch`, `run_pdsearch`, `run_modelrank`, `run_vpc` and `run_qa`.\n  Two breaking changes are recent enough to catch you out: **2.0.0 (2026-02-12) changed dataset\n  row indices to start at 1**, and **2.1.0 (2026-05-08) renamed `add_placebo_model` to\n  `set_placebo_model`** and now requires numpy ≥ 2.\n- **NONMEM 7.6** (user guides dated November 2025) remains the regulatory default. New since 7.5:\n  ADVAN16 (RADAR5 implicit Runge-Kutta for stiff delay differential equations), ADVAN17 (stiff\n  delay differential-algebraic), NUTS Bayesian sampling, and SAEM storage of individual samples.\n- **nlmixr2** (requires rxode2 ≥ 5.0.0) is the credible open-source NLME alternative;\n  `babelmixr2` and `monolix2rx` translate models between it, NONMEM and Monolix.\n- **PKPy** (PeerJ, 2025) is a Python popPK framework but is **GitHub-only — not on PyPI**, so\n  `uv pip install pkpy` fails. `chi-drm` (1.0.3) is on PyPI for Bayesian PKPD.\n- **Open Systems Pharmacology Suite v12** (PK-Sim\u002FMoBi) is the open-source PBPK platform; Simcyp\n  and GastroPlus are the commercial ones. `ospsuite` is R-only and needs .NET 8.\n\nPython has no mature NCA or NLME package of regulatory standing. That gap is why this skill ships\nits own validated NCA and fitting implementations rather than wrapping one.\n\n## What this skill exists to prevent\n\n1. Lambda_z chosen by plain r-squared, or fitted through Tmax.\n2. AUCinf reported from a profile where 25% of it was extrapolated.\n3. AIC allowed to select a compartment whose intercompartmental clearance has 98% RSE.\n4. Reweighting used to fix non-random residuals, which are a structural problem.\n5. `BLQ` left in a DV column, where NM-TRAN reads it as a real zero.\n6. A regimen chosen on the typical patient, with no attainment estimate for the population.\n7. Emax and EC50 quoted as independent estimates when the plateau was never observed.\n8. Reference-scaled bioequivalence limits applied to a 2x2 study.\n9. Allometric scaling to a neonate with no maturation term.\n10. An MRSD from a NOAEL used as the starting dose for an agonist immunomodulator.\n\n## References\n\n- `references\u002Fnca-conventions.md` — parameter definitions, lambda_z rules, BLQ handling, steady state\n- `references\u002Fstructural-models.md` — closed-form solutions, parameterisations, NONMEM ADVAN\u002FTRANS map\n- `references\u002Fpopulation-pk.md` — NLME estimation, covariate building, BLQ M1-M7, diagnostics, VPC\n- `references\u002Fpd-and-exposure-response.md` — Emax, indirect response, effect compartment, ER analysis\n- `references\u002Ftmdd-and-biologics.md` — TMDD approximations, monoclonal antibody PK, immunogenicity\n- `references\u002Fpbpk.md` — when PBPK earns its cost, platforms, and what verification requires\n- `references\u002Fbioequivalence.md` — designs, ABE\u002FABEL\u002FRSABE, ICH M13 series, highly variable drugs\n- `references\u002Fspecial-populations.md` — paediatrics, renal and hepatic impairment, obesity, pregnancy\n- `references\u002Fdataset-standards.md` — CDISC PC\u002FPP and ADPC\u002FADPP, NONMEM data items, common defects\n- `references\u002Fddi-and-qt.md` — ICH M12 stepwise assessment, static models, ICH E14\u002FS7B C-QTc\n- `references\u002Fantimicrobial-and-tdm.md` — PK\u002FPD indices, PTA\u002FCFR, vancomycin AUC-guided dosing, MIPD\n- `references\u002Fsoftware-ecosystem.md` — every tool, what it is for, licensing, and verified versions\n- `references\u002Fregulatory-guidance.md` — the guidance ledger with dates, status, and what each requires\n- `references\u002Fsource-ledger.md` — provenance and research dates for every claim in this skill\n\n## Assets\n\n- `assets\u002Fpopk-analysis-plan.md` — population analysis plan structure, with the decisions stated up front\n- `assets\u002Fnca-reporting-checklist.md` — what an NCA report has to state for the numbers to be interpretable\n\n\n## Open Science regression safeguards\n\n- Convert per-kilogram animal CL and V to total-animal quantities before total-body allometry. Keep each half-life calculation within one named CL\u002FV scenario; crossed methods are combination sensitivities.\n- Protein binding correction requires an explicit total-versus-unbound clearance model and must not be applied twice. Do not derive Vss mechanically as Vss\u002Ffu.\n- MABEL is not a fixed receptor-occupancy percentage. Missing potency, target expression\u002Fturnover, TE\u002FPD, NOAEL exposure or human F blocks an operational FIH dose.\n","# Pharmacokinetic and Pharmacodynamic Modelling\n\n## When to use\n\nAny question about what the body does to a drug or what the drug does to the body: deriving\nexposure metrics from concentration-time data, fitting a structural model, building or checking a\npopulation analysis, choosing a dose or a regimen, relating exposure to effect, comparing\nformulations, or scaling to a new population.\n\n## The three rules\n\n**1. Fix the exposure metric and the analysis population before computing anything.** AUC(0-t),\nAUC(0-inf), AUC(0-tau) at steady state, and Cavg are different quantities and answer different\nquestions. So do AUCinf based on observed versus predicted Clast. Choosing after seeing the\nnumbers is how a negative study becomes positive.\n\n**2. Structural model, variability model, and covariate model are three separate decisions.** They\nget conflated constantly — an extra compartment added to absorb what is really unmodelled\nbetween-occasion variability, a covariate added to fix what is really a misspecified absorption\nmodel. Diagnose which one is wrong before changing any of them.\n\n**3. Convergence is not identifiability.** A fit that converges with 200% relative standard error\non a parameter, or a correlation of 0.99 between two, has told you the data cannot separate them.\nEvery fitting script here reports both and flags them, because the parameter table alone looks\nfine in exactly this situation.\n\n## Scope\n\nThis skill computes, diagnoses, and structures. It does **not** decide that a formulation is\nbioequivalent, select a dose for a trial, recommend a dose for a patient, conclude that a drug has\nno QT liability, or replace a qualified pharmacometrician, clinical pharmacologist, or the\nregulatory review. The scripts report; none of them concludes. `tdm_bayes.py` in particular is a\nmodelling aid — any change to a patient's regimen is the treating clinician's decision.\n\n## Scripts\n\n```bash\ncd skills\u002Fpkpd-modeling\u002Fscripts\n```\n\n| Script | Question answered |\n| --- | --- |\n| `nca.py` | What are the exposure metrics, and is the terminal phase good enough to report them? |\n| `fit_compartmental.py` | Which structural model do these data support, and are its parameters identifiable? |\n| `simulate_regimen.py` | What does this regimen do at steady state, and to what fraction of the population? |\n| `check_popk_dataset.py` | Will NONMEM read this dataset the way I think it will? |\n| `exposure_response.py` | Is there an exposure-response relationship, and is the plateau in the data? |\n| `bioequivalence.py` | Does the 90% CI meet the criterion, and which criterion applies? |\n| `allometry_and_fih.py` | What is the starting dose, or the dose in a smaller\u002Fyounger population? |\n| `ddi_static.py` | Does the in vitro data trigger a clinical DDI study under ICH M12? |\n| `tdm_bayes.py` | What are this patient's individual parameters from their measured levels? |\n\nAll take `--format table|tsv|json`. Data goes to stdout, provenance and findings to stderr, so\n`> out.tsv` keeps them separate. Exit code is `0` for no findings, `1` when findings were raised,\n`2` for bad input, so any of them can gate a workflow.\n\nTwo private modules carry the shared machinery: `_models.py` (analytical solutions for linear\nmammillary models, plus integrated Michaelis-Menten, TMDD and indirect-response structures) and\n`_common.py` (I\u002FO and reporting). Import them rather than re-deriving a Bateman function.\n\n## Workflow\n\n### 1. Non-compartmental analysis\n\n```bash\npython3 nca.py -i profile.csv --dose 100 --route extravascular --partial-auc 0-24\n```\n\nFour choices decide the answer and are usually left implicit. This script makes all four explicit:\n`--auc-method` (default `linup-logdown`), `--blq-rule`, `--lambda-z-points` or an explicit\n`--lambda-z-window`, and whether you report `auc_inf_obs` or `auc_inf_pred`.\n\nLambda_z selection uses the standard rule: start from the last three quantifiable points, extend\nbackwards, keep the longer window only if **adjusted** r-squared improves by more than 0.0001.\nPlain r-squared can only rise as points are added, so it would always pick the longest window.\nPoints at or before Tmax are never eligible — including Tmax fits the tail of absorption and\nbiases half-life, Vz and AUCinf downward.\n\nOn a noiseless simulated one-compartment oral profile with CL\u002FF = 5, V\u002FF = 20, ka = 1.2:\n\n```\nid  cmax     tmax  auc_last  lambda_z  t_half   r2_adj  auc_inf_obs  pct_auc_extrap  cl_f     vz_f\n1   3.29678  1.5   19.8737   0.25      2.77259  1       19.8739      0.000781037     5.03173  20.1269\n```\n\nThe 0.6% overestimate of CL\u002FF is the trapezoidal rule on a sparsely sampled absorption phase, not\nan error — it is the irreducible bias of NCA on that sampling schedule, and it is why NCA and\ncompartmental estimates of clearance never agree exactly.\n\nThe findings are the point. A steady-state profile truncated at tau produces:\n\n```\nfinding: subject A: 25.2% of AUCinf is extrapolated (above 20%); AUCinf is driven by the\n         lambda_z fit, not by data\nfinding: subject A: lambda_z window spans 0.58 half-lives (below 2.0); the terminal phase may\n         not have been reached\n```\n\nBoth are correct and both are routinely ignored. At steady state the reportable exposure metric is\nAUC(0-tau), not AUCinf; the script computes AUCinf anyway and tells you not to trust it.\n\n### 2. Compartmental fitting and model selection\n\n```bash\npython3 fit_compartmental.py -i profile.csv --dose 500 --route iv-bolus --compare 1cmt,2cmt,3cmt\n```\n\nParameters are estimated on the log scale, so they cannot go negative and their confidence\nintervals come out asymmetric. Weighting defaults to `1\u002Fy2` (constant CV), which is the right\ndefault for PK and the wrong one for a homoscedastic PD endpoint.\n\nFitting simulated two-compartment data (CL 4, V1 12, Q 6, V2 40, 8% proportional error):\n\n```\nmodel  parameters  wssr       aic       bic       f_vs_simpler  f_p_value    compared_with\n1cmt   2           3.13201    -19.4956  -18.0795  n\u002Fa           n\u002Fa          n\u002Fa\n2cmt   4           0.0309579  -84.7477  -81.9155  550.936       9.38016e-12  1cmt\n3cmt   6           0.0232859  -85.0193  -80.771   1.4826        0.27762      2cmt\n```\n\n**AIC picks the three-compartment model. BIC and the F test both reject it.** AIC's fixed penalty\nof 2 per parameter is weak at this sample size, and it selects the overparameterised model more\noften than practitioners expect. The parameter table settles it:\n\n```\nfinding: fit: Q3 has 98% RSE - not estimable from these data at this model size\nfinding: fit: V3 has 71% RSE - not estimable from these data at this model size\n```\n\nThe one-compartment fit meanwhile earns:\n\n```\nfinding: fit: residual signs are not random (runs test p = 0.0036) - a structural\n         misspecification, which no amount of reweighting will fix\n```\n\nThat distinction — structural misspecification versus a wrong error model — is the one to get\nright. A residual-versus-time plot with runs of the same sign means the *model shape* is wrong.\nHeteroscedastic residuals with random signs mean the *weighting* is wrong. Reweighting the first\ncase hides it without fixing it.\n\n### 3. Population PK\n\nCheck the dataset before running anything. This is where the time actually goes.\n\n```bash\npython3 check_popk_dataset.py -i nmdata.csv --covariates WT,CRCL --time-varying WT\n```\n\nThe defects that matter are the silent ones. NM-TRAN does not reject a non-numeric DV — it reads\n`BLQ` as zero and fits it as a genuine zero concentration. A blank covariate becomes 0, so a\nmissing body weight becomes a 0 kg patient. `ADDL` without `II` places no additional doses.\nRecords sharing a timestamp are applied in file order, so whether a level is pre- or post-dose\ndepends on which row came first. None of these stop a run.\n\n```\nseverity  check                            detail\nerror     non-numeric DV                   DV contains text... NM-TRAN reads them as 0\nerror     subject with no dose             1 subject(s) have observations but no dose: 2\nerror     TIME not sorted                  1 subject(s) have out-of-order TIME: 1\nerror     covariate WT missing             1 record(s) have no value...\nwarning   duplicate TIME within a subject  NONMEM applies them in file order...\n```\n\nFor the estimation itself, this skill does not reimplement NLME — see\n`references\u002Fpopulation-pk.md` for estimation methods, the BLQ M1-M7 methods, covariate model\nbuilding, and the diagnostics that decide whether a model is acceptable, and\n`references\u002Fsoftware-ecosystem.md` for which tool to reach for.\n\n### 4. Simulation and regimen selection\n\n```bash\npython3 simulate_regimen.py --cl 5 --v 40 --dose 500 --interval 12 --n-doses 10 --steady-state\npython3 simulate_regimen.py --cl 5 --v 40 --dose 500 --interval 12 --n-doses 10 \\\n    --simulate 2000 --omega-cl 0.35 --omega-v 0.25 --target-trough 4.0\n```\n\nDeterministic simulation answers \"what does the typical patient look like\", which is almost never\nthe question:\n\n```\nmetric             p5        p25      median   p75      p95      geo_mean\npeak               11.861    14.6018  16.6702  19.1476  22.9339  16.6453\ntrough             0.863226  2.15191  3.64412  5.49655  9.21053  3.27035\n\ntarget       fraction_attaining\ntrough >= 4  0.444\n```\n\nThe typical trough is 3.6 and the target is 4, so **44% of the population attains it**. A regimen\ntuned on the typical patient leaves about half the population on the wrong side of the target.\nReported attainment is still optimistic here: this is between-subject variability only, with no\nresidual or between-occasion component.\n\nLinear models are solved analytically and superposed, which is exact. `--nonlinear` switches to\nintegrated Michaelis-Menten elimination, where superposition is invalid and multiple-dose\nbehaviour cannot be inferred from a single dose at all.\n\n### 5. Exposure-response\n\n```bash\npython3 exposure_response.py --emax -i er.csv --sigmoid\npython3 exposure_response.py --cqtc -i qt.csv --cmax 250\n```\n\nThe Emax fit reports `fraction_of_emax_reached` and flags a fit whose plateau is outside the data.\nWhen the highest observed exposure reaches only a third of the estimated Emax, Emax and EC50 are\nextrapolations that are strongly correlated with each other; quoting them as independent estimates\nis not supportable, and a \"linear\" exposure-response is simply the low-concentration limb of the\nsame curve.\n\n`--cqtc` evaluates the **upper bound of the two-sided 90% confidence interval** of predicted\nplacebo-corrected change-from-baseline QTc against the 10 ms threshold, which is the question ICH\nE14 actually asks. A point estimate, or a 95% interval, answers a different one. The bundled model\nis an ordinary linear regression for screening; a submission-grade C-QTc analysis needs a mixed\nmodel with random intercept and slope per subject.\n\nEvery mode carries the same caveat, because it is the one that gets forgotten: patients are\nrandomised to **dose**, not to **exposure**. Exposure-response across quantiles is observational\neven inside a randomised trial, and can reflect the covariates that drive clearance.\n\n### 6. Bioequivalence\n\n```bash\npython3 bioequivalence.py -i be.csv --design 2x2 --metric AUC\npython3 bioequivalence.py -i be.csv --design replicate --metric Cmax --scaling both\npython3 bioequivalence.py --power --cv 0.30 --gmr 0.95 --target-power 0.80\n```\n\nThree criteria share the word \"bioequivalence\" and are not interchangeable: average BE (90% CI\ninside 80.00-125.00%), EMA's ABEL (limits widened as a function of CVwR, capped at\n69.84-143.19%, point estimate still within 80-125%), and FDA's RSABE (a scaled linearised bound\nvia Hyslop's method, not an interval at all). `--scaling` refuses to run on a 2x2 design:\n\n```\nerror: reference-scaling requires --design replicate. High observed variability in a 2x2 study\ndoes not license widening: without replicated reference administrations there is no estimate of\nwithin-subject reference variability to scale to.\n```\n\nSample size reproduces the published tables exactly (CV 30%, GMR 0.95, 80% power → N = 40 for a\n2x2). Power is computed by integrating over the sampling distribution of the estimated standard\ndeviation rather than treating the standard error as known — the normal approximation overstates\npower at realistic sample sizes. Note that **N is driven far more by the assumed GMR than by CV**;\nassuming 1.00 instead of 0.95 roughly halves the calculated N and is the usual reason a BE study\ncomes in underpowered.\n\n### 7. Scaling, paediatrics, and first-in-human\n\n```bash\npython3 allometry_and_fih.py --scale --cl 5 --weight-from 70 --weight-to 6 --pma-weeks 44\npython3 allometry_and_fih.py --fih --noael rat=50,dog=10 --safety-factor 10\n```\n\nScaling by size alone below about 2 years of age overpredicts clearance, in a neonate by several\nfold, because clearance is limited by enzyme and renal maturation rather than by size. Supplying\n`--pma-weeks` adds the Anderson-Holford sigmoidal maturation term; omitting it below 20 kg raises\na finding.\n\n```\nparameter  reference  exponent  size_scaled  maturation_factor  final\nCL         5          0.75      0.792063     0.30634            0.242641\nV          40         1         3.42857      1                  3.42857\n```\n\nSize alone would predict 0.79 L\u002Fh; with maturation at 44 weeks post-menstrual age it is 0.24 L\u002Fh,\na 3.3-fold difference. Volume is not matured — maturation describes eliminating capacity, not\ndistribution space.\n\n`--fih` uses the body-surface-area conversion from FDA's 2005 maximum-safe-starting-dose guidance\nand always emits a finding that a NOAEL-derived MRSD is not sufficient on its own for agonist\nimmunomodulators: compute MABEL with `--mabel` and take the lower value.\n\n### 8. Drug interactions\n\n```bash\npython3 ddi_static.py --basic --ki 0.5 --imax 2.0 --fu 0.05 --dose 0.4\npython3 ddi_static.py --msm --ki 0.5 --imax 2.0 --fu 0.05 --dose 0.4 --fm 0.9 --fg 0.7\n```\n\nICH M12 basic models with their cut-offs (R1 ≥ 1.02 hepatic, ≥ 11 intestinal; R2 ≥ 1.25 for TDI;\nR3 ≤ 0.8 for induction; transporter cut-offs by site), plus the mechanistic static model. The\nbasic models are deliberately conservative: a negative is meaningful, a positive is a trigger for\nfurther work, not a prediction of clinical magnitude.\n\nThe mechanistic static model reports the ceiling alongside the prediction:\n\n```\nnote: With fm = 0.9, no inhibitor of this pathway can raise the victim AUC above 10.00-fold. If\nthe prediction approaches that ceiling, fm is doing more work than the inhibition constants.\n```\n\n`fm` and `Fg` dominate the answer far more than the inhibition constants, and are usually the\nleast well established numbers in the calculation.\n\n### 9. Therapeutic drug monitoring\n\n```bash\npython3 tdm_bayes.py --model vancomycin-adult --weight 80 --crcl 75 \\\n    --dose 1500 --interval 12 --level 18.2@11.5 --level 42@2 --target-auc24 500\n```\n\nMAP Bayesian estimation shrinks towards the population when the data are uninformative and follows\nthe data when they are not, which is why it beats both a trough read against population parameters\nand log-linear regression on two points. A single level raises a finding: it cannot separate\nclearance from volume, and whichever parameter the sample is uninformative about has simply\nreturned its prior.\n\nThe bundled vancomycin parameterisation is explicitly labelled illustrative. Substitute a model\nvalidated in your population before the output means anything.\n\n## Software ecosystem\n\nVerified against live sources on 2026-07-27; see `references\u002Fsoftware-ecosystem.md` for the full\nmap and `references\u002Fsource-ledger.md` for provenance.\n\n- **Pharmpy 2.1.1** (2026-05-19) is the practical Python entry point — model-agnostic, drives\n  NONMEM\u002Fnlmixr2\u002Frxode2, and ships 19 `run_*` tools including `run_amd`, `run_modelsearch`,\n  `run_covsearch`, `run_structsearch`, `run_pdsearch`, `run_modelrank`, `run_vpc` and `run_qa`.\n  Two breaking changes are recent enough to catch you out: **2.0.0 (2026-02-12) changed dataset\n  row indices to start at 1**, and **2.1.0 (2026-05-08) renamed `add_placebo_model` to\n  `set_placebo_model`** and now requires numpy ≥ 2.\n- **NONMEM 7.6** (user guides dated November 2025) remains the regulatory default. New since 7.5:\n  ADVAN16 (RADAR5 implicit Runge-Kutta for stiff delay differential equations), ADVAN17 (stiff\n  delay differential-algebraic), NUTS Bayesian sampling, and SAEM storage of individual samples.\n- **nlmixr2** (requires rxode2 ≥ 5.0.0) is the credible open-source NLME alternative;\n  `babelmixr2` and `monolix2rx` translate models between it, NONMEM and Monolix.\n- **PKPy** (PeerJ, 2025) is a Python popPK framework but is **GitHub-only — not on PyPI**, so\n  `uv pip install pkpy` fails. `chi-drm` (1.0.3) is on PyPI for Bayesian PKPD.\n- **Open Systems Pharmacology Suite v12** (PK-Sim\u002FMoBi) is the open-source PBPK platform; Simcyp\n  and GastroPlus are the commercial ones. `ospsuite` is R-only and needs .NET 8.\n\nPython has no mature NCA or NLME package of regulatory standing. That gap is why this skill ships\nits own validated NCA and fitting implementations rather than wrapping one.\n\n## What this skill exists to prevent\n\n1. Lambda_z chosen by plain r-squared, or fitted through Tmax.\n2. AUCinf reported from a profile where 25% of it was extrapolated.\n3. AIC allowed to select a compartment whose intercompartmental clearance has 98% RSE.\n4. Reweighting used to fix non-random residuals, which are a structural problem.\n5. `BLQ` left in a DV column, where NM-TRAN reads it as a real zero.\n6. A regimen chosen on the typical patient, with no attainment estimate for the population.\n7. Emax and EC50 quoted as independent estimates when the plateau was never observed.\n8. Reference-scaled bioequivalence limits applied to a 2x2 study.\n9. Allometric scaling to a neonate with no maturation term.\n10. An MRSD from a NOAEL used as the starting dose for an agonist immunomodulator.\n\n## References\n\n- `references\u002Fnca-conventions.md` — parameter definitions, lambda_z rules, BLQ handling, steady state\n- `references\u002Fstructural-models.md` — closed-form solutions, parameterisations, NONMEM ADVAN\u002FTRANS map\n- `references\u002Fpopulation-pk.md` — NLME estimation, covariate building, BLQ M1-M7, diagnostics, VPC\n- `references\u002Fpd-and-exposure-response.md` — Emax, indirect response, effect compartment, ER analysis\n- `references\u002Ftmdd-and-biologics.md` — TMDD approximations, monoclonal antibody PK, immunogenicity\n- `references\u002Fpbpk.md` — when PBPK earns its cost, platforms, and what verification requires\n- `references\u002Fbioequivalence.md` — designs, ABE\u002FABEL\u002FRSABE, ICH M13 series, highly variable drugs\n- `references\u002Fspecial-populations.md` — paediatrics, renal and hepatic impairment, obesity, pregnancy\n- `references\u002Fdataset-standards.md` — CDISC PC\u002FPP and ADPC\u002FADPP, NONMEM data items, common defects\n- `references\u002Fddi-and-qt.md` — ICH M12 stepwise assessment, static models, ICH E14\u002FS7B C-QTc\n- `references\u002Fantimicrobial-and-tdm.md` — PK\u002FPD indices, PTA\u002FCFR, vancomycin AUC-guided dosing, MIPD\n- `references\u002Fsoftware-ecosystem.md` — every tool, what it is for, licensing, and verified versions\n- `references\u002Fregulatory-guidance.md` — the guidance ledger with dates, status, and what each requires\n- `references\u002Fsource-ledger.md` — provenance and research dates for every claim in this skill\n\n## Assets\n\n- `assets\u002Fpopk-analysis-plan.md` — population analysis plan structure, with the decisions stated up front\n- `assets\u002Fnca-reporting-checklist.md` — what an NCA report has to state for the numbers to be interpretable\n\n\n## Open Science regression safeguards\n\n- Convert per-kilogram animal CL and V to total-animal quantities before total-body allometry. Keep each half-life calculation within one named CL\u002FV scenario; crossed methods are combination sensitivities.\n- Protein binding correction requires an explicit total-versus-unbound clearance model and must not be applied twice. Do not derive Vss mechanically as Vss\u002Ffu.\n- MABEL is not a fixed receptor-occupancy percentage. Missing potency, target expression\u002Fturnover, TE\u002FPD, NOAEL exposure or human F blocks an operational FIH dose.\n",{"name":5,"license":15,"metadata":24,"description":7},{"version":25,"last-reviewed":26},"1.0.0","2026-07-27","main","e0956dc9606356ab78468936b502e55a365282e2","specialist-src\u002Fpublished-skills\u002Fpkpd-modeling",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill pkpd-modeling",{"tool":40,"command":41},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill pkpd-modeling",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill pkpd-modeling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002FSKILL.md",true,[48,54,58,64,68,72,76,80,84,88,92,96,100,104,108,112,116,122,126,130,134,138,142,146,150,154,158],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"assets\u002Fnca-reporting-checklist.md","ASSET","资产文件",3437,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fassets\u002Fnca-reporting-checklist.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"assets\u002Fpopk-analysis-plan.md",5010,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fassets\u002Fpopk-analysis-plan.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"references\u002Fantimicrobial-and-tdm.md","REFERENCE","参考文档",6296,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fantimicrobial-and-tdm.md",{"path":65,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fbioequivalence.md",6375,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fbioequivalence.md",{"path":69,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fdataset-standards.md",5825,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fdataset-standards.md",{"path":73,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fddi-and-qt.md",6475,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fddi-and-qt.md",{"path":77,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fnca-conventions.md",6816,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fnca-conventions.md",{"path":81,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fpbpk.md",5420,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fpbpk.md",{"path":85,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fpd-and-exposure-response.md",7785,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fpd-and-exposure-response.md",{"path":89,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fpopulation-pk.md",8183,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fpopulation-pk.md",{"path":93,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fregulatory-guidance.md",6220,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fregulatory-guidance.md",{"path":97,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fsoftware-ecosystem.md",6486,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fsoftware-ecosystem.md",{"path":101,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fsource-ledger.md",6411,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fsource-ledger.md",{"path":105,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fspecial-populations.md",6707,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fspecial-populations.md",{"path":109,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fstructural-models.md",7466,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Fstructural-models.md",{"path":113,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Ftmdd-and-biologics.md",6103,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Freferences\u002Ftmdd-and-biologics.md",{"path":117,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":120,"sourceHtmlUrl":121},"scripts\u002F_common.py","SCRIPT","脚本",10899,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002F_common.py",{"path":123,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":124,"sourceHtmlUrl":125},"scripts\u002F_models.py",25521,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002F_models.py",{"path":127,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":128,"sourceHtmlUrl":129},"scripts\u002Fallometry_and_fih.py",16477,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fallometry_and_fih.py",{"path":131,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":132,"sourceHtmlUrl":133},"scripts\u002Fbioequivalence.py",20490,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fbioequivalence.py",{"path":135,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":136,"sourceHtmlUrl":137},"scripts\u002Fcheck_popk_dataset.py",17238,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fcheck_popk_dataset.py",{"path":139,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":140,"sourceHtmlUrl":141},"scripts\u002Fddi_static.py",15708,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fddi_static.py",{"path":143,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":144,"sourceHtmlUrl":145},"scripts\u002Fexposure_response.py",14669,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fexposure_response.py",{"path":147,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":148,"sourceHtmlUrl":149},"scripts\u002Ffit_compartmental.py",21624,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Ffit_compartmental.py",{"path":151,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":152,"sourceHtmlUrl":153},"scripts\u002Fnca.py",23289,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fnca.py",{"path":155,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":156,"sourceHtmlUrl":157},"scripts\u002Fsimulate_regimen.py",15790,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Fsimulate_regimen.py",{"path":159,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":160,"sourceHtmlUrl":161},"scripts\u002Ftdm_bayes.py",13050,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialist-src\u002Fpublished-skills\u002Fpkpd-modeling\u002Fscripts\u002Ftdm_bayes.py",[163,171,178,185,192,199],{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":198,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":167,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]