Using AyFlux results with CSV, R, PK-Sim, and MoBi
Export simulated concentration–time profiles for analysis and comparison outside AyFlux.
Export results from AyFlux
On the simulator's Concentration tab, open the single Export CSV… dropdown and choose Detailed results for AyFlux's wide-format data, or R / OSP tidy for the long-format CSV. Selecting an option starts the download with time in hours, scenario, analyte, model statistic, concentration in mg/L, and interval coverage.
The tidy file includes plasma and CSF acyclovir, plasma and CSF CMMG, and modeled lower, median, and upper curves across scenarios. Each concentration is a model result, not a patient measurement.
Compare external CSV directly in AyFlux
Open the simulator's Research tools tab, import a PK-Sim or MoBi results CSV, and choose its time and concentration columns and units. AyFlux draws the two concentration curves together, plots their difference, and reports curve-to-curve error metrics. Imported data remain in the browser. This is not native model import or clinical validation.
Read and compare in R
Use the AyFlux R example to read one scenario and compare it with a time series exported by PK-Sim or MoBi. It uses base R and asks you to choose the exact OSP columns and units rather than guessing.
source("interop/ayflux_compare.R")
ayflux <- read_ayflux_curve("ayflux_results_tidy.csv",
scenario = "Intermittent HD")
plot(ayflux$time_hours, ayflux$concentration_mg_L,
type = "l", xlab = "Time (h)", ylab = "mg/L")
The full exchange guide explains column names and comparing an OSP export.
What works with PK-Sim and MoBi?
Open Systems Pharmacology tools can export model results as CSV. You can compare those results against AyFlux in R after matching time, concentration units, dosing, dialysis settings, and sampling compartment.
Important: AyFlux does not create a native PK-Sim or MoBi model. The OSP .pkml format contains model structure, not just results. AyFlux's CSV is not a substitute for .pkml, and direct import into OSP has not been verified for this schema.
Before comparing models
- Use the same drug, administered dose and route, and simulation timeline.
- Check whether values are in mg/L, µg/mL, or a molar unit before comparing them.
- Match plasma with plasma. Do not treat a CSF or CMMG curve as equivalent to a plasma acyclovir curve.
- Account for differences in kidney function, dialysis scheduling, and model structure.
- Recognize that agreement between two models is not independent clinical validation.
For more detail, see PK-Sim's import/export documentation and the OSPSuite-R project.