From 0e52970dc8dcc596acb828c039683f2cc1b587df Mon Sep 17 00:00:00 2001 From: Markus Hovd Date: Mon, 19 Jan 2026 13:33:12 +0100 Subject: [PATCH 1/3] paper: Pre-review changes (#201) * paper: Pre-review changes * Update joss/paper.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * paper: Comments by Julian (#202) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Julian Otalvaro --- .gitignore | 1 + joss/paper.bib | 20 ++++++++++++++++++++ joss/paper.md | 26 +++++++++++++++++++++++--- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b58d307b..58a44b53 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Cargo.lock *.pkm /paper_files paper.html +/joss/paper_files diff --git a/joss/paper.bib b/joss/paper.bib index 51a95c48..6000bd3d 100644 --- a/joss/paper.bib +++ b/joss/paper.bib @@ -76,4 +76,24 @@ @Article{npag publisher = {MDPI AG}, } +@Book{npod, + author = {Hovd, Markus and Kryshchenko, Alona and Neely, Michael N. and Otalvaro, Julian and Schumitzky, Alan and Yamada, Walter M.}, + editor = {Cristina Garcia-Cardona and Harlin Lee}, + publisher = {Springer Nature Switzerland}, + title = {A Non-parametric Optimal Design Algorithm for Population Pharmacokinetics}, + year = {2025}, + address = {Cham}, + isbn = {9783031878046}, + number = {37}, + series = {Association for Women in Mathematics Series}, + booktitle = {Advances in Data Science: Women in Data Science and Mathematics (WiSDM) 2023}, + doi = {10.1007/978-3-031-87804-6_12}, + issn = {2364-5741}, + pages = {259--274}, + pagetotal = {1357}, + ppn_gvk = {1937384802}, + subtitle = {Women in data science and mathematics (WiSDM) 2023}, + url = {https://doi.org/10.1007/978-3-031-87804-6_12}, +} + @Comment{jabref-meta: databaseType:bibtex;} diff --git a/joss/paper.md b/joss/paper.md index 867d586c..9eac5cfc 100644 --- a/joss/paper.md +++ b/joss/paper.md @@ -39,6 +39,22 @@ Pharmacokinetic and pharmacodynamic modeling and simulation are computationally As a fully open-source solution, `pharmsol` empowers users to inspect, modify, and extend the simulation capabilities without licensing constraints. Users can define custom models by specifying their own differential equations as closures, or use the provided analytical solutions for standard compartmental models. Additionally, `pharmsol` can be integrated in more user-friendly languages such as R using `extendr` [@extendr], making it accessible to pharmacometricians who may prefer higher-level interfaces. +# Software design + +To the authors' knowledge, `pharmsol` is the first software written in Rust for pharmacokinetic modeling and simulation. The design principle of `pharmsol` is to provide researchers and pharmacometricians a flexible and efficient library for solving pharmacokinetic problems. + +These problems are defined by two key aspects: the pharmacokinetic data, and the structural model. While the data structure is explained in detail below, the structural model is more complex. In `pharmsol`, models are defined using a set of closures, providing methods to define the set of equations that describe the mass transfer of drug, as well as initial conditions and output equations, i.e. detailing the initial and observed states of the system. Bioavailability terms and lag-time of absorption is also supported. Covariates may be applied on both parameters and state values. Importantly, `pharmsol` provides both linear interpolation and carry-forward for covariates, both common in population pharmacokinetic models. + +The three different solver types, i.e. analytical, ODE, and SDE based, are all built around a common `Equation` trait. This gives `Pharmsol` a modular design, allowing users to easily extend the library with new solvers or to rely on it while being agnostic on the underlying solver type. This flexibility is particularly useful when integrating `pharmsol` with other software, as it allows users to select the most appropriate solver for their specific use case (e.g., speed vs. model complexity). + +# Research impact statement + +As a tool for pharmacokinetic modelling and simulation, `pharmsol` has already demonstrated research impact. Most notably, it is used as a simulation engine for the Rust crate `PMcore` and `Pmetrics` [@pmetrics] - the _de facto_ R package for non-parametric population pharmacokinetic modelling and simulation. + +Additionally, `pharmsol` has been used to generate results in scientific publications, such as the creation of a new algorithm for non-parametric parameter estimation [@npod]. + +Internally, `pharmsol` is also used for simulating alternative dose regimens to individualize drug therapy in patients. + # Data format `pharmsol` is designed around a hierarchical data structure that models the typical organization of pharmacometric data. The primary data struct, `Data`, is a collection of `Subject`s, which may have one or more `Occasion`s, i.e. separate pharmacokinetic investigations. Each occasion consists of one or more `Event`s, e.g. an instantaneous dose (bolus), infusions of drug, or observed concentrations at given times. @@ -47,15 +63,15 @@ As a fully open-source solution, `pharmsol` empowers users to inspect, modify, a Data → Subject → Occasion → Event (Bolus, Infusion, Observation) ``` -Currently, `pharmsol` provides methods to parse the Pmetrics [@pmetrics] data format. In the future, we aim to also support additional formats, such as those used by NONMEM, Monolix [@monolix], and more. +Currently, `pharmsol` provides methods to parse the Pmetrics [@pmetrics] data format. In the future, we aim to also support additional formats, such as those used by NONMEM, Monolix [@monolix], and more. Data may also be built using a provided builder-pattern, providing a flexible method for defining subjects on the go for pharmacometricians comfortable with Rust. This is especially useful when integrating `pharmsol` with third-party software, as it allows for reading and generating data that is not in a supported format. # Supported equation formats -The equation module provides the mathematical foundation for simulating PK/PD output with three model equation solver types: analytical solutions, ordinary differential equations, and experimental support for stochastic differential equations. +As stated before the `Equation` trait provides the architectural backbone for simulating PK/PD profiles. Pharmsol currently also provides three solvers implementing this trait: analytical solutions, ordinary differential equations, and experimental support for stochastic differential equations. ## Analytical Solutions -For standard compartmental models, `pharmsol` provides closed-form solutions for one- and two-compartment models, with and without oral absorption. These have been verified against their differential equation counterparts. Benchmarks demonstrate 20-33× speedups compared to equivalent ODE formulations without loss of precision (see repository benchmarks for details). Additional analytical solutions will be added in future versions. +For standard compartmental models, `pharmsol` provides closed-form solutions for one-, two- and three-compartment models, with and without oral absorption. These have been verified against their differential equation counterparts. Benchmarks demonstrate 20-33× speedups compared to equivalent ODE formulations without loss of precision (see repository benchmarks for details). Additional analytical solutions will be added in future versions. ## Ordinary Differential Equations @@ -69,6 +85,10 @@ Experimental support for stochastic differential equations (SDEs) is available u `pharmsol` aims to support the evolving needs of pharmacometric research by providing a modern, efficient platform that can adapt to the increasing complexity of pharmaceutical development while remaining accessible through its open-source licensing model. Future development will focus on additional analytical model implementations, support for common data formats used by other pharmacometric software, non-compartmental analysis and continued performance improvements. +# AI usage disclosure + +The authors declare that generative AI has been used during software development and manuscript preparation. For software development, generative AI has been used to generate code by instruction, refactor existing code, produce tests and write documentation. For the manuscript, generative AI was used to improve the language of the submission. The use of generative AI was reviewed, edited, and verified by the authors. The authors take full responsibility for the contents of the submission, and for the software within the scopes of the software license. + # Acknowledgements We acknowledge the intellectual contributions to the package by members of the Laboratory of Applied Pharmacokinetics and Bioinformatics (LAPKB), and feedback from the pharmacokinetics research group at the University of Oslo. From 1f2d6953ddfb717171ffdc61c43f1cf3460a2b89 Mon Sep 17 00:00:00 2001 From: Markus Hovd Date: Fri, 30 Jan 2026 14:06:09 +0100 Subject: [PATCH 2/3] paper: State of the field (#203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * paper: Draft state of the field --------- Co-authored-by: Julián D. Otálvaro --- joss/paper.bib | 19 +++++++++++++++++++ joss/paper.md | 28 +++++++++++++++++----------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/joss/paper.bib b/joss/paper.bib index 6000bd3d..ca66253c 100644 --- a/joss/paper.bib +++ b/joss/paper.bib @@ -96,4 +96,23 @@ @Book{npod url = {https://doi.org/10.1007/978-3-031-87804-6_12}, } +@Manual{mrgsolve, + title = {mrgsolve: Simulate from ODE-Based Models}, + author = {Kyle T Baron}, + year = {2025}, + note = {R package version 1.6.1}, + url = {https://mrgsolve.org/docs/}, +} + +@Article{rackauckas2020pumas, + author = {Rackauckas, Chris and Ma, Yingbo and Noack, Andreas and Dixit, Vaibhav and Mogensen, Patrick Kofod and Byrne, Simon and Maddhashiya, Shubham and Santiago-Calder\'on, Jos\'e Bayo\'an and Nyberg, Joakim and Gobburu, Jogarao V. S. and others}, + title = {Accelerated predictive healthcare analytics with {Pumas}, a high performance pharmaceutical modeling and simulation platform}, + journal = {bioRxiv}, + year = {2020}, + doi = {10.1101/2020.11.28.402297}, + url = {https://www.biorxiv.org/content/10.1101/2020.11.28.402297v1}, +} + + + @Comment{jabref-meta: databaseType:bibtex;} diff --git a/joss/paper.md b/joss/paper.md index 9eac5cfc..a04802a3 100644 --- a/joss/paper.md +++ b/joss/paper.md @@ -1,5 +1,5 @@ --- -title: "pharmsol: A high-performance Rust library for pharmacokinetic/pharmacodynamic modeling and simulation" +title: "pharmsol: A high-performance Rust library for pharmacokinetic and pharmacodynamic modeling and simulation" tags: - Rust - pharmacokinetics @@ -33,27 +33,33 @@ bibliography: paper.bib `pharmsol` is a library for pharmacokinetic/pharmacodynamic (PK/PD) simulation written in Rust. It provides the necessary tools and frameworks for defining, solving, and analyzing compartmental models, with support for differential equations, their analytical solutions, and experimental support for stochastic differential equations. Written in Rust, the library aims to provide researchers and developers with a framework for pharmacokinetic simulation in a memory-safe and performant language. The library is distributed via crates.io with comprehensive API documentation, usage examples, and a test suite validated through continuous integration. -# Statement of Need +# Statement of need Pharmacokinetic and pharmacodynamic modeling and simulation are computationally intense when applied to modern, complex, and sophisticated dosing regimens, mechanistic models, and individualized approaches. Unlike comprehensive pharmacometric platforms such as NONMEM [@nonmem], Phoenix NLME [@phoenix], or Monolix [@monolix], `pharmsol` is purpose-built as a simulation engine that pharmacometricians can leverage to rapidly execute simulations for individuals or populations with pre- and user-defined models. As a fully open-source solution, `pharmsol` empowers users to inspect, modify, and extend the simulation capabilities without licensing constraints. Users can define custom models by specifying their own differential equations as closures, or use the provided analytical solutions for standard compartmental models. Additionally, `pharmsol` can be integrated in more user-friendly languages such as R using `extendr` [@extendr], making it accessible to pharmacometricians who may prefer higher-level interfaces. +# State of the field + +Several tools exist for performing pharmacokinetic and pharmacodynamic modelling and simulation. Most well known are the full-suite applications such as NONMEM [@nonmem], Phoenix NLME [@phoenix], Monolix [@monolix], and Pumas [@rackauckas2020pumas]. These are generally commercial or proprietary, while open-source alternatives include the R packages `Pmetrics` [@pmetrics] and `mrgsolve` [@mrgsolve], as well as implementations in Python and Julia. The latter two are powered by Fortran and C++, respectively. + +The choice to develop `pharmsol` as a new library rather than contribute to the existing solutions is motivated by several factors. First, Rust provides compile-time memory safety guarantees which are not available in Fortran or C++, without sacrificing performance. This is especially important for software used in healthcare settings. Second, existing alternatives are coupled to their parent frameworks, and may be difficult to integrate with new solutions or software. + +The aim of `pharmsol` is to provide developers of higher-level software with a library for performing efficient and memory-safe pharmacokinetic modeling and simulation. Importantly, `pharmsol` is open-source with a permissive license, allowing developers to inspect, extend, and integrate the library into new or existing solutions. + # Software design To the authors' knowledge, `pharmsol` is the first software written in Rust for pharmacokinetic modeling and simulation. The design principle of `pharmsol` is to provide researchers and pharmacometricians a flexible and efficient library for solving pharmacokinetic problems. -These problems are defined by two key aspects: the pharmacokinetic data, and the structural model. While the data structure is explained in detail below, the structural model is more complex. In `pharmsol`, models are defined using a set of closures, providing methods to define the set of equations that describe the mass transfer of drug, as well as initial conditions and output equations, i.e. detailing the initial and observed states of the system. Bioavailability terms and lag-time of absorption is also supported. Covariates may be applied on both parameters and state values. Importantly, `pharmsol` provides both linear interpolation and carry-forward for covariates, both common in population pharmacokinetic models. +These problems are defined by two key aspects: the pharmacokinetic data, and the structural model. While the data structure is explained in detail below, the structural model is more complex. In `pharmsol`, models are defined using a set of closures, providing methods to define the set of equations that describe the mass transfer of drug, as well as initial conditions and output equations, i.e. detailing the initial and observed states of the system. Bioavailability terms and lag-time of absorption are also supported. Covariates may be applied on both parameters and state values. Importantly, `pharmsol` provides both linear interpolation and carry-forward for covariates, both common in population pharmacokinetic models. -The three different solver types, i.e. analytical, ODE, and SDE based, are all built around a common `Equation` trait. This gives `Pharmsol` a modular design, allowing users to easily extend the library with new solvers or to rely on it while being agnostic on the underlying solver type. This flexibility is particularly useful when integrating `pharmsol` with other software, as it allows users to select the most appropriate solver for their specific use case (e.g., speed vs. model complexity). +The three different solver types, i.e. analytical, ODE, and SDE based, are all built around a common `Equation` trait. This gives `pharmsol` a modular design, allowing users to easily extend the library with new solvers or to rely on it while being agnostic on the underlying solver type. This flexibility is particularly useful when integrating `pharmsol` with other software, as it allows users to select the most appropriate solver for their specific use case (e.g., speed vs. model complexity). # Research impact statement -As a tool for pharmacokinetic modelling and simulation, `pharmsol` has already demonstrated research impact. Most notably, it is used as a simulation engine for the Rust crate `PMcore` and `Pmetrics` [@pmetrics] - the _de facto_ R package for non-parametric population pharmacokinetic modelling and simulation. - -Additionally, `pharmsol` has been used to generate results in scientific publications, such as the creation of a new algorithm for non-parametric parameter estimation [@npod]. +As a tool for pharmacokinetic modelling and simulation, `pharmsol` has already demonstrated research impact. Most importantly, it is used as the simulation engine for `PMcore`, the Rust implementation of `Pmetrics` [@pmetrics] - the _de facto_ R package for non-parametric population pharmacokinetic modelling and simulation. In this regard, `pharmsol` has been used to generate results in scientific publications, such as the creation of a new algorithm for non-parametric parameter estimation [@npod]. -Internally, `pharmsol` is also used for simulating alternative dose regimens to individualize drug therapy in patients. +By utilizing the SDE solver in `pharmsol`, our research group is currently researching the use of SDEs in a non-parametric pharmacokinetic framework. We have also developed internal applications which rely on `pharmsol` for simulating alternative dose regimens to individualize drug therapy. # Data format @@ -63,11 +69,11 @@ Internally, `pharmsol` is also used for simulating alternative dose regimens to Data → Subject → Occasion → Event (Bolus, Infusion, Observation) ``` -Currently, `pharmsol` provides methods to parse the Pmetrics [@pmetrics] data format. In the future, we aim to also support additional formats, such as those used by NONMEM, Monolix [@monolix], and more. Data may also be built using a provided builder-pattern, providing a flexible method for defining subjects on the go for pharmacometricians comfortable with Rust. This is especially useful when integrating `pharmsol` with third-party software, as it allows for reading and generating data that is not in a supported format. +Currently, `pharmsol` provides methods to parse the Pmetrics [@pmetrics] data format. In the future, we aim to also support additional formats, such as those used by NONMEM, Monolix [@monolix], and more. Data may also be built using a provided builder-pattern, providing a flexible method for defining subjects programmatically. This is especially useful when integrating `pharmsol` with third-party software, as it allows for reading and generating data that is not in an already supported format. # Supported equation formats -As stated before the `Equation` trait provides the architectural backbone for simulating PK/PD profiles. Pharmsol currently also provides three solvers implementing this trait: analytical solutions, ordinary differential equations, and experimental support for stochastic differential equations. +As stated before, the `Equation` trait provides the architectural backbone for simulating PK/PD profiles. Pharmsol currently also provides three solvers implementing this trait: analytical solutions, ordinary differential equations, and experimental support for stochastic differential equations. ## Analytical Solutions @@ -87,7 +93,7 @@ Experimental support for stochastic differential equations (SDEs) is available u # AI usage disclosure -The authors declare that generative AI has been used during software development and manuscript preparation. For software development, generative AI has been used to generate code by instruction, refactor existing code, produce tests and write documentation. For the manuscript, generative AI was used to improve the language of the submission. The use of generative AI was reviewed, edited, and verified by the authors. The authors take full responsibility for the contents of the submission, and for the software within the scopes of the software license. +The authors declare that generative AI has been used during software development and manuscript preparation. For software development, generative AI has been used to generate code by instruction, refactor existing code, produce tests and write documentation. For the manuscript, generative AI was used to improve the language of the submission. All use of generative AI was reviewed, edited, and verified by the authors. The authors take full responsibility for the contents of the submission, and for the software within the scopes of the software license. # Acknowledgements From 6d8c8e06885281eb2dfcd815861270ab30b6b728 Mon Sep 17 00:00:00 2001 From: Markus Hovd Date: Tue, 3 Mar 2026 14:40:08 +0100 Subject: [PATCH 3/3] paper: Update reference for diffsol (#216) * paper: Update reference for diffsol Congratulations to Martin and Alex! * Formatting --- joss/paper.bib | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/joss/paper.bib b/joss/paper.bib index ca66253c..c74b4942 100644 --- a/joss/paper.bib +++ b/joss/paper.bib @@ -35,13 +35,17 @@ @Article{extendr url = {https://joss.theoj.org/papers/10.21105/joss.06394}, } -@Misc{diffsol, - author = {Robinson, Martin}, - title = {diffsol: A Rust library for solving ordinary differential equations}, - year = {2024}, - publisher = {GitHub}, - url = {https://github.com/martinjrobins/diffsol}, -} +@article{diffsol, + doi = {10.21105/joss.09384}, + url = {https://doi.org/10.21105/joss.09384}, + year = {2026}, + publisher = {The Open Journal}, + volume = {11}, + number = {117}, + pages = {9384}, + author = {Robinson, Martin and Allmont, Alex}, + title = {diffsol: Rust crate for solving differential equations}, + journal = {Journal of Open Source Software} } @Article{nonmem, author = {Beal, Stuart L. and Sheiner, Lewis B.},