Repository navigation
Release notes for pkpdutils 1.3.0
Minor release of pkpdutils which compares the non-compartmental analysis against the public benchmark suite of the NonCompart validation report (#103): all eight scenarios (theophylline and indomethacin, intravenous bolus, 0.25 h infusion and extravascular dose, linear and linear-up / log-down trapezoids) against the published Phoenix WinNonlin output and against PKNCA 0.12.1 and NonCompart 0.8.4 run on the same data, plus analytical profiles with an exact answer. Every parameter of every subject agrees with all three tools, to the digits the published tables carry. The comparison found one important difference, now fixed: the area of an extravascular dose whose first sample comes after the dose. The new pkpdutils.crosswalk writes and reads the result tables of the three tools, and every result carries the predicted variants of the extrapolated parameters.
Important fixes
- The area of an extravascular single dose starts at the dose. A curve whose first sample comes after the dose now gets a zero inserted at the dose time for the areas (never for the terminal regression), as for an infusion and as Phoenix WinNonlin, PKNCA and NonCompart all do. Up to 1.2.0 the area of such a curve started at its first sample, which was deliberately left out of the zero rule in 1.2.0; the benchmark shows that every reference tool applies it, and without it
auc_last,auc_all,auc_inf_obs,aumc_*,mrt,cl_f,vz_fand the extrapolated fractions of the extravascular indomethacin profiles were up to 13 % off. A curve with a sample at the dose (the theophylline study) is unchanged.partial_aucand the urine analysis already applied the rule; the documentation ofnca_urinedescribed it. - The NCA figure shades the area the analysis computed.
plot_nca,plot_nca_gridanddraw_nca_panelshadeAUC(0-tlast)from the dose, with the value the analysis inserts there (the back-extrapolatedC0after a bolus, 0 after an infusion or an extravascular dose) and a dotted segment to the first sample; before, the shading started at the first sample and left out the area the reported number contains.
Breaking changes
auc_last,auc_all,auc_inf_obs,auc_inf_pred,aumc_last,aumc_inf,mrt,thalf_eff,cl_f,vz_f,auc_extrap_fraction, the dose normalized areas and everything computed from them (summaries, ratios, bioequivalence, the uncertainty) change for an extravascular single dose curve whose first sample is after the dose; see "Important fixes". A BLQ value at the dose which a rule drops leaves the same gap and is filled with the same zero.- Every
NCAResultof a single dose analysis carries the new variables below, soto_dataframe,to_ppand the tables have more columns.
Non-compartmental analysis
- The predicted variants of Phoenix WinNonlin and PKNCA, from the value of the terminal regression at
tlast(clast_pred):aumc_inf_pred,mrt_pred,cl_pred/cl_f_pred,vz_pred/vz_f_pred,vss_pred,auc_inf_pred_dn,auc_extrap_fraction_predandauc_back_extrap_fraction_pred; andaumc_extrap_fraction,aumc_extrap_fraction_predandmrt_last, the mean residence time to the last measurable value. The mean residence times of an infusion are corrected by half its duration. Their CDISC codes (AUMCIFP,MRTEVIFP/MRTIBIFP/MRTICIFP,CLP,CLFP,VZP,VZFP,VSSP,AUCIFPD,AUCPEP,AUCPBEP,AUMCPEO,AUMCPEP,MRTEVLST/MRTIBLST/MRTICLST) are extracted from the same NCI EVS terminology file as the others, and the fractions are written as percentages in the PP domain.
Data formats
pkpdutils.crosswalk, the result tables of other tools:to_winnonlin/write_winnonlin/read_winnonlin(the "Final Parameters Pivoted" table of Phoenix WinNonlin),to_pknca_results/write_pknca_results/read_pknca_results(the long table ofas.data.frame(pk.nca(...))) andto_noncompart/write_noncompart/read_noncompart(the table ofNonCompart::tblNCA), with the name mapsWINNONLIN_NAMES,PKNCA_NAMES,NONCOMPART_NAMESand their route dependent parts. The writers export the percentages of the tools, the readers return the variables ofpkpdutilswith fractions, so a published result compares column by column.Timecourses.from_dataframe(dose_duration=...)reads the infusion duration from a column, constant per sample or one per dose withdose_time.
Validation
docs/benchmark_datasets.md: the eight scenarios with every setting indocs/data/benchmarks/scenarios.csv, the code of the comparison, the largest deviation per parameter and tool, the exported tables and the analytical profiles (the exact monoexponential bolus and the convergence of the trapezoid on a Bateman curve). Every table is the printed output of the code above it, pasted byscripts/benchmark_datasets.py;tests/docs/test_benchmark_datasets.pyfails when the page is stale andtests/nca/test_benchmark_datasets.pyasserts the agreement within 1e-8.docs/data/benchmarks/holds the theophylline and indomethacin datasets (moved fromtests/data/validation/), the eight WinNonlin tables of the report unchanged and the PKNCA and NonCompart results, whichscripts/benchmark_datasets.Rrecomputes.
Python
- Python 3.15 is supported and tested on Linux, macOS and Windows (#104).
Documentation
- The snippets of the documentation may read the directories of
docs/data/as well. - The pages whose output depends on the extravascular zero (the quickstart, the workflows, NCA, uncertainty, bioequivalence, data formats, units, urinary excretion) and the example figures are regenerated.