Skip to main content
PLOS Computational Biology logoLink to PLOS Computational Biology
. 2022 Mar 7;18(3):e1009223. doi: 10.1371/journal.pcbi.1009223

Bayesian calibration, process modeling and uncertainty quantification in biotechnology

Laura Marie Helleckes 1,2,#, Michael Osthege 1,2,#, Wolfgang Wiechert 1,3, Eric von Lieres 1, Marco Oldiges 1,2,*
Editor: Dina Schneidman-Duhovny4
PMCID: PMC8939798  PMID: 35255090

Abstract

High-throughput experimentation has revolutionized data-driven experimental sciences and opened the door to the application of machine learning techniques. Nevertheless, the quality of any data analysis strongly depends on the quality of the data and specifically the degree to which random effects in the experimental data-generating process are quantified and accounted for. Accordingly calibration, i.e. the quantitative association between observed quantities and measurement responses, is a core element of many workflows in experimental sciences.

Particularly in life sciences, univariate calibration, often involving non-linear saturation effects, must be performed to extract quantitative information from measured data. At the same time, the estimation of uncertainty is inseparably connected to quantitative experimentation. Adequate calibration models that describe not only the input/output relationship in a measurement system but also its inherent measurement noise are required. Due to its mathematical nature, statistically robust calibration modeling remains a challenge for many practitioners, at the same time being extremely beneficial for machine learning applications.

In this work, we present a bottom-up conceptual and computational approach that solves many problems of understanding and implementing non-linear, empirical calibration modeling for quantification of analytes and process modeling. The methodology is first applied to the optical measurement of biomass concentrations in a high-throughput cultivation system, then to the quantification of glucose by an automated enzymatic assay. We implemented the conceptual framework in two Python packages, calibr8 and murefi, with which we demonstrate how to make uncertainty quantification for various calibration tasks more accessible. Our software packages enable more reproducible and automatable data analysis routines compared to commonly observed workflows in life sciences.

Subsequently, we combine the previously established calibration models with a hierarchical Monod-like ordinary differential equation model of microbial growth to describe multiple replicates of Corynebacterium glutamicum batch cultures. Key process model parameters are learned by both maximum likelihood estimation and Bayesian inference, highlighting the flexibility of the statistical and computational framework.

Author summary

In experimental fields like biotechnology, scientists need to quantify process parameters such as concentrations and state the uncertainty around them. However, measurements rarely yield the desired quantity directly; for example, the measurement of scattered light is just an indirect measure for the number of cells in a suspension. For reliable interpretation, scientists must determine the uncertainty around the underlying quantities of interest using statistical methods.

A key step in these workflows is the establishment of calibration models to describe the relation between the quantities of interest and measurement outcomes. This is typically done using measurements of reference samples for which the true quantities are known. However, implementing and applying these statistical models often requires skills that are not commonly taught.

We therefore developed two software packages, calibr8 and murefi, to simplify such calibration and modeling procedures. To showcase our work, we performed an experiment commonly seen in microbiology: the acquisition of a microbial growth curve, in this case of Corynebacterium glutamicum, in an online measurement device. Using our software, we built a mathematical model of the overall process to quantify relevant parameters with uncertainty, e.g. the growth rate or the yield of biomass per amount of glucose.


This is a PLOS Computational Biology Software paper.

1 Introduction

1.1 Calibration in life sciences

Calibration modeling is an omnipresent task in experimental science. Particularly the life sciences make heavy use of calibration modeling to achieve quantitative insights from experimental data. The importance of calibration models (also known as calibration curves) in bioanalytics is underlined in dedicated guidance documents by EMA and FDA [1, 2] that also make recommendations for many related aspects such as method development and validation. While liquid chromatography and mass spectrometry are typically calibrated with linear models [3], a four- or five-parameter logistic model is often used for immuno- or ligand-binding assays [2, 46]. The aforementioned guidance documents focus on health-related applications, but there are countless examples where (non-linear) calibration needs to be applied across biological disciplines. From dose-response curves in toxicology to absorbance or fluorescence measurements, or the calibration of online measurement systems, experimentalists are confronted with the task of calibration.

At the same time, recent advances in affordable liquid-handling robotics facilitate lab scientists in chemistry and biotechnology to (partially) automate their specialized assays (e.g. [7, 8]). Moreover, advanced robotic platforms for parallelized experimentation, monitoring and analytics [8, 9] motivate online data analysis and calibration for process control of running experiments.

1.2 Generalized computational methods for calibration

Experimental challenges in calibration are often unique to a particular field and require domain knowledge to be solved. At the same time, the statistical or computational aspects of the workflow can be generalized across domains. With the increased amount of available data in high-throughput experimentation comes the need for equally rapid data analysis and calibration. As a consequence, it is highly desirable to develop an automatable, technology-agnostic and easy-to-use framework for quantitative data analysis with calibration models.

From our perspective of working at the intersection between laboratory automation and modeling, we identified a set of requirements for calibration: Data analyses rely more and more on scripting languages such as Python or R, making the use of spreadsheet programs an inconvenient bottleneck. At various levels, and in particular when non-linear calibration models are involved, the statistically sound handling of uncertainty is at the core of a quantitative data analysis.

Before going into detail about the calibration workflow, we would like to highlight its most important aspects and terminology based on the definition of calibration by the International Bureau of Weights and Measures (BIPM) [10]:

2.39 calibration: “Operation that, under specified conditions, in a first step, establishes a relation between the quantity values with measurement uncertainties provided by measurement standards and corresponding indications with associated measurement uncertainties and, in a second step, uses this information to establish a relation for obtaining a measurement result from an indication.”

2.9 measurement result: “[…] A measurement result is generally expressed as a single measured quantity value and a measurement uncertainty.”

The “first step” from the BIPM definition is the establishment of a relation that we will call calibration model henceforth. In statistical terminology, the relationship is established between an independent variable (BIPM: quantity values) and a dependent variable (BIPM: indications) and it is important to note that the description of measurement uncertainty is a central aspect of a calibration model. In the application (“second step”) of the calibration model, the quantification of uncertainty is a core aspect as well.

Uncertainty arises from the fact that measurements are not exact, but subject to some form of random effects. While many methods such as linear regression assume that these random effects are distributed according to a Normal distribution, we want to stress that a generalized framework for calibration should not make such constraints. Instead, domain experts should be enabled to choose a probability distribution that is best suited to describe their measurement system at hand.

Going beyond the BIPM definition, we see the application of calibration models two-fold:

  • Inference of individual independent quantity values from one or more observations.

  • Inferring the parameters of a more comprehensive process model from measurement responses obtained from (samples of) the system.

For both applications, uncertainties should be a standard outcome of the analysis. In life sciences, the commonly used estimate of uncertainty is the confidence interval. The interpretation of confidence intervals however is challenging, as it is often oversimplified and confused with other probability measures [11, 12]. Furthermore, their correct implementation for non-linear calibration models, and particularly in combination with complex process models, is technically demanding. For this reason, we use Bayesian credible intervals that are interpreted as the range in which an unobserved parameter lies with a certain probability [13]. In Section 2.3 we go into more details about the uncertainty measures and how they are obtained and interpreted.

Even though high-level conventions and recommendations exist, the task of calibration is approached with different statistical methodology across the experimental sciences. In laboratory automation, we see a lack of tools enabling practitioners to build tailored calibration models while maintaining a generalized approach. At the same time, generalized calibration models have the potential to improve adequacy of complex simulations in the related fields.

While numerous software packages for modeling biological systems are available, most are targeted towards complex biological networks and do not consider calibration modeling or application to large hierarchical datasets. Notable examples are Data2Dynamics [14] or PESTO [15], both allowing to customize calibration models and the way the measurement error is described. However, both tools are implemented in MATLAB and are thus incompatible with data analysis workflows that leverage the rich ecosystem of scientific Python libraries. Here, Python packages such as PyCoTools3 [16] for the popular COPASI software [17] provide valuable functionality, but are limited with respect to custom calibration models, especially in a Bayesian modeling context. To the best of our knowledge, none of these frameworks provide customizable calibration models that can be used outside of the process modeling context and are at the same time compatible with Bayesian modeling as well as modular combination with other libraries.

1.3 Aim of this study

This study aims to build an understanding of how calibration models can be constructed to describe both location and spread of measurement outcomes such that uncertainty can be quantified. In two parts, we demonstrate a toolbox for calibration models, calibr8, on the basis of application examples, thus showing how it directly addresses questions typical for quantitative data analysis.

In part one (Section 4.1) we demonstrate how to construct such calibration models based on a reparametrized asymmetric logistic function applied to a photometric assay. We give recommendations for obtaining calibration data and introduce accompanying open-source Python software that implements object-oriented calibration models with a variety of convenience functions.

In part two (Section 4.2) we show how calibration models can become part of elaborate process models to accurately describe measurement uncertainty caused by experimental limitations. We introduce a generic framework, murefi, for refining a template process model into a hierarchical model that flexibly shares parameters across experimental replicates and connects the model prediction with observed data via the previously introduced calibration models. This generic framework is applied to build an ordinary differential equation (ODE) process model for 28 microbial growth curves gained in automated, high-throughput experiments. Finally, we demonstrate how the calibration model can be applied to perform maximum likelihood estimation (MLE) or Bayesian inference of process model parameters while accounting for non-linearities in the experimental observation process.

Although this paper chooses biotechnological applications, the presented approach is generic and our Python implementations are applicable to a wide range of research fields. Our documentation includes examples from broader life-science applications such as cell-counting and enzyme catalysis, which can be transferred to statistically similar problems in, for example, environmental research or chemistry.

2 Theoretical background

2.1 Probability theory for calibration modeling

Probability distributions are at the heart of virtually all statistical and modeling methods. They describe the range of values that a variable of unknown value, also called random variable, may take, together with how likely these values are. This work focuses on univariate calibration tasks, where a continuous variable is obtained as the result of the measurement procedure. Univariate, continuous probability distributions such as the Normal or Student-t distribution are therefore relevant in this context. Probability distributions are described by a set of parameters, such as {μ, σ} in the case of a Normal distribution, or {μ, scale, ν} in the case of a Student-t distribution.

To write that a random variable “rv” follows a certain distribution, the ∼ symbol is used: rv ∼ Student- t(μ, scale, ν). The most commonly found visual representation of a continuous probability distribution is in terms of its probability density function (PDF, S1 Fig), typically written as p(rv).

The term rv conditioned on d is used to refer to the conditional probability of a random variable rv given that certain data d was observed. It is written as p(rv ∣ d).

A related term, the likelihood L, takes the inverse perspective on how likely it is to make observations d given a fixed value of the random variable. Both p(d ∣ rv) and L(rvd) are common notations for the likelihood. Note that the likelihood is not a PDF of the random variable [18]. We use the notation of L throughout this paper for better visibility of likelihoods.

In situations where only limited data is available, a Bayesian statistician argues that prior information should be taken into account. The likelihood can then be combined with prior beliefs into the posterior probability according to Bayes’ rule (Eq 1).

pposterior(rvd)=pprior(rv)·L(rvd)pprior(rv)·L(rvd)drv (1)

According to Eq 1, the posterior probability p(rv∣d) of the random variable rv given the data is equal to the product of prior probability times likelihood, divided by its integral.

When only considering the observed data, the probability of the random variable conditioned on data p(rv ∣ d), can be obtained by normalizing the likelihood by its integral (Eq 2).

plikelihood(rvd)=L(rvd)L(rvd)drv (2)

From the Bayesian perspective, Eq 2 can be understood as a special case of Bayes’ rule (Eq 1) with flat (uninformative) prior information. This connection between a likelihoodist and a Bayesian perspective on independent variable probabilities is illustrated in Fig 1. In Fig 1A, the red probability density function was obtained only from the likelihood of observations (black arrows), corresponding to Eq 2 or the Bayesian perspective with a flat prior (blue). Assuming that the independent variable is a priori known to be ≥ 1, one might choose a corresponding prior (Fig 1B, blue). The posterior (orange) then compromises prior and likelihood according to Eq 1, resulting in a posterior probability of 0 that the variable is below 1. For a thorough introduction on Bayesian methods, we refer the interested reader to [19].

Fig 1. Comparison of likelihoodist and Bayesian probability densities.

Fig 1

Using a N noise model, the likelihood function normalized by its integral gives a likelihoodist probability density function (red) for the independent variable. In A the resulting probability that the variable of interest lies below 1 is clearly positive. In a hypothetical scenario where the variable of interest is known to be ≥ 1, a shifted exponential prior could be assigned (B). The posterior probability (orange) is then obtained via Bayes’ rule (Eq 1) and gives the desired 0 probability of the variable being less than 1. A may be viewed as a special case of the Bayesian perspective with a flat prior (blue). Observations and distribution parameters were chosen to obtain a good layout: σ=1.2,1λ=1.1, d = [2.0, 2.3, 2.4].

2.2 Parameter estimation

A mathematical model ϕ is a function that describes the state of system variables by means of a set of parameters. The model is a representation of the underlying data generating process, meaning that the model output from a given set of parameters is imitating the expected output in the real system. From a given list of parameters θ, a model can make predictions of the system variables, in the following denominated as ypred. In machine learning, this quantity is often called y^.

ypred=ϕ(θ) (3)

A predictive model can be obtained when the parameters are estimated from observed experimental data yobs. In this process, the experimental data is compared to data predicted by the model. In order to find the prediction matching the data best, different approaches of parameter estimation can be applied. This process is sometimes also referred to as inference or informally as fitting.

To obtain one parameter vector, optimization of so-called loss functions or objective functions can be applied. In principle, these functions compare prediction and measurement outcome, yielding a scalar that can be minimized. Various loss functions such as the mean absolute error (MAE or L1 loss) or the mean squared error (MSE or L2 loss) can be formulated for the optimization process.

In the following, we first consider a special case, least squares estimation using the MSE, before coming to the generalized approach of maximum likelihood estimation. The former, which is often applied in biotechnology in the context of linear regression, is specified in the following equation:

L=(yobsypred)2 (4)

Here, the vectors yobs and ypred represent one observed time series and the corresponding prediction. If several time series contribute to the optimization, their differences (residuals) can be summed up:

L=n=0N(yobs,nypred,n)2 (5)

To keep the notation simple, we will in the following use Yobs and Ypred to refer to the set of N time series vectors. While each individual pair of ypred,n and yobs,n vectors must have the same length, note that different pairs might be of different length. Y should thus not be interpreted as a matrix notation. In later chapters, we will see how the Python implementation handles the sets of observations (Section 3.2.4).

Coming back to the likelihood functions introduced in Section 2.1, the residual-based loss functions are a special case of a broader estimation concept, the maximum likelihood estimation:

θMLE=argmaxθL(θYobs) (6)

Here, a probability density function is used to quantify how well observation and prediction, the latter represented by the model parameters, match. In case of a Normal-distributed likelihood with constant noise, the result of MLE is the same as a weighted least-squares loss [20]. In comparison to residual-based approaches, the choice of the PDF in a likelihood approach leads to more flexibility, for example covering heteroscedasticity or measurement noise that cannot be described by a Normal distribution.

As introduced in Section 2.1, an important extension of the likelihood approach is Bayes’ theorem (Eq 1). Applying this concept, we can perform Bayesian inference of model parameters:

p(θYobs)=p(θ)·L(θYobs)p(θ)·L(θYobs)dθ (7)
θMAP=argmaxθp(θYobs) (8)

Similar to MLE, a point estimate of the parameter vector with highest probability can be obtained by optimization (Eq 8), resulting in the maximum a posteriori (MAP) estimate. While the MLE is focused on the data-based likelihood, MAP estimates incorporate prior knowledge p(θ) into the parameter estimation.

To obtain the full posterior distribution p(θYobs), which is describing the probability distribution of parameters given the observed data, one has to solve Eq 7. The integral, however, is often intractable or impossible to solve analytically. Therefore, a class of algorithms called Markov chain Monte Carlo (MCMC) algorithms is often applied to find numerical approximations for the posterior distribution (for more detail, see Section 3.2.6).

The possibility to not only obtain point estimates but a whole distribution describing the parameter vector, is leading to an important concept: uncertainty quantification.

2.3 Uncertainty quantification of model parameters

When aiming for predictive models, it is important to not only estimate one parameter vector, but to quantify how certain the estimation is. In the frequentist paradigm, uncertainty is quantified with confidence intervals. When applied correctly, they provide a useful measure, for example in hypothesis testing where the size of a certain effect in a study is to be determined. However, interpretation of the confidence interval can be challenging and it is frequently misinterpreted as the interval that has a 95% chance to contain the true effect size or true mean [11]. However, to obtain intervals with such a simple interpretation, further assumptions on model parameters are required [12].

In Bayesian inference, prior distribution provide these necessary assumptions and the posterior can be used for uncertainty quantification. As a consequence, Bayesian credible intervals can indeed be interpreted as the range in which an unobserved parameter lies with a certain probability [13]. The choice of probability level or interval bounds is arbitrary. Commonly chosen probability levels are 99, 95, 94 or 90%. Consequently, there are many equally valid flavors of credible intervals. The most important ones are listed below:

  • Highest posterior density intervals (HDI) are chosen such that the width of the interval is minimized

  • Equal-tailed intervals (ETI) are chosen such that the probability mass of the posterior below and above the interval are equal

  • Half-open credible intervals specify the probability that the parameter lies on one side of a threshold

In the scope of this paper, we will solely focus on the Bayesian quantification of parameter uncertainty. Note that uncertainty of parameters should not be confused with the measurement uncertainty mentioned in the context of calibration in Section 1.2, which will be further explained in the following section.

2.4 Calibration models

Coming back to the BIPM definition of calibration (Section 1.1), we can now associate aspects of that definition with the statistical modeling terminology. In Fig 2, the blue axis “independent” variable corresponds to the “quantity values” from the BIPM definition. At every value of the independent variable, the calibration model (green) describes the probability distribution (green slices) of measurement responses. This corresponds to the “indications with associated measurement uncertainties” from the BIPM definition.

Fig 2. Relationship of independent and dependent variable.

Fig 2

The distribution of measurement responses (dependent variable) can be modeled as a function of the independent variable. This measurement response probability distribution (here: Student-t) is parametrized by its parameters the mean μ (solid green line) and spread parameters σ and ν. Some or all of the distributions parameters are modeled as a function of the independent variable.

Neither the formal definition nor the conceptual framework presented in this study impose constraints on the kind of probability distribution that describes the measurement responses. Apart from the Normal distribution, a practitioner may choose a Student-t distribution if outliers are a concern. The Student-t distribution has a v parameter that influences how much probability is attributed to the tails of the distribution (S1 Fig), or in other words how likely it is to observe extreme values. Other distributions such as Laplace or Huber distributions were also shown to be beneficial for outlier-corrupted data [21]. Depending on the measurement system at hand, a Lognormal, Gamma, Weibull, Uniform or other continuous distributions may be appropriate. Also discrete distributions such as the Poisson, Binomial or Categorical may be chosen to adequately represent the observation process. A corresponding example with a Poisson distribution for the dependent variable is included in the documentation [22].

For some distributions, including Normal and Student-t, the parameters may be categorized as location parameters affecting the median or spread parameters affecting the variance, while for many other distributions the commonly used parameterization is not as independent. The parameters of the probability distribution that models the measurement responses must be described as functions of the independent variable. In the example from Fig 2 relationship, a Student-t distribution with parameters {μ, scale, ν} is used. Its parameter μ is modeled with a logistic function, the scale parameter as a 1st order polynomial of μ and ν is kept constant. It should be emphasized that the choice of probability distribution and functions to model its parameters is completely up to the domain expert.

When coming up with the structure of a calibration model, domain knowledge about the measurement system should be considered, particularly for the choice of probability distribution. An exploratory scatter plot can help to select an adequate function for the location parameter of the distribution (μ in case of a Normal or Student-t). A popular choice for measurement systems that exhibit saturation kinetics is the (asymmetric) logistic function. Many other measurement systems can be operated in a “linear range”, hence a 1st order polynomial is an equally popular model for the location parameter of a distribution. To describe the spread parameters (σ, scale, ν, …), a 0th (constant) or 1st order (linear) polynomial function of the location parameter is often a reasonable choice.

After specifying the functions in the calibration model, the practitioner must fit the model (Section 2.2) and decide to stick with the result, or modify the functions in the model. This iteration between model specification and inspection is a central aspect of modeling. To avoid overfitting or lack of interpretability, we recommend to find the simplest model that is in line with domain knowledge about the measurement system, while minimizing the lack-of-fit.

The term lack-of-fit is used to describe systematic deviation between the model fit and data. It refers not only to the trend of location and spread parameters but also to the kind of probability distribution. A residual plot is often instrumental to diagnose lack-of-fit and discriminate it from purely random noise in the observations. In Fig 3, different calibration models (top), residuals (middle) and the spread of data points along the percentiles of the probability distribution (bottom) illustrate how to diagnose a lack-of-fit. The blue data points in Fig 3C are Lognormal-distributed, but the calibration model assumes a Student-t distribution. In such cases, a large number of observations may be needed to spot that the chosen noise model does match the data. As an alternative to a percentile-based visualization, practitioners may therefore opt to perform a Kolmogorov-Smirnov test, or visualize based on (empirical) cumulative density functions (ECDF). Ideally such a visualization should be prepared with ECDF confidence bands [23] and we invite the interested reader to contribute an implementation of this method to calibr8. A well-chosen model (Fig 3D) is characterized by the random spread of residuals without systematic deviation and the equivalence of the modeled and observed distribution. When enough calibration data points are available, the modeled and observed distributions can be compared via the occupancy of percentiles.

Fig 3. Diagnostic plots of model fits.

Fig 3

The raw data (blue dots) and corresponding fit is visualized in the top row alongside 95, 90, and 68% likelihood bands of the model. Linear and logistic models were fitted to synthetic data to show three kinds of lack-of-fit error (columns 1–3) in comparison to a perfect fit (column 4). The underlying structure of the data and model is as follows: A: Homoscedastic linear model, fitted to homoscedastic nonlinear data. B: Homoscedastic linear model, fitted to heteroscedastic linear data. C: Homoscedastic linear model, fitted to homoscedastic linear data that is Lognormal-distributed. D: Heteroscedastic logistic model, fitted to heteroscedastic logistic data. The residual plots in the middle row show the distance between the data and the modeled location parameter (green line). The bottom row shows how many data points fall into the percentiles of the predicted probability distribution. Whereas the lack-of-fit cases exhibit systematic under- and over-occupancy of percentiles, only in the perfect fit case all percentiles are approximately equally occupied.

Whereas the BIPM definition uses the word uncertainty in multiple contexts, we prefer to always use the term to describe uncertainty in a parameter, but never to refer to measurement noise. In other words, the parameter uncertainty can often be reduced by acquiring more data, whereas measurement noise is inherent and constant. In the context of calibration models, the methods for uncertainty quantification (Section 2.3) may be applied to the calibration model parameters, the independent variable, or both. Uncertainty quantification of calibration model parameters can be useful when investigating the structure of the calibration model itself, or when optimization does not yield a reliable fit. Because the independent variable is in most cases the parameter of interest in the application of a calibration model, the quantification of uncertainty about the independent variable is typically the goal. To keep the examples easy and understandable, we fix calibration model parameters at their maximum likelihood estimate. The calibr8 documentation includes an example where the calibration model parameters are estimated jointly together with the process model [22].

In Fig 4 uncertainty, the green likelihood bands on the ground of the 3D plot represent a calibration model with fixed parameters. To quantify the independent variable with associated Bayesian uncertainty, it must be considered as a random variable. Accordingly, p(rvindependent ∣ d) from either a likelihoodist (Eq 2) or Bayesian (Eq 1) perspective is the desired outcome of the uncertainty quantification.

Fig 4. Uncertainty about the independent variable.

Fig 4

An intuition for inferring the independent variable from an observed dependent variable is to cut (condition) the green probability distribution model at the observed value (blue slices) and normalize its area to 1. The resulting (blue) slice is a potentially asymmetric probability distribution that describes the likelihood of the observation, given the independent variable. Its maximum (the maximum likelihood estimate) is the value of the independent variable that best describes the observation. For multiple observations, the probability density function for the independent variable corresponds to the product of the PDFs of the observations. The red shoulders mark the regions outside of the 90% equal-tailed interval.

Given a single observed dependent variable, the likelihoodist p(rvindependentd) (Eq 2) corresponds to the normalized cross section of the likelihood bands at the observed dependent variable (Fig 4, blue slices). With multiple observations, p(rvindependent ∣ d) becomes the product (superposition) of the elementwise likelihoods (Fig 4, blue slice at the axis). For a Bayesian interpretation of p(rvindependent ∣ d) (Eq 1), the blue likelihood slice is superimposed with an additional prior distribution. More practical details on uncertainty quantification of the independent variable in a calibration model are given in Section 4.

2.5 Process models

Most research questions are not answered by inferring a single variable from some observations. Instead, typical questions target the comparison between multiple conditions, the value of a latent (unobservable) parameter, or the inter- and extrapolation of a temporally evolving system. For example, one might extract a latent parameter that constitutes a key performance indicator, or make decisions based on predictions (extrapolation) of new scenarios. Data analysis for all of these and many more scenarios is carried out with models that are tailored to the system or process under investigation. Such models are typically derived from theoretical (textbook) understanding of the process under investigation and in terms of SI units, but are not concerned with the means of making observations. Henceforth, we use the term process model (ϕpm) to describe such models and discriminate them from calibration models (ϕcm) that are explicitly concerned with the observation procedure.

Whereas calibration models are merely univariate input/output relationships of a measurement system, process models may involve many parameters, hierarchy, multivariate predictions or more complicated functions such as ordinary or partial differential equations. For example, they may predict a temporal evolution of a system with differential equations, sharing some parameters between different conditions, while keeping others local. In life sciences, time series play a central role, hence our application example is also concerned with a temporally evolving system.

Nevertheless, calibration models ϕcm and process models ϕpm are models, and the methods for estimation of their parameters (Section 2.2) as well as uncertainty quantification (Section 2.3) apply to both. As described in Section 2.3, the likelihood L is the ultimate all-rounder tool in parameter estimation. The key behind our proposed discrimination between calibration and process models is the observation that a calibration model can serve as a modular likelihood function for a process model (Eq 9).

Y^pm=ϕpm(θpm)Y^cm=ϕcm(Y^pm,θcm)L(θpm,θcmYobs)=L(Y^cmYobs)=p(YobsY^cm) (9)

Conceptually separating between calibration models and process models has many advantages for the data analysis workflow in general. For example, the model components are logically separated, but the parameters can still be jointly estimated. After going into more detail about the implementation of calibration models and process models in Section 3, we will demonstrate their application and combination in Section 4.

3 Material and methods

3.1 Experimental workflows

3.1.1 Automated cultivation platform

All experiments were conducted on a robotic platform with an integrated small-scale cultivation system. In our setup, a BioLector Pro microbioreactor system (m2p-labs GmbH, Baesweiler, Germany), is integrated into a Tecan Freedom EVO liquid handling robot (Tecan, Männedorf, Switzerland). The BioLector Pro is a device to quasi-continuously observe biomass, pH and dissolved oxygen (DO) during cultivation of microorganisms in specialized microtiter plates (MTPs). These rectangular plates comprise multiple reaction cavities called “wells”, usually with volumes in microliter or milliliter scale. The BioLector allows to control temperature and humidity while shaking the plates at adjustable frequencies between 800 and 1500 rpm.

The liquid handler, which allows to take samples for at-line measurements during cultivation, is surrounded by a laminar flow hood to ensure sterile conditions for liquid transfer operations. Next to the BioLector Pro, various other devices are available on the platform, including an Infinite M Nano+ microplate photometer (Tecan, Männedorf, Switzerland), a cooling carrier and a Hettich Rotanta 460 robotic centrifuge (Andreas Hettich GmbH & Co. KG, Tuttlingen, Germany). The overall setup is similar to the one described by Unthan et al. 2015 [8]. The automated platform enables to perform growth experiments with different microorganisms, to autonomously take samples of the running process and to perform bioanalytical measurements, e.g. quantification of glucose. It is thus a device for miniaturised, automated bioprocess cultivation experiments.

In this work, we used specialized 48-well deepwell plates called FlowerPlates (MTP-48-B, m2p-labs GmbH, Baesweiler, Germany) that are commonly used for cultivations in the BioLector device. The plates are pre-sterilized and disposable and were covered with a gas-permeable sealing film with a pierced silicone layer for automation (m2p-labs GmbH, Baesweiler, Germany). The biomass was quasi-continuously detected via scattered light [24] at gain 3 with 4 minutes cycle time to obtain backscatter measurements. DO and pH were not measured since they are not relevant for the application examples. Both cultivation and biomass calibration experiments were conducted in the BioLector Pro at 30°C, 3 mm shaking diameter, 1400 rpm shaking frequency, 21% head-space oxygen concentration and ≥ 85% relative humidity.

3.1.2 Strain, media preparation and cell banking and cultivation

The wild-type strain Corynebacterium glutamicum ATCC 13032 [25] was used in this study. If not stated otherwise, all chemicals were purchased from Sigma–Aldrich (Steinheim, Germany), Roche (Grenzach-Wyhlen, Germany) or Carl Roth (Karlsruhe, Germany) in analytical quality.

Cultivations were performed with CGXII defined medium with the following final amounts per liter of distilled water: 20 g D-glucose, 20 g (NH4)2SO4, 1 g K2HPO4, 1 g KH2PO4, 5 g urea, 13.25 mg CaCl2 · 2 H2O, 0.25 g MgSO4 · 7 H2O, 10 mg FeSO4 · 7 H2O, 10 mg MnSO4 · H2O, 0.02 mg NiCl2 · 6 H2O, 0.313 mg CuSO4 · 5 H2O, 1 mg ZnSO4 · 7 H2O, 0.2 mg biotin, 30 mg protocatechuic acid. 42gL MOPS were used as buffering agent and the pH was adjusted to 7.0 using 4 M NaOH.

A working cell bank (WCB) was prepared from a shake flask culture containing 50 mL of the described CGXII medium and 10% (v/v) brain heart infusion (BHI) medium (37gL). It was inoculated with 100 μl cryo culture from a master cell bank stored at -80°C. The culture was incubated for approximately 16 hours in an unbaffled shake flask with 500 ml nominal volume at 250 rpm, 25 mm shaking diameter and 30°C. The culture broth was then centrifuged at 4000 × g for 10 minutes at 4°C and washed once in 0.9% (w/v) sterile NaCl solution. After centrifugation, the pellets were resuspended in a suitable volume of NaCl solution to yield a suspension with an optical density at 600 nm (OD600) of 60. The suspension was then mixed with an equal volume of 50% (w/v) sterile glycerol, resulting in cryo cultures of OD600≈30. Aliquots of 1 mL were quickly transferred to low-temperature freezer vials, frozen in liquid nitrogen and stored at -80°C.

3.1.3 Algorithmic planning of dilution series

All calibration experiments require a set of standards (reference samples) with known concentrations, spanning across sometimes multiple orders of magnitude. Traditionally such standards are prepared by manually pipetting a serial dilution with a 2x dilution factor in each step. This can result in a series of standards whose concentrations are evenly spaced on a logarithmic scale. While easily planned, a serial dilution generally introduces inaccuracies that accumulate with an increasing number of dilution steps. It is therefore desirable to plan a dilution series of reference standards such that the number of serial dilution steps is minimized.

To reduce the planning effort and allow for a swift and accurate preparation of the standards, we devised an algorithm that plans liquid handling instructions for preparation of standards. Our DilutionPlan algorithm considers constraints of a (R × C) grid geometry, well volume, minimum and maximum transfer volumes to generate pipetting instructions for human or robotic liquid handlers.

First, the algorithms reshapes a length RC vector of sorted target concentrations into the user specified (R × C) grid typically corresponding to a microtiter plate. Next, it iteratively plans the transfer and filling volumes of grid columns which are subject to the volume constraints. This column-wise procedure improves the compatibility with multi-channel manual pipettes, or robotic liquid handlers. Diluting from a stock solution is prioritized over the (serial) dilution from already diluted columns. The result of the algorithm are (machine-readable) pipetting instructions to create RC single replicates with concentrations very close to the targets. We open-sourced the implementation as part of the robotools library [26].

As the accuracy of the calibration model parameter estimate increases with the number of calibration points, we performed all calibrations with the maximum number of observations that the respective measurement system can make in parallel. The calibration with 96 glucose and 48 biomass concentrations is covered in the following chapters.

3.1.4 Glucose assay calibration

For the quantification of D-glucose, the commercial enzymatic assay kit “Glucose Hexokinase FS” (DiaSys Diagnostic Systems, Holzheim, Germany) was used. For the master mix, four parts buffer and one part enzyme solution were mixed manually. The master mix was freshly prepared for each experiment and incubated at room temperature for at least 30 minutes prior to the application for temperature stabilization. All other pipetting operations were performed with the robotic liquid handler. For the assay, 280 μL master mix were added to 20 μL analyte in transparent 96-well flat bottom polystyrol plates (Greiner Bio-One GmbH, Frickenhausen, Germany) and incubated for 6 minutes, followed by absorbance measurement at 365 nm. To treat standards and cultivation samples equally, both were diluted by a factor of 10 (100 μL sample/standard + 900 μL diluent) as part of the assay procedure.

As standards for calibration, 96 solutions with concentrations between 0.075 and 50gL were prepared from fresh CGXII cultivation medium (Section 3.1.2) with a 50gL concentration of D-glucose. The DilutionPlan algorithm (Section 3.1.3) was used to plan the serial dilution procedure with glucose-free CGXII media as the diluent, resulting in 96 unique concentrations, evenly distributed on a logarithmic scale. Absorbance results from the photometer were parsed with a custom Python package (not published) and paired with the concentrations from the serial dilution series to form the calibration dataset used in Section 4.1.2. 83 of the 96 concentration/absorbance pairs lie below 20gL and were used to fit a linear model in Section 4.1.1.

3.1.5 Biomass calibration

Calibration data for the biomass/backscatter calibration model (Section 4.1.2) was acquired by measuring 48 different biomass concentrations at cultivation conditions (Section 3.1.2) in the BioLector Pro. 100 mL C. glutamicum WT culture was grown overnight on 20gL glucose CGXII medium (Section 3.1.2) in two unbaffled 500 mL shake flasks with 50 mL culture volume each (N = 250 rpm, r = 25 mm). The cultures were harvested in the stationary phase, pooled, centrifuged and resuspended in 25 mL 0.9% (w/v) NaCl solution. The highly concentrated biomass suspension was transferred into a magnetically stirred 100 mL trough on the liquid handler for automated serial dilution with logarithmically evenly spaced dilution factors from 1× to 1000×. The serial dilution was prepared by the robotic liquid handler in a 6 × 8 (48-well square) deep well plate (Agilent Part number 201306–100) according to the DilutionPlan (Section 3.1.3). 6x 800 μL of biomass stock solution were transferred to previously dried and weighed 2 mL tubes, immediately after all transfers of stock solution to the 48 well plate had occurred. The 2 mL tubes were frozen at -80°C, lyophilized over night, dried again at room temperature in a desiccator over night and finally weighted again to determine the biomass concentration in the stock solution.

After a column in the 48 well plate was diluted with 0.9% (w/v) NaCl solution, the column was mixed twice by aspirating 950 μL at the bottom of the wells and dispensing above the liquid surface. The transfers for serial dilutions (columns 1 and 2) and to the 48 well FlowerPlate were executed right after mixing to minimize the effects of biomass sedimentation as much as possible. The FlowerPlate was sealed with a gas-permeable sealing foil (product number F-GP-10, m2p-labs GmbH, Baesweiler, Germany) and placed in the BioLector Pro device. The 1 h BioLector process for the acquisition of calibration data was programmed with shaking frequency profile of 1400, 1200, 1500, 1000 rpm while maintaining 30°C chamber temperature and measuring backscatter with gain 3 in cycles of 3 minutes.

The result file was parsed with the bletl Python package [27] to extract backscatter measurements made at 1400 rpm shaking frequency. A log(independent) asymmetric logistic calibration model was fitted as described in Section 4.1.2. The linear calibration model for comparison purposes (Section 4.2.3) was implemented with its intercept fixed to the background signal predicted by the asymmetric logistic model (μBS(0gL)). It was fitted to a subset of calibration points approximately linearly spaced at 30 different biomass concentrations from 0.01 to 15gL.

3.1.6 Microbial growth experiment

Cultivations with C. glutamicum were performed in the automated cultivation platform (Section 3.1.1) under the described conditions. CGXII medium with 20gL glucose and without BHI was used as cultivation medium. To start the growth experiments, the liquid handler was used to transfer 20 μL of a WCB aliquot into the first column of FlowerPlate wells, which were pre-filled with 780 μL medium. These wells were run as a preculture. When precultures reached a backscatter readout of 15, which corresponds to a cell dry weight of approximately 10gL, the inoculation of the main culture wells was triggered. 780 μL medium were distributed into each main culture well (columns 2–8) and allowed to warm up for approximately 15 minutes. Preculture wells A01 and B01 were pooled and 20 μL culture broth was transferred to each main culture well, resulting in 800 μL final volume. The theoretical biomass concentration at the start of the main cultures is 0.25gL accordingly. This strategy was used to avoid a lag-phase with non-exponential growth.

Backscatter measurements of biomass concentration were acquired continuously, while main culture wells were harvested at predetermined time points to measure glucose concentrations in the supernatant. The time points were chosen between 0 and 15 hours after the inoculation of main cultures to cover all growth phases. For harvesting, the culture broth was transferred to a 1 mL deep-well plate by the liquid handler. The plate was centrifuged at 3190 × g at 4°C for 5 minutes and the supernatant was stored on a 1 mL deep well plate chilled to 4°C. The glucose assay was performed after all samples were taken.

3.2 Computational methods

All analyses presented in this study were performed with recent versions of Python 3.7, PyMC ==3.11.2 [28], ArviZ >=0.9 [29], PyGMO >=2.13 [30], matplotlib >=3.1 [31], NumPy >=1.16 [32], pandas >=0.24 [33, 34], SciPy >=1.3 [35] and related packages from the Python ecosystem. For a full list of dependencies and exact versions see the accompanying GitHub repository [36].

The two packages presented in this study, calibr8 and murefi, may be installed via semantically versioned releases on PyPI. Source code, documentation and detailed release notes are available through their respective GitHub projects [37, 38].

3.2.1 Asymmetric logistic function

The asymmetric, five-parameter logistic function (also known as Richard’s curve) was previously shown to be a good model for many applications [39], but it is often defined in a parameterization (Eq 10) that is non-intuitive. Some parametrizations even introduce a sixth parameter to make the specification more intuitive, but this comes at the cost of structural non-identifiability [40, 41]. Furthermore, in the most commonly found parametrization (Eq 10), one parameter is constrained to be strictly positive. We also found that structural non-identifiability between the parameters makes it difficult to define an initial guess and bounds to reliably optimize a model based on this parametrization.

f(x)=LL+LULL(1+eB(mx))1/vLL,LU,B,mRvR>0 (10)

To make calibration model fitting more user-friendly, we reparameterized the commonly used form such that all five parameters are intuitively interpretable and structurally independent (Fig 5). With our reparameterization (Eq 11), the 5-parameter asymmetric logistic function is parameterized by lower limit LLR, upper limit LUR, inflection point x-coordinate IxR, slope at inflection point SR and an asymmetry parameter cR. At c = 0, the y-coordinate of the inflection point lies centered between LL and LU. Iy moves closer to LU when c > 0 and accordingly closer to LL when c < 0 (Fig 5, black and gray curves). An interactive version of Fig 5 can be found in a Jupyter Notebook in the calibr8 GitHub repository [37].

Fig 5. Reparametrized asymmetric logistic function.

Fig 5

When parametrized as shown in Eq 11, each of the 5 parameters can be manipulated without influencing the others. Note that, for example, the symmetry parameter c can be changed without affecting the x-coordinate of the inflection point (Ix), or the slope S at the inflection point (gray vs. black).

For readability and computational efficiency, we used SymPy [42] to apply common subexpression elimination to Eq 11 and our implementation respectively (S1 File). The step wise derivation from Eqs 10 to 11 is shown in S1 File and in a Jupyter Notebook in the calibr8 GitHub repository [37].

f(x)=LL+LULL(es2·(s3·(Ixx)+cs2)+1)s1s0=ec+1s1=ecs2=s0(s0·s1)s3=SLULLLL,LU,Ix,S,cR (11)

3.2.2 calibr8 package for calibration models and modular likelihoods

With calibr8 we present a lightweight Python package that specializes on the definition and modular implementation of non-linear calibration models for calibration and modeling workflows.

The calibr8 application programming interface (API) was designed such that all calibration models are implemented as classes that inherit from calibr8.CalibrationModel, which implements properties and methods that are common to all calibration models (Fig 6). The common interface simplifies working with calibration models in a data analysis or modeling workflow. For a detailed explanation of classes and inheritance in calibr8 we refer the interested reader to the documentation [22]. For example, the CalibrationModel.objective can be used to create objective functions to optimize the model parameters. The objective relies on the loglikelihood method to compute the sum of log-likelihoods from independent and dependent variables. It uses the predict_dependent method internally to obtain the parameters of the probability distribution describing the dependent variables, conditioned on the independent variable.

Fig 6. calibr8 class diagram.

Fig 6

All calibr8 models inherit from the same CalibrationModel and DistributionMixin classes that define attributes, properties and method signatures that are common to all calibration models. Some methods, like loglikelihood() or objective() are implemented by CalibrationModel directly, whereas others are implemented by the inheriting classes. Specifically the predict_* methods depend on the choice of the domain expert. With a suite of Base*T classes, calibr8 provides base classes for models based on Student-t distributed observations. A domain expert may start from any of these levels to implement a custom calibration model for a specific application.

Through its inheritance-based design, the calibr8.CalibrationModel gives the domain expert full control over the choice of trend functions and probability distributions. Conveniently, calibr8 already implements functions such as polynomial, logistic and asymmetric_logistic, as well as base classes for commonly found noise models. By leveraging these base models, the implementation of a user-defined calibration model reduces to just a few lines of code (Box 1 Code 1 and Box 2 Code 2). In the current version we implemented base classes for continuous univariate and multivariate calibration models and anticipated models with discrete independent variables.

Box 1. Code 1. Implementation of glucose/absorbance calibration model using convenience type.
graphic file with name pcbi.1009223.e099.jpg
Box 2. Code 2. Implementation of CDW/backscatter calibration model using convenience type.
graphic file with name pcbi.1009223.e100.jpg

The implementations depicted in Fig 6 are fully compatible with aesara.Variable inputs, resulting in TensorVariable outputs. Aesara is a graph computation framework that auto-differentiates computation graphs written in Python and compiles functions that evaluate with high performance [43]. This way, the loglikelihood function of a CalibrationModel can be auto-differentiated and compiled, thus facilitating efficient computation with optimization or gradient-based MCMC sampling algorithms (Section 3.2.6). For more details about the implementation, please refer to the documentation and code of the calibr8 package [37].

Convenience features. To facilitate modeling workflows, calibr8 implements convenience functions for optimization (fit_scipy, fit_pygmo) and creation of diagnostic plots (calibr8.plot_model) as shown in Section 2.4 and Section 4.1.2. As explained in Section 2.4the residual plot on the right of the resulting figure is instrumental to judge the quality of the model fit.

Standard properties of the model, estimated parameters and calibration data can be saved to a JSON file via the CalibrationModel.save method. The saved file includes additional information about the type of calibration model and the calibr8 version number (e.g. S3 File) to support good versioning and data provenance practices. When the CalibrationModel.load method is called to instantiate a calibration model from a file, standard properties of the new instance are set and the model type and calibr8 version number are checked for compatibility.

3.2.3 Numerical inference

To numerically infer the posterior distribution of the independent variable, given one or more observations, infer_independent implements a multi-step procedure. The three outputs of this procedure are a vector of posterior probability evaluations, densely resolved around the locations of high probability mass, and the bounds of the equal-tailed as well as the highest-density intervals (ETI, HDI) corresponding to a user-specified credible interval probability.

In the first step, the likelihood function is integrated in the user-specified interval [lower, upper] with scipy.integrate.quad. Second, we evaluate its cumulative density function (CDF) at 10 000 locations in [lower, upper] and determine locations closest to the ETI99.999%. Next, we re-evaluate the CDF at 100 000 locations in the ETI99.999% to obtain it with sufficiently high resolution in the region of highest probability. Both ETI and HDI with the (very close to) user-specified ci_prob are obtained from the high-resolution CDF. Whereas the ETI is easily obtained by finding the CDF evaluations closest to the corresponding lower and upper probability levels, the HDI must be determined through optimization (Eq 12).

HDI=[a,a+d]=argmina,d{ifCDF(a+d)CDF(a)<ci_probdotherwise (12)

3.2.4 murefi package for building multi-replicate ODE models

Models of biochemical processes are traditionally set up to describe the temporal progression of an individual system, such as a reaction vessel. Experimental data, however, is commonly obtained from multiple reaction vessels in parallel, often run under different conditions to maximize information gain. This discrepancy between the prototypical model of the biological system and the heterogeneous experimental data to be fitted is typically resolved by replicating the model for all realizations of the biological system in the dataset. Along with the replication of the model, some model parameters may be kept global, while others can be local to a subset of the replicates, for example due to batch effects or different start conditions.

With a Python package we call murefi (multi-replicate fitting), we implemented data structures, classes and auxiliary functions that simplify the implementation of models for such heterogeneous time series datasets. It seamlessly integrates with calibr8 to construct likelihood-based objective functions for optimization or Bayesian inference. To enable the application of efficient optimization or sampling algorithms, the use of automatic differentiation to obtain gradients of the likelihood w.r.t. input parameters is highly desirable. Various methods for automatic differentiation of ODE models are available, but their efficiency is closely connected to the implementation and size of the model [44]. In murefi we implemented support for sunode [45], a recently implemented Python wrapper around the SUNDIALS suite of nonlinear and differential/algebraic equation solvers [46]. When used in the context of a PyMC model, a process model created with calibr8 and murefi can therefore be auto-differentiated, solved, optimized and MCMC-sampled with particularly high computational efficiency.

Structure of time series data and models. To accommodate for the heterogeneous structure of time series experiments in biological applications, we implemented a data structure of three hierarchy levels. The murefi.Timeseries object represents the time and state vectors t, y of a single state variable or observation time series. To allow association of state and observed variables via calibr8 calibration models, the Timeseries is initialized with independent_key and dependent_key. Multiple Timeseries are bundled to a murefi.Replicate, which represents either the observations obtained from one reaction vessel, or the predictions made by a process model. Consequently, the murefi.Dataset aggregates replicates of multiple reaction vessels, or the model predictions made for them (Fig 7, center). To allow for a separation of data preprocessing and model fitting in both time and implementation, a murefi.Dataset can be saved as and loaded from a single HDF5 file [47, 48].

Fig 7. Data structures and computation graph of murefi models.

Fig 7

Elements in a comprehensive parameter vector are mapped to replicate-wise model instances. In the depicted example, the model instances for both replicates “B1” and “B2” share θ1,global as the first element in their parameter vectors. The second model parameter θ2 is local to the replicates, hence the full parameter vector (left) is comprised of three elements. Model predictions are made such that they resemble the structure of the observed data, having the same number of time points for each predicted time series. An objective function calculating the sum of log-likelihoods is created by associating predicted and observed time series via their respective calibration models. By associating the calibration models based on the dependent variable name, a calibration model may be re-used across multiple replicates, or kept local if, for example, the observations were obtained by different methods.

To describe a reaction system by a system of ODEs, a new class is implemented by subclassing the murefi.BaseODEModel convenience type. In the constructor of the class, the names and order of parameters and state variables are defined, whereas the differential equations are implemented in a dydt instance method. An example is shown in Box 3 Code 3 with the implementation of the Monod kinetics for microbial growth.

Box 3. Code 3. Implementation of Monod ODE model using murefi.BaseODEModel convenience type.
graphic file with name pcbi.1009223.e101.jpg

Parameter mapping and objective function

In addition to a murefi model instance, a murefi.Dataset and calibration models, a murefi.ParameterMapping must be defined to facilitate the creation of an objective function. This mapping specifies whether parameters are local or global and the rules with which they are shared between replicates. The ParameterMapping may be represented as a table, assigning each element of replicate-wise parameter vectors to constants or names of parameters in a comprehensive parameter vector. In Fig 7, the parameter mapping is depicted by arrows mapping elements of a 3-element comprehensive parameter vector to 2-element parameter vectors of the replicate-wise models. A table representation of the parameter mapping used to fit the Monod model in Section 4.2 is shown in S4 File.

Model predictions are made such that the time points of the predicted time series match those of the observed data (Fig 7, center). Based on the (in)dependent_key, the predicted and observed Timeseries can be associated with each other and passed to the corresponding CalibrationModel.loglikelihood method to calculate L(θYobs). Note that this procedure conveniently allows for calibration models to be shared by multiple replicates, as well as making observations of one state variable with more than one analytical method.

An objective function performing the computation depicted in Fig 7 can be created with a single call to a convenience function. For compute-efficient optimization and specifically Bayesian parameter estimation, the elements in the parameter vector can also be Aesara tensors, resulting in the creation of a symbolic computation graph. The computation graph cannot only be statically compiled but also auto-differentiated, if all operations in the graph are also auto-differentiable. This is already the case for standard calibr8 calibration models and is also available for murefi -based process models when the sunode [45] package is installed. A corresponding example of obtaining gradients from an ODE model with calibr8, murefi and sunode is included in the murefi documentation [49].

3.2.5 Optimization

In this work, optimization algorithms are involved at multiple steps of the workflow. Unless otherwise noted we used scipy.optimize.minimize with default settings to obtain the MLEs of calibration and process models. Our current implementation to compute HDIs (Section 3.2.3) uses scipy.optimize.fmin with an underlying Nelder-Mead simplex algorithm.

Initial guesses, as well as parameter bounds for maximum-likelihood optimization, were motivated from prior assumptions or exploratory plots of the data. Based on the intuitive parametrization of the asymmetric logistic (Section 3.2.1) we specified initial guesses for calibration models such that the model prediction from the guessed parameter vector was at least in the same order of magnitude as the data. For MLE of process model parameters, the guessed parameters were motivated from prior assumptions, e.g. the amount of used substrate or values obtained from literature research. Likewise, we specified bounds to be realistic both biologically and based on exploratory scatter plots of the data.

3.2.6 MCMC sampling

In contrast to optimization, MCMC sampling follows a very different paradigm. Whereas in MLE the likelihood function is iteratively evaluated to find its maximum, Bayesian inference aims to approximate the posterior probability distribution according to Eq 7.

Most sampling algorithms draw the posterior samples in the form of a Markov chain with a equilibrium distribution that matches the posterior probability distribution. While early MCMC algorithms, such as Random-walk Metropolis [50] are conceptually simple and easy to implement, they are computationally ineffective on problems with more than just a handful of dimensions [51, 52]. Instead of implementing inefficient algorithms by hand, practitioners can rely on state of the art libraries for Bayesian inference. These libraries apply automatic transformations, provide diagnostic tools and implement much more efficient sampling algorithms that often use gradients dLdθ for higher computational efficiency.

Probabilistic programming languages / libraries (PPL), such as PyMC [53], Pyro [54], Stan [55] or Tensorflow Probability [56] use automatic differentiation and typically implement at least one of the gradient-based sampling algorithms Hamiltonian Monte Carlo (HMC) or No-U-Turn Sampling (NUTS) [52]. While PPLs typically require a model to be implemented using their API, other libraries such as emcee [57] provide, for example, gradient-free ensemble algorithms that can be applied to black-box problems. PyMC, the most popular Python-based PPL, implements both gradient-based (HMC, NUTS) as well as gradient-free algorithms, such as Differential Evolution MCMC (DE-MCMC) [58], DE-MCMC-Z [51] or elliptical slice sampling [59] in Python, allowing easy integration with custom data processing and modeling code. In this study, PyMC was used to sample posterior distributions with either DE-MCMC-Z (pymc.DEMetropolisZ) or NUTS.

MCMC sampling of the process model. Whereas in DE-MCMC, proposals are informed from a random pair of other chains in a “population”, the DE-MCMC-Z version selects a pair of states from its own history, the “Z”-dimension. Compared to DE-MCMC, DE-MCMC-Z yields good results with fewer chains that can run independently. The pymc.DEMetropolisZ sampler differs from the original DE-MCMC-Z in a tuning mechanism by which a tune_drop_fraction of by default 90% of the samples are discarded at the end of the tuning phase. This trick reliably cuts away unconverged “burn-in” history, leading to faster convergence.

pymc.DEMetropolisZ was applied to sample the process model in Section 4.2.3. MCMC chains were initialized at the MAP to accelerate convergence of the DE-MCMC-Z sampler in the tuning phase. 50 000 tuning iterations per chain were followed by 500 000 iterations to draw posterior samples for further analysis. The DEMetropolisZ settings remained fixed at (λ=2.382·d (default), ϵ = 0.0001) for the entire procedure.

The R^ diagnostic from ArviZ [29] was used to check for convergence (all R^1, S1 Table).

3.2.7 Visualization techniques

Plots were prepared from Python with a combination of Matplotlib [31], ArviZ and PyMC. We used POV-Ray to produce Figs 2 and 4 and https://diagrams.net for technical drawings. Probability densities were visualized with the pymc.gp.utils.plot_gp_dist helper function that overlays many polygons corresponding to percentiles of a distribution, creating the colorful bands of plots seen in Section 4.2.4 and others. Posterior predictive samples were obtained by randomly drawing observations from the calibration model, based on independent values sampled from the posterior distribution. If not stated otherwise, the densities plotted for MCMC prediction results were obtained from at least 1000 posterior samples. The pair plots of 2-dimensional kernel density estimates of posterior marginals (e.g. S2 Fig) were prepared with ArviZ.

4 Results and discussion

4.1 Application: Implementing (non-)linear calibration models with calibr8

A common application of calibration models in life sciences are enzymatic assays, where the quantification of glucose is one out of many popular examples. In this section, data from a glucose assay is used as a demonstration case for building calibration models with calibr8. First, the linear range of the assay is described by the corresponding linear calibration model to then explore an extended concentration range by implementing a calibration model with logistic trend of the location parameter. We examine a second calibration example that is nonlinear in its nature, namely the backscatter/biomass relationship of a commercially available cultivation device with online measurement, a BioLector Pro device (Section 3.1.1). Finally, we demonstrate how uncertainty estimates for biomass concentrations can be easily obtained with calibr8.

4.1.1 Linear calibration model

To acquire data for the establishment of a calibration model, 96 glucose standards between 0.001 and 50gL were subjected to the glucose assay. A frequent approach to calibration modeling in life sciences is to identify the linear range of an assay and to discard measurements outside this range. From a previous adaptation of the glucose assay for automation with liquid handling robotics, the linear range was expected to be up to 2gL (Holger Morschett, personal communication, 2019). Since samples are diluted by a factor of 10 before the assay, 83 glucose standards with concentrations below 20gL remain for a linear calibration model.

As described in Section 2.4, calibration models use a probability distribution to describe the relation between independent variable and measurement outcome, both subject to random noise. In this example, we chose a Student-t distribution, thus the change of location parameter μ over the independent variable determines the trend of the calibration model. calibr8 provides a convenience class BasePolynomialModelT that was used to implement a glucose calibration model with linear trend (Box 1 Code 1). For the spread parameter scale, we also chose a linear function dependent on μ to account for increasing random noise in dependency of the absorbance readout of the assay. Both can easily be adapted by changing the respective parameters mu_degree and scale_degree passed to the constructor of the convenience class. The degree of freedom ν in a BasePolynomialModelT is estimated from the data as a constant. The mathematical notation of this model can be found in S2 File.

The calibration model resulting from MLE of location and spread parameters was plotted with another calibr8 convenience function (Fig 8A–8C). The plot shows the calibration model and measurement data (Fig 8A), the same relation with a logarithmic x-axis (Fig 8B) and the relative residuals of data and model predictions (Fig 8C). As it is often recommended for biological assays, the glucose concentrations of the dilution series were evenly spaced on a logarithmic scale [60, 61], thus ensuring a higher accuracy of the model in the low-concentrated area (Fig 8B). To evaluate the quality of the linear calibration model, the residuals of data and model prediction were analyzed (Fig 8C). Overall, the residuals lie between ±5% of the observed values, demonstrating the high precision of the data. For concentrations higher than 0.6gL, an s-shaped trend is observed in the residuals, meaning that data first lies below and then above the linear model prediction. This indicates a lack-of-fit as described in Section 2.4. However, the discrepancy might also be caused by errors in the serial dilution that was pipetted with the robotic liquid handler, resulting in deviations from the expected linear relation. Moreover, it can be seen that the relative spread of residuals is quite constant, meaning that the absolute deviation increases with higher concentrations (Fig 8C). Although the linearly increasing scale parameter accounts for this rise of the underlying random noise, it can be seen that it is slightly overestimated by the model since all data points above 2gL lie within a 90% probability interval.

Fig 8. Linear (top) and logistic (bottom) calibration model of glucose assay.

Fig 8

A calibration model comprising linear functions for both the location parameter μA365 and the scale parameter of a Student-t distribution was fitted to calibration data of glucose standard concentrations (0.0520gL) and absorbance readouts by maximum likelihood estimation (A-C). The calibration data used to fit the linear model is the 0.0520gL subset of standards that were spaced evenly on a log-scale up to 50gL (B, E). Likewise, a calibration model with a 5-parameter asymmetric logistic function for the μ parameter of the Student-t distribution was fitted to the full 0.0550gL calibration dataset (D-E). In both models, the scale parameter was modeled as a 1st-order polynomial function of μ and the degree of freedom ν as a constant. The extended range of calibration standard concentrations up to 50gL reveals a saturation kinetic of the glucose assay (A, D) and depending on the glucose concentration, the residuals (C, F) with respect to the modeled location parameter are scattered by approximately 5%. Modeling the scale parameter of the distribution as a 1st-order polynomial function of μ describes the broadening of the distribution at higher concentrations (C).

In comparison to simple linear regression, which is often evaluated by the coefficient of determination R2 alone, the demonstrated diagnostics allow to judge whether the choice of model is appropriate. In this case, a more sophisticated model for the spread of the Student-t distribution could be chosen to reduce the lack-of-fit. Moreover, all data points lying above 20gL were not considered so far to allow for a linear model. In the following, we will therefore modify the existing calibration model to include a logistic function for the location parameter.

4.1.2 Logistic calibration model

Although linear calibration models are useful in many cases, some relations in datasets are non-linear in their nature. Moreover, restricting analytical measurements to an approximately linear range instead of calibrating all concentrations of interest can be limiting. If the order of magnitude of sample concentrations is unknown, this leads to laborious dilution series or repetition of measurements to ensure that the linear range is met. In contrast, non-linear calibration models allow to describe complex relationships and, in case of biological assays, to reduce these time- and material-consuming workflows.

Many recommendations for experimental design in calibration can be found in literature (e.g. [60]). Having determined the range of interest for the calibration model, it should be exceeded in both directions if possible, thus ensuring that the relevant concentrations are well-covered. This way, all model parameters, including limits where applicable, can be identified from the observed data. Afterwards, the expected relationship between dependent and independent variable is to be considered. Since the glucose assay readout is based on absorbance in a plate reader (Section 3.1.4), which has a lower and upper detection limit, a saturation effect at high glucose concentrations is expected. In our demonstration example, glucose concentrations of up to 50gL were targeted to cover relevant concentration for cultivation (Section 4.2) and at the same time to exceed the linear range towards the upper detection limit.

Sigmoidal shapes in calibration data, e.g. often observed for immunoassays, can be well-described by logistic functions [39]. In the calibr8 package, a generalized logistic function with five parameters is used in an interpretable form (Section 3.2.1). It was used to implement a calibration model where the location parameter μ is described by a logistic function dependent on the glucose concentration. A respective base class BaseAsymmetricLogisticT is provided by calibr8 (S1 File). The mathematical notation of the resulting model is given in S2 File. Using the whole glucose dataset up to 50gL, parameters of the new calibration model were estimated (Fig 8D–8F).

Overall, the logistic trend of the location parameter matches the extended calibration data well (Fig 8D and 8E). Since the scale parameter of the Student-t distribution is modeled as a linear function dependent on μ, the width of the likelihood bands approaches a limit at high glucose concentrations (Fig 8F). For concentrations greater than 3gL, no residuals lie outside of the 90% probability interval, indicating that the distribution spread is overestimated as it was before. Importantly, a direct comparison between the two calibration models (Fig 8C and 8F) reveals a high similarity in the reduced range (<20gL). This demonstrates how a non-linear model extends the range of concentrations available for measurement and modeling while improving the quality of the fit. For the glucose assay, truncating to a linear range thus becomes obsolete.

While non-linear models were so far shown to be useful to extend the usable concentration range of an assay, other applications do not allow to linearly approximate a subrange of measurements. Such an example is the online detection of biomass in growth experiments, where the non-invasive backscatter measurement (Section 3.1.1) does not allow for dilution of the cell suspension during incubation. To model the distribution of backscatter observations as a function of the underlying biomass concentration, a structure similar to the glucose calibration model was chosen (S2 File). In contrast, the location parameter μ was modeled by a polynomial function of the logarithmic cell dry weight (CDW). The final CDW/backscatter calibration model was implemented using the calibr8.BaseLogIndependentAsymmetricLogisticT convenience class (Box 2 Code 2).

Two independent experiments were conducted to obtain calibration data as described in Section 3.1.5. The model was fitted to pooled data using the calibr8.fit_pygmo convenience function. As shown in Fig 9, the model accurately describes the nonlinear correlation between biomass concentration and observed backscatter measurements in the cultivation device (Fig 9A and 9B). Non-linearity is particularly observed for biomass concentrations below 10gL (Fig 9A). Moreover, the residual plot (Fig 9C) mainly shows a random distribution; solely residuals between 1 and 3gL indicate a lack-of-fit. To assess the potential influence, the resulting uncertainty in estimated biomass concentrations has to be considered, which will be further discussed in Section 4.1.3. Overall, the chosen logistic calibration model describes the calibration data well and is thus useful to transform backscatter measurements from the BioLector device into interpretable quantitative biomass curves.

Fig 9. Calibration model of biomass-dependent backscatter measurement.

Fig 9

Backscatter observations from two independent calibration experiments (1400 rpm, gain = 3) on the same BioLector Pro cultivation device were pooled. A non-linearity of the backscatter/CDW relationship is apparent already from the data itself (A). The evenly spaced calibration data (B) are well-described with little lack-of-fit error (C). At low biomass concentrations the relative spread of the measurement responses starts at ca. 20% and reduces to approximately 2% at concentrations above 10gL.

In summary, this section illustrated how calibration models can be built conveniently with calibr8 and showed that the asymmetric logistic function is suitable to describe many relationships in biotechnological measurement systems. Note that the only requirement to estimate CalibrationModel parameters with calibr8 is to provide a numpy.ndarray with data for the independent and dependent variable. The code is agnostic of bioprocess knowledge and can thus be transferred to other research fields without further adaptations.

Having demonstrated how concentration/readout relations can be described by different calibration models, a remaining question is how to apply those calibration models. An important use-case is to obtain an estimate of concentrations in unknown samples, where uncertainty quantification is a crucial step.

4.1.3 Uncertainty quantification on independent variables

After establishing a calibration model, the practitioner can in most cases consider the parameters of the model as fixed. Characterization of measurement reproducibility is thereby externalized into the calibration procedure, where random noise is inherently described by the spread of a probability distribution. The calibration model can then be put into application for the quantification of the independent variable from new observations. As introduced before, not only a single value of the independent variable is desired, but also a measure of uncertainty about it.

Quantifying the uncertainty in the independent variable as a continuous probability density is not only intuitive to visually interpret (Section 2.4), but also flexible with respect to the question of interest. To quantify the uncertainty numerically, various kinds of credible intervals (Section 2.3) can be obtained. For example, one might estimate the equal-tailed interval in which the independent variable lies with 90% probability, or alternatively the probability that it lies above a certain threshold.

In calibr8, the CalibrationModel.infer_independent method is used to perform the uncertainty quantification from one or more observations (Section 3.2.3). Internally, it uses the loglikelihood method of the calibration model and numerically integrates the sum of log-likelihoods over a user-specified range of plausible independent variables (Section 3.2.3). The resulting calibr8.ContinuousUnivariateInference is equivalent to Eq 13, where the prior p(x) is specifying the plausible range.

p(xyobs)=L(xyobs)·p(x)L(xyobs)·p(x)dx=L(xyobs)·p(x)abL(xyobs)dxwherep(x)=Uniform(a,b) (13)

For convenience, the CalibrationModel.infer_independent method automatically determines median and credible interval (ETI and HDI) bounds. It determines vectors for the independent variable and the conditional probability density that can be plotted without further processing.

In Fig 10, various inferences obtained with infer_independent are illustrated with a biomass calibration model. For illustration purposes, the calibration model from Section 4.1.2 was slightly modified and the degree of freedom ν was modified to an extreme value of 1. Different sets of simulated observations were subjected to the infer_independent method and the resulting credible intervals are shown in subplots A and B.

Fig 10. Independent variable PDFs in various observation scenarios.

Fig 10

Posterior densities inferred from various numbers of observations corresponding to different biomass concentrations are shown (A). The ends of the drawn lines in A indicate the 95% equal-tailed interval. Near biomass concentrations of 0, the posterior density is asymmetric (A, blue), indicating that very low concentrations cannot be distinguished. As the number of observations grows, the probability mass is concentrated and the ETIs shrink (A, oranges). The choice of a Student-t distribution model can lead to a multi-modality of the inferred posterior density when observations lie far apart (B). For asymmetric distributions, the median (dashed line) does not necessarily coincide with a mode and equal-tailed and highest-density intervals (ETI, HDI) can be different. Maximum likelihood estimates from individual observations, as obtained via predict_independent are shown as arrows. Note: yobs and the model’s ν parameter were chosen at extreme values for illustrative purposes.

In Fig 10A, the orange curves show the 95% ETIs for one, two or three observations of backscatter signals corresponding to 1.5gL. As expected, the probability mass is concentrated around 1.5gL with higher number of observations and the ETIs get narrower. Furthermore, observations in the lower or upper saturation of the measurement system typically result in one-sided probability densities (blue).

When the calibration model assumes the possibility of outliers (Student-t distributed measurement responses), the observation of drastically different measurement responses can translate into a multi-modal posterior belief in the independent variable. The intuition behind this multi-modality is that a subset of observations are “outliers” from the perspective of the remaining observations and vice versa. In the example shown in Fig 10B, the three observations around 0.5 could be “outliers”, or the ones around 1.3, but from the data alone both are equally likely. Hence the posterior belief in the biomass concentration is bimodal. The green arrows indicate the MLE estimates obtained via predict_independent with individual observations. The plot also reveals slight differences between ETI and HDI in this scenario. Note that both the degree of freedom and the simulated observations have been set to extreme values to illustrate the properties of the Student-t distribution.

The Bayesian or likelihood-based perspective on uncertainty in the independent variable (Eq 13) allows for quantification of uncertainty even with single observations, close to zero, or close to saturation limits of the measurement system. Calibration models built with calibr8 are easy to set up, visualize and diagnose and can thus be flexibly integrated into existing data analysis workflows of various domains. Moreover, the setup in a versatile, object-oriented programming language such as Python allows to use calibr8 in high-throughput, automated experiments where hundreds of calibration models must be fitted. Next, we will build upon the presented biomass and glucose calibration models and demonstrate how combining them with a bioprocess model enables to gain insight into the growth phenotype of a biotechnological model organism, Corynebacterium glutamicum.

4.2 Application 2: Process modeling of bacterial growth

A real-world experimental procedure is often not a textbook example but rather a heterogeneous dataset, e.g. comprising multiple measurement types or varying process conditions. We use the term process model, as introduced in Section 2.5, to describe the complete underlying chemical or biological process, but not the experimental observations that are made of it. These input/output relations of the measurement system are explicitly described by calibration models. In this application example, we demonstrate how object-oriented calibr8 calibration models from Section 4.1 can be combined with an ODE bioprocess model to describe a heterogeneous dataset of bacterial growth curves.

The simplest experimental setup to obtain a bacterial growth curve is a so-called batch cultivation. Under laboratory conditions, such batch cultivations can be performed in a variety of cultivation systems such as shake flasks, bioreactors or miniaturized reaction systems. From a data science perspective, the cultivation systems differ mostly by how many independent cultivations are performed in parallel and by the kind and number of observations made per cultivation. In the domain of bioprocess development, a large number of cultivations must be conducted to find best-performing producer strains and media compositions. For these applications, microbioreactors, which are miniaturized shaken or stirred cultivation systems, offer an increased cultivation throughput combined with non-invasive online measurements such as pH or dissolved oxygen tension (DO) [62]. In this study, a commercially available microbioreactor called BioLector Pro (Section 3.1.2) was used, which additionally provides quasi-continuous measurement of biomass. Note that for the understanding of the underlying software, the cultivation device is of minor importance and any other measurement device could have been used instead. All three signals (pH, DO and biomass) in this example are obtained optically and must be calibrated against the true variable of interest (Section 3.1.1, Section 3.1.5). Furthermore, confounding factors are known for all three measurement methods, mandating special rigor in the design and analysis of quantitative experiments. For example, the optode-based pH and DO measurements can be influenced by media components, or the backscatter signal by morphology changes.

To facilitate a simple application example, we grew C. glutamicum in parallel, miniaturized batch cultivations within a specialized deepwell plate (FlowerPlate) (Section 3.1.2). This bacterium is a well-known industrially applied microorganism that exhibits textbook-like exponential growth kinetics when grown on carbon sources such as glucose [63]. A preculture was grown in two wells (A01 and B01) of the deepwell plate and used to automatically inoculate 28 main culture wells (A02 through D08). We thus avoided a lag phase of adaptation at the beginning of the growth curve, which greatly simplifies the process model (Section 3.1.2). As we will see later on, the pipetting error of the robotic liquid handler at the small inoculation volume must be considered when setting up the process model, highlighting the need to adapt the data analysis to the peculiarities of the experiment.

Before going into the details of the process model for this application example, we would like to emphasize that the same modeling techniques can be applied to other domain-specific examples.

4.2.1 Building an ODE process model for bacterial growth experiments

The simplest model for microbial growth is the Monod kinetics differential equation model of substrate-limited exponential growth [64]. Similar to how the famous Michaelis-Menten kinetics describe enzymatic reaction rates, the Monod kinetics model the specific growth rate as a function of substrate concentration. Under the assumptions of homogeneous mixing, unlimited nutrient supply and constant ambient conditions, the Monod model can be applied to batch cultivations of bacterial, fungal, plant or cell cultures that grow with a maximum growth rate μmax until a substrate, typically a carbon source, is depleted.

The Monod model (Eq 14) has five parameters including the initial conditions for substrate concentration S0 and biomass concentration X0. The maximum growth rate μmax specifies the specific exponential growth rate that the organism can achieve under the modeled conditions. The actual specific growth rate μ(t) is modeled as a function of μmax, the current substrate concentration S and a parameter KS that corresponds to the substrate concentration at which μ(t)=μmax2. The last parameter YXS, called biomass yield, describes the amount of substrate consumed per unit of formed biomass.

dXdt=μmax·X·SKS+SdSdt=1/YXS·dXdtS,X,μmax,KS,YXSR>0 (14)

The experiment to be modeled in this application example was devised such that Monod-like growth behavior of C. glutamicum wild-type could be expected (Section 3.1.2). We grew 28 parallel batch cultures that were sampled to measure glucose concentrations in addition to the high-resolution backscatter time series. The resulting dataset comprises 28 replicates, each with backscatter time series of varying length and a time series of length 1 for the glucose absorbance readout. Building upon our Python package murefi for flexible multi-replicate fitting, we loaded the raw observations into a murefi.Dataset object (Section 3.2.4). The package was designed to simplify the definition and parameter estimation of process models that describe all replicates in a dataset simultaneously.

To build such elaborate process models with murefi, the user must specify the process model corresponding to a single replicate, as well as a set of rules that describe how parameters of this model are shared across replicates. The Monod kinetics in this application example were implemented in just a few lines of code by subclassing from murefi.BaseODEModel (Box 3 Code 3).

For heterogeneous datasets, the rules for sharing process model parameters across replicates can be complex and hard to implement and most modeling workflows require the practitioner to often change the parametrization. In murefi, the ParameterMapping class supports the modeler by specializing in the tedious translation of parameter sharing rules into a function (.repmap(…)) that takes a single parameter vector and transforms it into replicate-specific parameter vectors. At the same time, it provides mechanisms for specifying fixed parameters, initial guesses and bounds on the parameters. Reading a spread sheet with parameters into Python is an easy way of initializing the ParameterMapping (Table 1).

Table 1. Tabular representation of a parameter mapping.

With columns corresponding to the parameter names of a naive Monod process model, the parametrization of each replicate, identified by a replicate ID (rid) is specified in a tabular format. Parameter identifiers that appear multiple times (e.g. S0) correspond to a parameter shared across replicates. Accordingly, replicate-local parameters names simply do not appear multiple times (e.g. X0_A06). Numeric entries are interpreted as fixed values and will be left out of parameter estimation. Columns do not need to be homogeneously fixed/shared/local, but parameters can only be shared within the same column. The parameter mapping can be provided as a DataFrame object.

rid S0 X0 μmax KS YXS
A02 S0 X0_A02 mu_max 0.02 Y_XS
A03 S0 X0_A03 mu_max 0.02 Y_XS
A04 S0 X0_A04 mu_max 0.02 Y_XS
A05 S0 X0_A05 mu_max 0.02 Y_XS
A06 S0 X0_A06 mu_max 0.02 Y_XS

Unique names specify that a parameter is only estimated from the indicated replicate (e.g. X0_A02) while shared names correspond to global parameters (e.g. S0). For the application example at hand, a parameter mapping was defined such that the parameter X0 is local to each replicate while S0, μmax and YXS are shared across all replicates. For the Monod substrate affinity constant KS, literature reports values of approximately 0.00050.1gL for Escherichia coli [65]), while no data is available for C. glutamicum. Because it is practically non-identifiable at the resolution of our dataset, KS was fixed to an arbitrary, but numerically harmless value of 0.02gL. In Table 1, this is expressed by the numerical column entries.

A likelihood function for parameter estimation was created using the murefi.objectives.for_dataset convenience function (Box 4 Code 4). The objective is independent of the parameter estimation paradigm and was applied for optimization via MLE (Section 4.2.2) and sampling by MCMC (Section 4.2.3) in the scope of this work.

Box 4. Code 4. MLE of process model parameters.
graphic file with name pcbi.1009223.e102.jpg

4.2.2 Estimating ODE process model parameters by maximum likelihood

First, we determined maximum likelihood estimates of the process model parameters through optimization. In few lines of code, the calibration models from Section 4.1 and dataset are loaded (Box 4 Code 4, ll. 2–4), the process model is instantiated (Box 4 Code 4, l. 1) and the ParameterMapping is specified with bounds and guesses (Box 4 Code 4, ll. 7–21). The objective (Box 4 Code 4, ll. 22–27) can directly be used for an optimization algorithm (Box 4 Code 4, ll. 28–32), in this case one from the popular Python library scipy. A table with MLE parameters can be found in S1 Table.

Fig 11 shows the observations alone (A) and combined with MLE results (B) for glucose (absorbance) and biomass (backscatter). The replicates were sampled at different times to measure glucose concentrations; the end of a time series is indicated by an arrow and the replicate name (Fig 11A). Overall, the backscatter time series show a very high reproducibility, which demonstrates the effect of pooling precultures before inoculation (Section 3.1.2). The model describes the observations so accurately that they can only be distinguished in the inset plot (Fig 11B). Here, a small difference between replicates can be observed, which is caused by varying initial biomass concentrations due to inevitable pipetting errors in the automated inoculation of the main cultures. It becomes evident that replicate-wise X0 parameters were necessary to account for this effect. The different initial biomasses are also visible from the spread of data points at the beginning of the growth curve (Fig 11B). For the biomass, the only period of systematic deviation between model prediction and observations is at the time of entry into the stationary phase, the phase where substrate is depleted and growth stops. Here, the biomass signal overshoots while the Monod kinetics predict a rapid change to a constant signal. This effect in the growth curve of C. glutamicum is also known from other experiments with the BioLector [66] and cannot be accounted for by the otherwise useful textbook process model.

Fig 11. Measurements and maximum likelihood estimate of C. glutamicum growth Monod model.

Fig 11

Original measurement responses of online biomass (backscatter) and at-line endpoint glucose assay measurements (absorbance) are shown in (A). Glucose measurements were obtained by sacrificing culture wells, hence each backscatter time series terminates at the time of glucose assay observations. The time and well ID of sacrifices are marked by arrows, colored by row in the cultivation MTP. The inset plot shows a typical layout of the cultivation plate (FlowerPlate). The preculture wells are highlighted in green, main cultures in black. In B, the observations and MLE predictions of the ODE process model are shown in SI units. Observations were transformed from original units using the predict_independent method of the respective calibration model. Whereas all curves start at the same global initial substrate concentration S0, each well has individual initial biomass concentrations, resulting in the time shifts visible in the zoomed-in inset plot. Biomass observations in the inset plot (●) correspond to the median posterior inferred from each backscatter observation individually.

The glucose data shows more deviation, but follows the expected textbook behaviour of exponential decay (Fig 11B). Interestingly, the predictions for glucose concentrations at the end of cultivation lie slightly above 0gL, showing that the corresponding calibration model is not describing this range of concentrations well. The deviation could be caused by other components in the used cultivation medium that distort the measurement compared to calibration with fresh medium as diluent. However, this was not further investigated since the substrate data has little influence on the parameter estimation compared to the high-resolution backscatter measurements.

From a first inspection of MLE results, we can see that the simple Monod process model describes the high-resolution data very well. For more insight, we will take a look at the parameter estimation, correlations and systematic deviations using a Bayesian approach.

4.2.3 Hierarchical Bayesian ODE models with calibr8 and murefi

The results presented in the previous chapter show that the Monod model, when combined with non-linear calibration models for the observations, can describe the observed biological process with high accuracy. However, the precision of the parameter set obtained by the maximum likelihood method is still unknown. Particularly, when decisions are made from model-based inferences and predictions, the uncertainty about these variables is a key factor.

The combination of (forward) sensitivity analysis with Gaussian error propagation could be applied to learn about the precision of the maximum likelihood estimate. Instead of maximum likelihood optimization of a parameter set, Bayes’ rule can be used to infer a posterior probability distribution of parameters. In comparison to the maximum likelihood method, the Bayesian approach allows to incorporate prior knowledge and inherently quantifies uncertainty and parameter correlations. Bayesian posteriors can in some (rare) cases be obtained analytically, or numerically as shown in Section 4.1.3. However, in most practical applications Markov chain Monte Carlo (MCMC) algorithms are applied. MCMC offers convergence guarantees as the number of iterations approaches infinity and can give satisfactory results with competitive computational performance when modern algorithms are used.

To build a Bayesian process model, one must explicitly state prior beliefs in the model parameters in the form of probability distributions. For our hierarchical Monod model application example, we must specify prior beliefs in the ODE parameters μmax, YXS and initial conditions S0 and X0,well. Prior distributions for these parameters were specified to reflect biologically reasonable, but uninformative assumptions about the experiment (Eq 15). The initial substrate concentration S0 was expected at approximately 20gL with a conservative 10% relative error. For C. glutamicum wild-type, our priors for biomass yields with HDIYXS95%=[0.5,0.7]gCDWgglucose and for maximum growth rates with HDIμmax95%=[0.2,0.6]h1 are uninformative and based on literature [67]. Our process model describes initial biomass concentrations on a per-well basis (Section 4.2.1), but can still infer the mean initial biomass concentration X0,μ as a hyperprior by modeling well-specific offsets w.r.t. the group mean as X0,well = X0,μFoffset,well. Through X0,μ the priors for all initial biomass concentrations X0 are parametrized by a common parameter, allowing each individual X0,well to vary while concentrating around their common group mean. For more intuition and details about Bayesian hierarchical modeling in particular, we refer to [68]. While the experiment performed here is modeled with a hierarchical prior on a process model parameter, one may also use hierarchical priors for calibration model parameters. A corresponding example is shown in the calibr8 documentation [22].

The experiment was programmed to inoculate main cultures to approximately 0.25gL (Section 3.1.2), therefore the prior for X0,μ was centered at 0.25gL with a 10% relative error. Our prior belief in the well-specific relative offset Foffset,well was also modeled by a Lognormal distribution with mean 0, corresponding to the expectation that the offset is centered around 1 in the transformed space. A standard deviation of 20% was chosen to account for random and systematic inaccuracy of the automated liquid handler at the low pipetting volume of 20 μL [66].

X0,μLognormal(μ=log(0.25),σ=0.1)FoffsetLognormal(μ=0,σ=0.2)X0X0,μ·FoffsetS0Lognormal(μ=log(20),σ=0.1)YXSBeta(μ=0.6,σ=0.05)μmaxBeta(μ=0.4,σ=0.1)Ypred,wellϕprocessmodel(S0,X0,well,μmax,YXS)L(θpmYobs)=p(Yobsϕcalibrationmodel(Ypred)) (15)

When modeling with calibr8 and murefi, this specification of prior beliefs is the only overhead compared to the MLE method. The API of both packages was designed to be fully compatible with the probabilistic programming library PyMC, such that calibr8 and murefi models can become fully Bayesian with little programming effort.

Concretely, the objective function created by murefi accepts Aesara tensors (e.g. PyMC random variables) as inputs, resulting in a symbolic TensorVariable likelihood instead of a numeric one. The PyMC model for the hierarchical ODE process model in our application example builds upon the previously established objective function (Box 4 Code 4, l. 22). The model code (Box 5 Code 5) resembles the mathematical notation of the same model shown in Eq 15.

Box 5. Code 5. Specification of complete process model in PyMC.
graphic file with name pcbi.1009223.e103.jpg

After the PyMC process model was defined, its parameters were estimated by MCMC as described in Section 3.2.6. Two-dimensional marginals of the posterior samples obtained from MCMC sampling are shown in Fig 12 for two replicates and in S2 Fig for the whole dataset.

Fig 12. Parameter correlations, data and posterior distributions of growth curves.

Fig 12

Each kernel density estimate (KDE) in the top half shows a 2-dimensional cross section of the full posterior, visualizing correlations between some of the model parameters. For example, the topmost KDE shows that the posterior samples of Foffset,D04 are correlated with X0,μ. Axis labels correspond to the lower and upper bound of 90% HDIs. The large pair plot shows just the marginals that are relevant for the replicates D04 and D06, whereas the small pair plot shows the dimensions for all parameters (high resolution in S2 Fig). In the bottom half of the figure, the kinetics of replicates D04 and D06 are drawn. The red (substrate) and green (biomass) densities correspond to the distribution of predictions obtained from posterior samples, as described in Section 3.2.7. The red violins visualize the posterior inferred from single glucose measurement responses without the use of the process model. Likewise, the green vertical bars on the biomass concentrations show the 90% HDI.

The pair plot visualization of the posterior reveals that some model parameters are strongly correlated with each other. Among those strong correlations are the pair of initial substrate concentration S0 and biomass yield YXS. Interestingly, correlations were found even in the very narrow HDIs of X0,well and μmax, which is particularly clear for replicate D06. An interpretation is that when the initial biomass concentration is estimated at a smaller value, the maximum growth rate of cells must be higher to reach the same biomass level. The correlation is thus a natural consequence of the underlying process. Similarly, a lower initial substrate concentration results in a higher yield.

From a modeling point of view, the plot reveals how identifiable the model parameters are from the data. Furthermore, strong correlations, as observed for YXS and S0, can be problematic for some optimization or MCMC sampling algorithms. In this case, the applied algorithm DE-Metropolis-Z [51] proved beneficial to sample the 32-dimensional parameter space with highly correlated parameters (Fig 12, top right). Interestingly, the strength of the correlation depends on the amount of data that was available for a particular replicate (S1 File). The more data available, the stronger the correlation between X0 and μmax; this can also be observed for wells D04 and D06. The parameter estimates by MCMC are also tabulated in S1 Table.

In the lower part of Fig 12, the observations as well as model predictions with parameters sampled from the posterior are shown. Each line in the density plot corresponds to one set of parameters sampled with the MCMC algorithm. The small width of the density bands express how well the parameters could be estimated from the data, which is in accordance to the pair plot above. The violins around the substrate data visualize the uncertainty of glucose concentration inferred with the calibration model alone, instead of using the process model with all evidence. The violin is wider than the posterior band from the process model accordingly. Similar to the the MLE results, it becomes obvious that the Monod model estimate is well-suited to describe the biological dataset. With calibr8 and murefi, building and sampling the Bayesian model needs a similar effort as MLE and the user can focus on structural requirements rather than cumbersome implementation. To assess the benefits of the Bayesian model in more detail, the role of different calibration models, the residuals and the hierarchical parameter X0 are investigated in more detail in the next section.

4.2.4 Process and model insight through Bayesian uncertainty quantification

From the process model fit and the uncertainty estimates in particular, one can draw conclusions about the choice of model and the underlying biological process. First, to emphasize that the elaborate non-linear calibration model was required, we compare the process model fits obtained with a non-linear versus a linear calibration model. The more traditional linear biomass/backscatter correlation was fitted to calibration data as described in Section 3.1.5 and used to fit the D06 replicate from our dataset. For comparison, the asymmetric logistic calibration model from Section 4.1.1 was used to estimate parameters of the same process model and data.

On a first glance, the fit of the Monod process model using the linear biomass calibration model looks like a good description of the data (Fig 13A), but does not hold up to closer inspection. The residual plots (Fig 13B and 13C) reveal that using the linear calibration model results in systematically larger residuals of the process model compared to using the logistic calibration model. A thorough inspection of the linear calibration model itself (Fig 13D) also reveals that it already has a lack-of-fit of the location parameter (green line), similar to the depiction in Fig 3. We would like to point out that also the maximum growth rate estimated from a process model with linear biomass/backscatter calibration (HDIμmax90%=[0.480,0.530]) is systematically overestimated compared to the one with the logistic model (HDIμmax90%=[0.414,0.423]). Regarding the choice of calibration model for the biomass/backscatter relationship, we conclude that the linear model should no longer be used, as it results in biased parameter estimates.

Fig 13. Comparison of Monod model fit with linear error model.

Fig 13

Two Monod kinetic process models were fitted to the same observations from culture well D06 utilizing either a linear calibration model for the biomass/backscatter relationship (orange in A, calibration in D) or the previously established logistic model (blue in A). In A the posterior distribution of backscatter observations (density bands) is overlaid with actual backscatter observations. A linear calibration (D) model with fixed intercept (Section 3.1.5) was fitted to the subset of calibration data points up to 15gL such that it covers the range of biomass concentrations expected in the experiment. Residual plots of the observations compared to the posterior predictive distribution of backscatter observations (B, C) show that the fit obtained with the logistic calibration model (blue) has much less lack-of-fit compared to the one with the linear model (orange). Note that the backscatter residuals of ±1% are small compared to the amplitude of the absolute values going from close to 0 to approximately 20. The discrepancy between the two models is also evident from the 90% HDI of the maximum growth rate μmax of [0.414, 0.423] h−1 in the logistic and [0.480, 0.530] h−1 in the linear case.

Having chosen a suitable calibration model for the variables, the choice of the Monod model itself can be investigated. Fig 14 shows the high-resolution biomass data and predictions from MCMC on a logarithmic y-scale (Fig 14A) as well as the residuals in backscatter units (Fig 14B). In the left subplot, the data was transformed to biomass concentrations with the logistic biomass calibration model. The orange intervals represent the HDIbiomass90% inferred from a single observation using only the calibration model. In contrast, the blue density represents the posterior of the process model, which contains all observations. Naturally, the posterior from all evidence, combined through the process model, is much narrower than the posterior from any single observation. The plot reveals that the exponential growth assumed by the Monod model is generally suitable for the growth on glucose, since the blue density is describing the trend of observations well.

Fig 14. Predictions, observations and residuals of Monod model fitted to backscatter data.

Fig 14

A: Through a logarithmic y-axis, the plot A shows that both process model (blue density) and the HDIbiomass90% obtained from the biomass calibation model with individual observations (orange) describe an exponentially increasing biomass concentration up to approximately 9 hours. B: The residuals between prediction and observed backscatter (black) and the posterior predictive backscatter distribution (green density) show that the lack-of-fit is consistently less than ±0.25 backscatter units with the exception of a fluctuation at the time of substrate depletion.

To evaluate a lack-of-fit, the residual plot (Fig 14B) should be considered. Here, the residuals between the process model posterior and the observed backscatter are shown in black, the respective posterior predictive distribution of measurement responses (Section 3.2.3) is shown in green. The posterior predictive is the distribution of measurement responses that the model predicts. First, biomass concentrations are drawn from the posterior distribution. At each biomass concentration, another sample is taken from the Student-t distribution predicted by the biomass calibration model.

A large deviation that cannot be explained with the uncertainty of the estimate can be observed after 8 hours. Looking at the data, e.g. in Section 4.2.4, it can be seen that it accounts for the previously described overshoot of the backscatter signal at the beginning of the stationary phase (Section 4.2.2). This phenomenon cannot be explained by the Monod model, which assumes a constant biomass concentration after substrate depletion. Further investigations are needed to identify whether the change is morphological, e.g. a shrinking of cells due to carbon source depletion, or a decrease of biomass, e.g. by cell lysis.

Before 8 hours, an s-shaped systematic deviation can be observed, meaning that the observations first lie above and then below the prediction. Apart from the influence of the overshoot, which distorts the fit, this might be explained by a different growth rate. It was previously shown that C. glutamicum exhibits a higher specific growth rate on protocatechuic acid (PCA), which is a component of the cultivation medium CGXII [67]. Upon depletion of PCA after the first hours of cultivation, the growth rate decreases accordingly. This is not accounted for in the Monod kinetics, which describe an effectively constant growth rate at substrate concentrations much higher than the KS value. To cover this effect, PCA must be measured, e.g. by sampling and liquid chromatography, and a more elaborate process models with several substrates must be utilized. Nevertheless, the very simple Monod kinetics describe the overall growth behaviour well and residuals are low.

In Fig 11, we have seen that the time differences in the exponential phases between replicates are well explained by the well-wise initial biomass concentrations X0. The choice of a hierarchical process models is further evaluated in Fig 15, which shows the estimated X0 with uncertainties for all replicates. For replicates with more evidence (longer time series), the posterior probability for their initial biomass concentration is concentrated in a narrow interval, whereas X0 in wells with little evidence was estimated with considerably more uncertainty. The posterior for the group mean X0,μ is concentrated at HDIX0,μ90%=[0.251,0.286]gL, close to the theoretical concentration (0.25gL) expected from the experimental design.

Fig 15. Posterior group mean and well-specific initial biomass concentrations X0.

Fig 15

Variability between the growth curves in separate wells is described by well-specific initial biomass concentrations X0,well. Their posterior probability distribution is wide if the well was sacrificed early (left) and narrows down with the number of observed time points (right). Their common hyperprior (a.k.a group mean prior) X0,μ for the mean of each X0,well was updated to a posterior with HDIX0,μ90%=[0.250,0.288]gL.

Overall, the well-wise modeling of initial biomass concentrations as well as the separate modeling of replicates allowed us to account for inevitable differences between wells, while inferring the key process model parameters from all data. The combination of calibr8 and murefi made it possible to construct a process models of our application example with little code and apply both optimization (MLE) and Bayesian inference (MCMC) without needing to change any implementation details (Box 4 Code 4, Box 5 Code 5). Our application example showed that Bayesian inference with ODE-based process models to 28 parallel cultures with hundreds of observations is not only technically feasible, but also accessible without deep understanding of probabilistic programming frameworks.

As implied in the famous quote by George E.P. Box—“All models are wrong, but some are useful.”—also our Monod kinetics process model does not describe every aspect of the data, but is a powerful tool to quantify key process parameters under uncertainty. From its (in)accuracies, we can gain insight into the bioprocess and generate new hypotheses about the biological process or measurement system that are yet to be understood. In our case, the uncertainty quantification of process model parameters can become the cornerstone of bioprocess development by facilitating robust and intuitive statistical analysis or Bayesian decision-making.

4.3 Comparison with existing modeling software

A multitude of statistical software tools exist, many of which can be used for data analyses similar to the ones presented in this work. The technical complexity of performing such analyses, however, depends strongly on the technical capabilities of the software package. A comparison to relevant packages with similar scope and use-cases is given in Table 2.

Table 2. Comparison with related software packages.

DSL: Domain-Specific Language, GUI: Graphical User Interface.

User interfaces Modularity of likelihood model Required expertise MCMC ODE model construction License
murefi, calibr8 Python Modular Low Yes, with auto-diff Templated AGPLv3
PyMC [53] Python Manual Medium Yes, with auto-diff Manual Apache 2.0
COPASI, PyCoTools3 [16, 17] GUI, Python No Medium No Templated Artistic 2.0, LGPL
Data2Dynamics [14] MATLAB, DSL Manual Medium Yes Manual Not specified
PESTO [15] MATLAB Manual High Yes Manual BSD-3
pyPESTO Python Manual High Yes SBML, PETab BSD-3
Stan [55] DSL Manual High Yes, with auto-diff Manual BSD-3
brms [69] R, Formula-based Modular Low Yes, with auto-diff N/A GPLv2
JMP [70] GUI, HTTP (plugin) No Medium No N/A Propri-etary

For higher-throughput analyses and flexibility in the data analysis workflow, the user interface of statistical analysis software is particularly important. Most tools provide interfaces for popular scripting languages such as Python, R or MATLAB, but the model definition is in some cases delegated to a domain-specific programming language (DSL). For a broad application of calibration models, it is important that they are modular. Software like COPASI considers calibration only in the context of the ODE model and likelihoods cannot be customized. With modeling toolboxes such as Data2Dynamics or PESTO, custom calibration models and likelihoods can be realized, but they must be implemented manually as part of the objective function. This does not only require advanced expertise, but is also more error prone than working with a PPL directly.

pyPESTO, the unpublished Python implementation of PESTO, allows for customized noise models using the PETab data format [71] for model definition. However, PETab is currently limited to Normal- or Laplace-distributed noise [72]. Moreover, a straight-forward ODE implementation is not supported in pyPESTO at the time of publication. Instead, it requires the use of AMICI [73] via PETab or SBML or manual implementation up to the objective function. In contrast, calibr8 separates calibration modeling entirely from the process modeling workflow, thereby becoming a valuable toolbox for calibration tasks even without process modeling.

murefi allows the practitioner to directly formulate ODE models without the need to manually provide the Hessian or derivative. For compatibility, a murefi objective, which returns a scalar tensor variable, might be used as an Aesara objective in pyPESTO to access its functionalities. Together with calibr8, this modular design allows to seamlessly use custom likelihood models in advanced ODE process models, a feature that we have not found with other software.

An important criterion for usability of calibration software is the required expertise. Packages that implement the foundations of model construction, auto-differentiation and definition of probability densities reduce the mathematical complexity and allow users with little technical expertise to perform advanced statistical analyses. calibr8 and murefi are beginner-friendly, which is also evident from the simplicity of code examples [22, 49] compared to other tools [74, 75].

Bayesian analysis through MCMC methods is available through most modeling packages. Efficient, gradient-based state-of-the-art MCMC algorithms however are only readily available with probabilistic programming languages such as PyMC or Stan because they provide the necessary auto-differentiation of models. Finally, experimental replicates or hierarchical structures require replication and nesting of ODE models. Instead of manually expanding the differential equation system to match these requirements, templating approaches as they are used in murefi or COPASI can facilitate rapid model construction.

Concerning the accessibility for the systems biology research community, the recently published PETab data format, although currently limited to SBML models, is an interesting directive towards standardization of parameter estimation problems. However, PETab is a text file format specification and its functionalities are therefore limited to, for example, noise distributions that were included in the specification. Furthermore, it combines functionality that we deliberately split into two packages because we found calibration models to be much more generalizable. In the design of calibr8 and murefi we chose to not specify a data file format, but in contrast implement modeling libraries that can be extended at run time, thus enabling practitioners to use custom noise distributions as shown in our documentation [22]. Another extension at runtime could be the export of a calibr8 model to a PETab file, but the current PETab specification would constrain the calibration model to univariate inputs and untransformed, log, or log10 Normal or Laplace noise distributions. The separation between calibration and process models also enables greater modeling flexibility, as demonstrated by the hierarchical prior in Box 5 Code 5 or the hierarchical calibration example in the calibr8 documentation [22].

5 Conclusions

In this paper, we introduced the general concept of calibration models and presented calibr8, an object-oriented Python toolbox that is applicable to both analytical calibration and inference of process models. Our open-source software allows to easily implement and analyze calibration models by providing a number of convenience functions, for example an asymmetric logistic function with an intuitive parametrization and a function to obtain the most important diagnostic plots in one line of code. It thus gives users without a background in statistics access to quantitative linear and non-linear calibration models, as well as Bayesian uncertainty quantification. Furthermore, the implementation through a suite of extendable Python classes allows advanced modelers to customize the technique to a variety of applications. In comparison to existing software, the unique combination of modular likelihood functions from calibr8 with objectives and (hierarchical) datasets from murefi enables a fully Bayesian, Pythonic approach to calibration and process modeling that could so far only be achieved by cumbersome manual implementation or combination of various libraries.

In our work, we demonstrated how the versatile asymmetric logistic calibration model can be applied to bioanalytical calibration tasks. Furthermore, we showed how combining the concept of calibration models with process models allows to gain process insight into a biological process. Especially in combination with murefi, our package to set up multi-replicate models, calibr8 is suitable for high-throughput experimentation because of the flexible interface that allows to analyze data via optimization or MCMC. Uncertainty quantification is covered within the scope of the toolbox and enables easy identification of critical parameters. By making Bayesian inference of ODE models easy to implement, calibr8 and murefi bridge the gap between bioprocess modeling and an entire portfolio of methods, such as Bayesian model comparison or decision-making.

Well-chosen calibration models eradicate the effect of systematic errors in measurements and allow the practitioner to focus a data analysis on the underlying process. In our application example, the non-linear biomass calibration model was required to identify lack-of-fit in the Monod model based on growth behaviour alone. We also identified the biomass overshoot at the beginning of the stationary phase as an interesting target for further investigation, e.g. by automated microscopy of cells during cultivation.

calibr8 greatly reduces the workload of calibration tasks. For example, the systematic, model-based approach allows the user to quantify batch effects between calibration experiments; repetition of calibration measurements could thus be highly reduced. With calibr8, we provide a versatile toolbox that we believe to be beneficial not only for the biotechnology community, but for various calibration tasks in experimental sciences.

Supporting information

S1 Fig. Comparison of Normal vs. Student-t (log) probability density functions.

In the left chart, the probability density function (PDF) of a Normal distribution, as well as two Student-t distributions with varying degree of freedom (ν) are shown. Both distributions are parametrized by a location parameter μ that is equal to the mean and mode of these distributions. In addition to μ, the Normal is parametrized by its standard deviation parameter σ, influencing the spread of the distribution. In contrast, the Student-t distribution has two spread parameters {scale, ν} and is characterized by more probability mass in the tails of the PDF, not approaching 0 as quickly as the PDF of the Normal. With increasing ν, the Student-t distribution becomes more similar to the Normal distribution. The log probability density (right) of the Normal distribution accelerates has a quadratic dependency on the distance to the mean, whereas the log-PDF of the Student-t distribution does not go to extreme values as quickly. Because of this property, the Student-t distribution causes less numerical problems at extreme values.

(PDF)

S2 Fig. Pair plot of marginal posterior distribution.

Axis labels mark the 90% HDI and subplot axis limits are set at the 98% HDI. Units are h−1 for μmax, gglucosegbiomass for YXS and gL for S0 and X0.

(PDF)

S1 File. Reparametrization of asymmetric logistic function.

(PDF)

S2 File. Mathematical notation of calibration models.

(PDF)

S3 File. Implementation, planning and saving of calibrations.

(PDF)

S4 File. Parameter mapping for fitting of Monod kinetics.

(PDF)

S1 Table. Parameter estimates from MLE and MCMC.

Maximum likelihood estimates, posterior sample means, standard deviation, HDI interval and R^ statistic.

(XLSX)

Acknowledgments

First developments of data structures for multi-replicate modeling were made by Michael Osthege in the Theoretical Systems Biology group of Prof. Roland Eils at the German Cancer Research Center under the supervision of Dr. Stefan Kallenberger.

Data Availability

All relevant data are within the manuscript and its Supporting information files. The code of our software packages as well as detailed documentation with application examples are provided to the readership (https://github.com/JuBiotech, https://murefi.readthedocs.io, https://calibr8.readthedocs.io) to enable straightforward dissemination in the scientific community.

Funding Statement

This work was funded by the German Federal Ministry of Education and Research (BMBF, https://www.bmbf.de/) as part of the project "Digitalization In Industrial Biotechnology", DigInBio (Grant No. 031B0463A) and MOld received this funding to support the PhD thesis of MO. Further funding was received from the Enabling Spaces Program "Helmholtz Innovation Labs" of the German Helmholtz Association (https://www.helmholtz.de/) to support the "Microbial Bioprocess Lab – A Helmholtz Innovation Lab" and MOld received this funding to support the PhD thesis of LH. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

References

  • 1.Agency EM. Guideline on bioanalytical method validation; 2015. Available from: https://www.ema.europa.eu/en/bioanalytical-method-validation.
  • 2.U.S. Department of Health and Human Services, Food and Drug Administration, Center for Drug Evaluation and Research, Center for Veterinary Medicine. Bioanalytical Method Validation—Guidance for Industry; 2018. Available from: https://www.fda.gov/media/70858/download.
  • 3. Raposo F. Evaluation of analytical calibration based on least-squares linear regression for instrumental techniques: A tutorial review. TrAC Trends in Analytical Chemistry. 2016;77:167–185. doi: 10.1016/j.trac.2015.12.006 [DOI] [Google Scholar]
  • 4. Findlay JWA, Smith WC, Lee JW, Nordblom GD, Das I, DeSilva BS, et al. Validation of immunoassays for bioanalysis: a pharmaceutical industry perspective. Journal of pharmaceutical and biomedical analysis. 2000;21(6):1249–1273. doi: 10.1016/S0731-7085(99)00244-7 [DOI] [PubMed] [Google Scholar]
  • 5. DeSilva B, Smith W, Weiner R, Kelley M, Smolec J, Lee B, et al. Recommendations for the bioanalytical method validation of ligand-binding assays to support pharmacokinetic assessments of macromolecules. Pharmaceutical research. 2003;20(11):1885–1900. doi: 10.1023/B:PHAM.0000003390.51761.3d [DOI] [PubMed] [Google Scholar]
  • 6. Jani D, Allinson J, Berisha F, Cowan KJ, Devanarayan V, Gleason C, et al. Recommendations for use and fit-for-purpose validation of biomarker multiplex ligand binding assays in drug development. The AAPS journal. 2016;18(1):1–14. doi: 10.1208/s12248-015-9820-y [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7. Cogan EB, Birrell GB, Griffith OH. A robotics-based automated assay for inorganic and organic phosphates. Analytical biochemistry. 1999;271(1):29–35. doi: 10.1006/abio.1999.4100 [DOI] [PubMed] [Google Scholar]
  • 8. Unthan S, Radek A, Wiechert W, Oldiges M, Noack S. Bioprocess automation on a Mini Pilot Plant enables fast quantitative microbial phenotyping. Microbial cell factories. 2015;14(1):32. doi: 10.1186/s12934-015-0216-6 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Knepper A, Heiser M, Glauche F, Neubauer P. Robotic platform for parallelized cultivation and monitoring of microbial growth parameters in microwell plates. Journal of laboratory automation. 2014;19(6):593–601. doi: 10.1177/2211068214547231 [DOI] [PubMed] [Google Scholar]
  • 10.International Bureau of Weights and Measures. International vocabulary of metrology—Basic and general concepts and associated terms; 2008. Available from: https://www.bipm.org/utils/common/documents/jcgm/JCGM_200_2008.pdf.
  • 11. Hoekstra R, Morey RD, Rouder JN, Wagenmakers EJ. Robust misinterpretation of confidence intervals. Psychonomic bulletin & review. 2014;21(5):1157–1164. doi: 10.3758/s13423-013-0572-3 [DOI] [PubMed] [Google Scholar]
  • 12. Greenland S, Senn SJ, Rothman KJ, Carlin JB, Poole C, Goodman SN, et al. Statistical tests, P values, confidence intervals, and power: a guide to misinterpretations. European journal of epidemiology. 2016;31(4):337–350. doi: 10.1007/s10654-016-0149-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13. Edwards W, Lindman H, Savage LJ. Bayesian statistical inference for psychological research. Psychological review. 1963;70(3):193. doi: 10.1037/h0044139 [DOI] [Google Scholar]
  • 14. Raue A, Steiert B, Schelker M, Kreutz C, Maiwald T, Hass H, et al. Data2Dynamics: a modeling environment tailored to parameter estimation in dynamical systems. Bioinformatics. 2015;31(21):3558–3560. doi: 10.1093/bioinformatics/btv405 [DOI] [PubMed] [Google Scholar]
  • 15. Stapor P, Weindl D, Ballnus B, Hug S, Loos C, Fiedler A, et al. PESTO: parameter estimation toolbox. Bioinformatics. 2018;34(4):705–707. doi: 10.1093/bioinformatics/btx676 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16. Welsh CM, Fullard N, Proctor CJ, Martinez-Guimera A, Isfort RJ, Bascom CC, et al. PyCoTools: a Python toolbox for COPASI. Bioinformatics. 2018;34(21):3702–3710. doi: 10.1093/bioinformatics/bty409 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17. Hoops S, Sahle S, Gauges R, Lee C, Pahle J, Simus N, et al. COPASI—a complex pathway simulator. Bioinformatics. 2006;22(24):3067–3074. doi: 10.1093/bioinformatics/btl485 [DOI] [PubMed] [Google Scholar]
  • 18. Vail SV, Valavanis S. Econometrics: An Introduction to Maximum Likelihood Methods. McGraw-Hill; 1959. [Google Scholar]
  • 19. van de Schoot R, Depaoli S, King R, Kramer B, Märtens K, Tadesse MG, et al. Bayesian statistics and modelling. Nature Reviews Methods Primers. 2021;1(1):1–26. doi: 10.1038/s43586-020-00001-2 [DOI] [Google Scholar]
  • 20. Fröhlich F, Loos C, Hasenauer J. Scalable inference of ordinary differential equation models of biochemical processes. In: Gene Regulatory Networks. Springer; 2019. p. 385–422. [DOI] [PubMed] [Google Scholar]
  • 21. Maier C, Loos C, Hasenauer J. Robust parameter estimation for dynamical systems from outlier-corrupted data. Bioinformatics. 2017;33(5):718–725. [DOI] [PubMed] [Google Scholar]
  • 22.calibr8 Documentation. Available from: https://calibr8.readthedocs.io.
  • 23.Säilynoja T, Bürkner PC, Vehtari A. Graphical Test for Discrete Uniformity and its Applications in Goodness of Fit Evaluation and Multiple Sample Comparison. arXiv preprint arXiv:210310522. 2021.
  • 24. Kensy F, Zang E, Faulhammer C, Tan RK, Büchs J. Validation of a high-throughput fermentation system based on online monitoring of biomass and fluorescence in continuously shaken microtiter plates. Microbial Cell Factories. 2009;8(1):31. doi: 10.1186/1475-2859-8-31 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25. Kinoshita S, Nakayama K, Akita S. Taxonomical Study of Glutamic Acid Accumulating Bacteria, Micrococcus glutamicus nov. sp. Journal of the Agricultural Chemical Society of Japan. 1958;22(3):176–185. [Google Scholar]
  • 26.Osthege M, Helleckes L. JuBiotech/robotools: v1.0.0; 2021. Available from: 10.5281/zenodo.4697606. [DOI]
  • 27. Osthege M, Tenhaef N, Zyla R, Mueller C, Hemmerich J, Wiechert W, et al. bletl-A Python package for integrating microbioreactors in the design-build-test-learn cycle. Engineering in Life Sciences. 2022. 10.1002/elsc.202100108 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Salvatier J, Wiecki T, Patil A, Kochurov M, Engels B, Lao J, et al. pymc-devs/pymc3: PyMC3 3.11.2 (14 March 2021); 2021. Available from: 10.5281/zenodo.4603971. [DOI]
  • 29. Kumar R, Carol C, Hartikainen A, Martin O. ArviZ a unified library for exploratory analysis of Bayesian models in Python. Journal of Open Source Software. 2019;4(33):1143. doi: 10.21105/joss.01143 [DOI] [Google Scholar]
  • 30. Biscani F, Izzo D. A parallel global multiobjective framework for optimization: pagmo. Journal of Open Source Software. 2020;5(53):2338. doi: 10.21105/joss.02338 [DOI] [Google Scholar]
  • 31. Hunter JD. Matplotlib: A 2D graphics environment. Computing in Science & Engineering. 2007;9(3):90–95. doi: 10.1109/MCSE.2007.55 [DOI] [Google Scholar]
  • 32. Harris CR, Millman KJ, van der Walt SJ, Gommers R, Virtanen P, Cournapeau D, et al. Array programming with NumPy. Nature. 2020;585(7825):357–362. doi: 10.1038/s41586-020-2649-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Wes McKinney. Data Structures for Statistical Computing in Python. In: Stéfan van der Walt, Jarrod Millman, editors. Proceedings of the 9th Python in Science Conference; 2010. p. 56–61.
  • 34.pandas development team T. pandas-dev/pandas: Pandas; 2020. Available from: 10.5281/zenodo.3509134. [DOI]
  • 35. Virtanen P, Gommers R, Oliphant TE, Haberland M, Reddy T, Cournapeau D, et al. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods. 2020;17:261–272. doi: 10.1038/s41592-019-0686-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Data and code to the paper “Bayesian calibration, process modeling and uncertainty quantification in biotechnology”;. Available from: https://github.com/JuBiotech/calibr8-paper. [DOI] [PMC free article] [PubMed]
  • 37.Osthege M, Helleckes L. JuBiotech/calibr8: v6.2.0; 2021. Available from: 10.5281/zenodo.5721015. [DOI]
  • 38.Helleckes L, Osthege M. JuBiotech/murefi: v5.0.0; 2020. Available from: 10.5281/zenodo.4652910. [DOI]
  • 39. Gottschalk PG, Dunn JR. The five-parameter logistic: A characterization and comparison with the four-parameter logistic. Analytical Biochemistry. 2005;343(1):54–65. doi: 10.1016/j.ab.2005.04.035 [DOI] [PubMed] [Google Scholar]
  • 40. Szparaga A, Kocira S. Generalized logistic functions in modelling emergence of Brassica napus L. PLOS ONE. 2018;13(8):1–14. doi: 10.1371/journal.pone.0201980 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41.Wikipedia contributors. Generalised logistic function—Wikipedia, The Free Encyclopedia; 2020. https://en.wikipedia.org/w/index.php?title=Generalised_logistic_function&oldid=945474789.
  • 42. Meurer A, Smith CP, Paprocki M, Čertík O, Kirpichev SB, Rocklin M, et al. SymPy: symbolic computing in Python. PeerJ Computer Science. 2017;3:e103. doi: 10.7717/peerj-cs.103 [DOI] [Google Scholar]
  • 43.Willard BT, Osthege M, Ho G, RicardoV94, Wiecki T, Foreman-Mackey D, et al. pymc-devs/aesara:; 2021. Available from: 10.5281/zenodo.4635498. [DOI]
  • 44. Baydin AG, Pearlmutter BA, Radul AA, Siskind JM. Automatic Differentiation in Machine Learning: A Survey. J Mach Learn Res. 2017;18(1):5595–5637. [Google Scholar]
  • 45.Seyboldt A, Störiko A, Osthege M, Widmer L. aseyboldt/sunode v0.1.2; 2020. Available from: 10.5281/zenodo.4058330. [DOI]
  • 46. Hindmarsh AC, Brown PN, Grant KE, Lee SL, Serban R, Shumaker DE, et al. SUNDIALS: Suite of Nonlinear and Differential/Algebraic Equation Solvers. ACM Trans Math Softw. 2005;31(3):363–396. doi: 10.1145/1089014.1089020 [DOI] [Google Scholar]
  • 47.The HDF Group. Hierarchical Data Format, version 5; 1997.
  • 48.Collette A. Python and HDF5. O’Reilly; 2013.
  • 49.murefi Documentation;. Available from: https://murefi.readthedocs.io.
  • 50. Metropolis N, Rosenbluth AW, Rosenbluth MN, Teller AH, Teller E. Equation of State Calculations by Fast Computing Machines. The Journal of Chemical Physics. 1953;21(6):1087–1092. doi: 10.1063/1.1699114 [DOI] [Google Scholar]
  • 51. ter Braak CJF, Vrugt JA. Differential Evolution Markov Chain with snooker updater and fewer chains. Statistics and Computing. 2008;18(4):435–446. doi: 10.1007/s11222-008-9104-9 [DOI] [Google Scholar]
  • 52. Hoffman MD, Gelman A. The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research. 2014;15(47):1593–1623. [Google Scholar]
  • 53. Salvatier J, Wiecki TV, Fonnesbeck C. Probabilistic programming in Python using PyMC3. PeerJ Computer Science. 2016;2:e55. doi: 10.7717/peerj-cs.55 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 54. Bingham E, Chen JP, Jankowiak M, Obermeyer F, Pradhan N, Karaletsos T, et al. Pyro: Deep Universal Probabilistic Programming. Journal of Machine Learning Research. 2018. [Google Scholar]
  • 55. Carpenter B, Gelman A, Hoffman M, Lee D, Goodrich B, Betancourt M, et al. Stan: A Probabilistic Programming Language. Journal of Statistical Software, Articles. 2017;76(1):1–32. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.Dillon JV, Langmore I, Tran D, Brevdo E, Vasudevan S, Moore D, et al. TensorFlow Distributions; 2017.
  • 57. Foreman-Mackey D, Hogg DW, Lang D, Goodman J. emcee: the MCMC hammer. Publications of the Astronomical Society of the Pacific. 2013;125(925):306. doi: 10.1086/670067 [DOI] [Google Scholar]
  • 58. Braak CJFT. A Markov Chain Monte Carlo version of the genetic algorithm Differential Evolution: easy Bayesian computing for real parameter spaces. Statistics and Computing. 2006;16(3):239–249. doi: 10.1007/s11222-006-8769-1 [DOI] [Google Scholar]
  • 59.Murray I, Adams R, MacKay D. Elliptical slice sampling. In: Teh YW, Titterington M, editors. Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. vol. 9 of Proceedings of Machine Learning Research. Chia Laguna Resort, Sardinia, Italy: PMLR; 2010. p. 541–548. Available from: http://proceedings.mlr.press/v9/murray10a.html.
  • 60. Findlay JWA, Dillard RF. Appropriate calibration curve fitting in ligand binding assays. The AAPS journal. 2007;9(2):E260–E267. doi: 10.1208/aapsj0902029 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 61. Azadeh M, Gorovits B, Kamerud J, MacMannis S, Safavi A, Sailstad J, et al. Calibration curves in quantitative ligand binding assays: recommendations and best practices for preparation, design, and editing of calibration curves. The AAPS journal. 2018;20(1):22. doi: 10.1208/s12248-017-0159-4 [DOI] [PubMed] [Google Scholar]
  • 62. Hemmerich J, Noack S, Wiechert W, Oldiges M. Microbioreactor Systems for Accelerated Bioprocess Development. Biotechnology Journal. 2018;13(4):1700141. doi: 10.1002/biot.201700141 [DOI] [PubMed] [Google Scholar]
  • 63. Eggeling L, Bott M. Handbook of Corynebacterium glutamicum. CRC press; 2005. [Google Scholar]
  • 64. Monod J. The Growth of Bacterial Cultures. Annual Review of Microbiology. 1949;3(1):371–394. doi: 10.1146/annurev.mi.03.100149.002103 [DOI] [Google Scholar]
  • 65. Senn H, Lendenmann U, Snozzi M, Hamer G, Egli T. The growth of Escherichia coli in glucose-limited chemostat cultures: a re-examination of the kinetics. Biochimica et Biophysica Acta (BBA)—General Subjects. 1994;1201(3):424—436. doi: 10.1016/0304-4165(94)90072-8 [DOI] [PubMed] [Google Scholar]
  • 66. Hemmerich J, Tenhaef N, Steffens C, Kappelmann J, Weiske M, Reich SJ, et al. Less Sacrifice, More Insight: Repeated Low-Volume Sampling of Microbioreactor Cultivations Enables Accelerated Deep Phenotyping of Microbial Strain Libraries. Biotechnology Journal. 2019;14(9):1800428. doi: 10.1002/biot.201800428 [DOI] [PubMed] [Google Scholar]
  • 67. Unthan S, Grünberger A, van Ooyen J, Gätgens J, Heinrich J, Paczia N, et al. Beyond growth rate 0.6: What drives Corynebacterium glutamicum to higher growth rates in defined medium. Biotechnology and bioengineering. 2014;111(2):359–371. doi: 10.1002/bit.25103 [DOI] [PubMed] [Google Scholar]
  • 68.Betancourt M. Hierarchical Modeling; 2020. Available from: https://betanalpha.github.io/assets/case_studies/hierarchical_modeling.html.
  • 69. Bürkner PC. brms: An R package for Bayesian multilevel models using Stan. Journal of statistical software. 2017;80(1):1–28. [Google Scholar]
  • 70.Institute S. JMP;. Available from: https://www.jmp.com.
  • 71. Schmiester L, Schälte Y, Bergmann FT, Camba T, Dudkin E, Egert J, et al. PEtab—Interoperable specification of parameter estimation problems in systems biology. PLoS computational biology. 2021;17(1):e1008646. doi: 10.1371/journal.pcbi.1008646 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 72.PETab Documentation;. Available from: https://petab.readthedocs.io.
  • 73. Fröhlich F, Weindl D, Schälte Y, Pathirana D, Paszkowski Ł, Lines GT, et al. AMICI: High-Performance Sensitivity Analysis for Large Ordinary Differential Equation Models. Bioinformatics. 2021. doi: 10.1093/bioinformatics/btab227 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 74.PyCoTools Documentation;. Available from: https://pycotools3.readthedocs.io.
  • 75.d2d Examples;. Available from: https://github.com/Data2Dynamics/d2d/tree/master/arFramework3/Examples.
PLoS Comput Biol. doi: 10.1371/journal.pcbi.1009223.r001

Decision Letter 0

Dina Schneidman-Duhovny

13 Oct 2021

Dear Professor Oldiges,

Thank you very much for submitting your manuscript "Bayesian calibration, process modeling and uncertainty quantification in biotechnology" for consideration at PLOS Computational Biology.

As with all papers reviewed by the journal, your manuscript was reviewed by members of the editorial board and by several independent reviewers. In light of the reviews (below this email), we would like to invite the resubmission of a significantly-revised version that takes into account the reviewers' comments.

We cannot make any decision about publication until we have seen the revised manuscript and your response to the reviewers' comments. Your revised manuscript is also likely to be sent to reviewers for further evaluation.

When you are ready to resubmit, please upload the following:

[1] A letter containing a detailed list of your responses to the review comments and a description of the changes you have made in the manuscript. Please note while forming your response, if your article is accepted, you may have the opportunity to make the peer review history publicly available. The record will include editor decision letters (with reviews) and your responses to reviewer comments. If eligible, we will contact you to opt in or out.

[2] Two versions of the revised manuscript: one with either highlights or tracked changes denoting where the text has been changed; the other a clean version (uploaded as the manuscript file).

Important additional instructions are given below your reviewer comments.

Please prepare and submit your revised manuscript within 60 days. If you anticipate any delay, please let us know the expected resubmission date by replying to this email. Please note that revised manuscripts received after the 60-day due date may require evaluation and peer review similar to newly submitted manuscripts.

Thank you again for your submission. We hope that our editorial process has been constructive so far, and we welcome your feedback at any time. Please don't hesitate to contact us if you have any questions or comments.

Sincerely,

Dina Schneidman

Software Editor

PLOS Computational Biology

***********************

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: Helleckes et al describe a computational framework for the Bayesian analysis of calibration and process models. The framework is implemented in python, open-source, extensively documented implements code in a object-oriented manner. The software is tested using continues integration and coverage analysis. Overall I want to commend the authors for the quality of the presented software. The manuscript is well written and easy to understand, but may benefit from some restructuring that I will describe below. The authors evaluate the framework on multiple examples of biotechnological processes, including experimental data, where they analysis calibration models individually, as well as combinations of calibration and process models.

Major Comments

1) While most of the text is well written and easy to follow, there are some instances where it is difficult or impossible to understand the text without looking at the code or figures. Examples:

(i) Figure 3: Description of what was done is only available in figure legends, this also needs to be described in the text.

(ii) 4.1.1: It would helpful to have a mathematical description of the calibration model (provide formulas)

(iii) Figure 10: It is hard to understand what was actually done and the reader has to guess based on the figure. Describe what was done first, then the results.

2) The (unpublished) python implementation of PESTO, pyPESTO https://github.com/ICB-DCM/pyPESTO), implements a similar feature set as the murefi/calibr8 including providing an interface to pyMC3 for Bayesian analysis. Still pyPESTO implements less modularity between process model and calibration model to enable use of adjoint sensitivity analysis. Similarly, the recently proposed PEtab format (https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1008646) permits a similarly flexible specification of calibration models and multi-experiment process models (templating) in COPASI/data2dynamics/pyPESTO. Accordingly, I think it would be important to

(i) explicitely describe differences to what is possible with PEtab

(ii) demonstrate the greater flexibility by the modularity between calibr8 and murefi.

Regarding (i), I would also encourage the authors to implement support for the PEtab format and potentially propose an extension of the format based on the identified differences (I don't think these points are necessary for the scope of this review though)

Regarding (ii) I think the use of a hyperprior in Section 4.2.3 is an interesting example, but I think it would be more convincing if the nesting would be in the calibration model component and if the authors could demonstrate that joint analysis of process+calibration model is important to obtain accurate credibility intervals for parameters (by comparing stepwise sequential analysis, using synthetic data if necessary)

Am I correct in my understanding that the toolbox cannot be applied to mixed effect modeling? If I am mistaken, this would be quite convincing and a demonstration could replace point (ii).

A third way of addressing (ii) would be to demonstrate that the combination of calibr8/murefi/sunode enables the use of adjoint sensitivities (see https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1005331) with complex noise models, but I expect that this would be a lot of work

3) The description in 3.2.6 seems to imply that murefi supports sensitivity analysis which would be necessary for the computation of the posterior gradient. Looking at the code, this does not seem to be supported though, but theoretically possible with sunode. It would be helpful if the authors could more extensively describe the support of gradient computation in calibr8/murefi.

Minor Comments

a) I believe that the abstract should mention that the authors apply their methods to ODE models.

b) l244, the text just mentions calibr8, which is only introduced later in the text

c) I have a hard time understanding the issue that is supposed to be illustrated by figure 3C, could the authors describe the issue in more detail, is there some statistical test to show the issue (and is such an analysis implemented in calibr8)?

d) I find it hard to believe that gradient based optimizers did not perform well for section 3.2.5. Did the authors try using the least squares algorithm and used a logarithmic transformation of process parameters?

e) the authors may want to cite https://doi.org/10.1093/bioinformatics/btw703 in section 2.4

f) I think "Frequentist" is more commonly used than "likelihoodist" (assuming that's what the authors wanted to say).

Reviewer #2: This proposal is focused on the description of a Python package for the use of Bayesian theory for the quantification of uncertainty from high-throughput cultivation experiments. The paper is technically sound, well written and all the codes are available on a Git server. Instructions about the installation on a Python idle are clearly given.This proposal has been submitted as a “software” article. As such, the software must be either widely used within the scientific community or have the promise of wide adoption by a broad community of users. However, as it is actually written, the target audience is quite limited. Specific comments are appended below.

- The background needs to be more precisely defined. The field of expertise of the authors are “bioprocess engineering”. However, as stated in the introduction, the software could be used by any researchers handling large set of microbial (or even cell culture) kinetics data, extending the target audience to the broad community if researchers involved in fields like systems and synthetic biology. Some part of the text should then be reformulated according to this comment.

- The term “microbioreactor” is used at several stages of the manuscript. This term is actually misleading, because the authors are used a commercial minibioreactor platform based on the use of deepwell. For the readers that are not familiar with the technology, the use of the term “micro” could give the feeling that the authors are using microfluidic cultivation device. This comment is also related to the above-mentioned in the sense that the technical terms in the text should be reformulated to target a broader audience of potential users (other example: I can imagine that only a limited number of specialists know what is a flowerplate).

- At this stage, the applicability of the software is limited to a cultivation device commercialized under the name of “Biolector” and involving the use of 48-well deepwell plates. Additionally, the Biolector can be coupled to a robotic liquid handling platform for off-line sampling. The authors have to discuss the potential extension of their software to other microplate-based devices.

- Bayes theory is typically easy to explain, but it is not the case of this paper. Section 2.1 should be expanded by considering an example.

- About the applications, only two are given in the manuscript. Another, very important, application is the measurement of the activity of gene circuits based on fluorescent reporters. For this application, it is also important to relate to biomass in order to obtain specific values. How could this application integrated in the package ?

- ODE models can be integrated in the calibration procedure. Is there any limit about the number of equations/parameters that can be handled ?

Reviewer #3: In the manuscript "Bayesian calibration, process modeling and uncertainty quantification in biotechnology", Laura Marie Helleckes, Michael Osthege, and coworkers present two Python software packages, calibr8 and murefi, for enabling more reproducible and automated calibration of mathematical models in biotechnology. The authors show the capabilities of these packages on several examples with real datasets collected by themselves.

The topic of parameter inference for mathematical models of biological systems have become a very relevant topic in the recent years. This can be achieved by a frequentist perspective, finding the maximum likelihood estimate using various optimization techniques, or by a Bayesian approach, which relies on the Bayes theorem and often carried through Markov chain Monte Carlo sampling.

One of the key problems is that frequently “handmade” computational pipelines are built for each specific problem which compromises their reproducibility and reusability. Efforts in the community to build automated pipelines exist, however these can be complex and require high expertise. In this manuscript, the authors tackle this problem by introducing two new software tools for model construction and calibration, which substantially ease the process and facilitate the usage to non-experts, in particular, focusing - but not limited to - biotechnology applications. Likewise, the key contributions is the development of two reusable open-source toolboxes/libraries. Overall, the manuscript is well written. I appreciate that the authors provide exemplary notebooks/code in the respective toolboxes, but I have to admit that I did not have the time to test them.

=====

Major

=====

As far as I can see, the only available loglikelihood implemented in calibr8 assumes a Student’s t distribution. This is a bit contradictory with the statement the authors make in L.67-69 regarding the need of having more flexible frameworks. Maybe the authors could include in their toolbox additional distribution assumptions such as Laplace, Gaussian and/or log-normal, to facilitate the users this flexibility. Moreover, I do not see how the user could easily implement a different custom noise model, in case this is possible it would be great to add a tutorial.

A very well-known standard format to encode ODE models is the SBML format (https://doi.org/10.1093/bioinformatics/btg015) which is supported by many existing toolboxes for modeling and parameter estimation. Including support to this in the toolboxes here presented would substantially increase the public and potential new users to the tool. I deeply encourage the authors to add support to SBML models although not only ODE models are used within these toolboxes.

Following on the line of my previous comment: Is there a model validator? What I mean is whether is there some sort of sanity checks for user defined models in calibr8 and murefi., e.g. positivity of the modeled species. This would make even better the user experience, since then, even the level of expertise required could be lowered. I am wondering if the authors thought of this option, and whether it would be possible to include it (or at least comment on this).

- L.88: “examples are Data2Dynamics [14] or PESTO [15], ... However, both tools are implemented in MATLAB and are thus incompatible with data analysis workflows that leverage the rich ecosystem of scientific Python libraries.” I would like to make the authors aware that I could find that the toolbox PESTO has been translated into Python, going under the name of pyPESTO (https://github.com/ICB-DCM/pyPESTO). I would encourage the authors to include it into their manuscript since it has been released since January 2019 and, therefore, adapt the comparison within toolboxes.

L.177: The statement is correct. However, parameter uncertainties can also be quantified from a frequentist perspective using optimization by the so-called method profile likelihoods (see https://doi.org/10.1093/bioinformatics/btp358). I am not aware whether this is known in the field of biotechnology, but definitely something to mention in a manuscript regarding parameter estimation and uncertainty quantification. In case this is not frequently used in this field, it could be also a novelty to add in the study (although not necessary).

L.205: Could some citation be added to this statement?

L.226-227: Could some citation be added to this statement?

L.244: Please reformulate the sentence, I could not understand which restriction is meant here.

=====

Minor

=====

L.112: Without losing generality, the authors could list some specific examples of other research fields.

Figure 1: I suggest to use the same label and line style in the two subplots for the Normal case.

L.142: “From a known list of parameters …” The word “known” here could lead to misunderstanding since the parameters may be actually unknown and need to be estimated. But I understand that when simulating they are actually “known”. Maybe this sentence could be rephrased (in case of finding a better formulation).

L.158: Please clarify that each individual pair y_{obs} and y_{pred} are the same length.

Figure 3: Please indicate in the figure as legend what the blue dots and green lines are. Having this on top of the caption description will facilitate the understanding of what is depicted. Same for the black dashed line.

Figure 7: Change the color scheme → colorblind proof

L.540: To the list of known samplers, please add “emcee” which is also a very popular python sampler (https://doi.org/10.1086/670067).

Figure 12: Please increase the separation between A and B. This helps to identify the right Y axis in A.

General: Revise the text for typos.

General: Please use consistent font sizes in the figures, for some, they are really small.

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: Yes

Reviewer #2: Yes

Reviewer #3: Yes

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #2: Yes: Frank Delvigne

Reviewer #3: Yes: Elba Raimundez

Figure Files:

While revising your submission, please upload your figure files to the Preflight Analysis and Conversion Engine (PACE) digital diagnostic tool, https://pacev2.apexcovantage.com. PACE helps ensure that figures meet PLOS requirements. To use PACE, you must first register as a user. Then, login and navigate to the UPLOAD tab, where you will find detailed instructions on how to use the tool. If you encounter any issues or have any questions when using PACE, please email us at figures@plos.org.

Data Requirements:

Please note that, as a condition of publication, PLOS' data policy requires that you make available all data used to draw the conclusions outlined in your manuscript. Data must be deposited in an appropriate repository, included within the body of the manuscript, or uploaded as supporting information. This includes all numerical values that were used to generate graphs, histograms etc.. For an example in PLOS Biology see here: http://www.plosbiology.org/article/info%3Adoi%2F10.1371%2Fjournal.pbio.1001908#s5.

Reproducibility:

To enhance the reproducibility of your results, we recommend that you deposit your laboratory protocols in protocols.io, where a protocol can be assigned its own identifier (DOI) such that it can be cited independently in the future. Additionally, PLOS ONE offers an option to publish peer-reviewed clinical study protocols. Read more information on sharing protocols at https://plos.org/protocols?utm_medium=editorial-email&utm_source=authorletters&utm_campaign=protocols

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1009223.r003

Decision Letter 1

Dina Schneidman-Duhovny

16 Jan 2022

Dear Professor Oldiges,

We are pleased to inform you that your manuscript 'Bayesian calibration, process modeling and uncertainty quantification in biotechnology' has been provisionally accepted for publication in PLOS Computational Biology.

Before your manuscript can be formally accepted you will need to complete some formatting changes, which you will receive in a follow up email. A member of our team will be in touch with a set of requests. Also please address reviewer 3 comments in this submission.

Please note that your manuscript will not be scheduled for publication until you have made the required changes, so a swift response is appreciated.

IMPORTANT: The editorial review process is now complete. PLOS will only permit corrections to spelling, formatting or significant scientific errors from this point onwards. Requests for major changes, or any which affect the scientific understanding of your work, will cause delays to the publication date of your manuscript.

Should you, your institution's press office or the journal office choose to press release your paper, you will automatically be opted out of early publication. We ask that you notify us now if you or your institution is planning to press release the article. All press must be co-ordinated with PLOS.

Thank you again for supporting Open Access publishing; we are looking forward to publishing your work in PLOS Computational Biology. 

Best regards,

Dina Schneidman

Software Editor

PLOS Computational Biology

***********************************************************

Reviewer's Responses to Questions

Comments to the Authors:

Please note here if the review is uploaded as an attachment.

Reviewer #1: The authors have adequately addressed my concerns.

Still, the authors may want to consider using qq-plots to visualize differences in data/theoretical quantiles/percentiles in figure 3.

Reviewer #3: The authors have addressed the reviewer comments. The manuscript is improved. I reviewed this manuscript a second time with a closer attention to details within the text, from which I have only few minor comments.

L.17: Specify the name of the packages as done in the author summary

L.22 and L.24: the abbreviations can be introduced in the main body instead of in the abstract

L.82: “many methods assume” This is very generic, maybe list a few examples of such methods.

L.137: check for consistency style with or without italics for “Normal”, same for “Student-t” (and other words which I may have missed)

L.124: introduce here abbreviation for MLE

L.175: List some examples

L.185: previous chapter? Or previous subsection? Maybe avoid unclear references and point directly to the desired Section, e.g. “introduced in SectionX.X”

L.186: abbreviation already introduced

L.188: e.g. here Normal is without italics (check for style consistency in the whole text), same for “Bayesian inference” (see L.193 and L.124)

L.213: indeed the choice is arbitrary, however 99%, 95% and 90% are predominantly used maybe this information can be added

Figure3: Likelihood bands reported in the caption differ from those in the figure legend (A), please check which are the correct ones.

General: check for writing style of specific words in italics vs non-italics

L.301: ODE is already introduced as abbreviation

L.566: which prior assumptions?

**********

Have the authors made all data and (if applicable) computational code underlying the findings in their manuscript fully available?

The PLOS Data policy requires authors to make all data and code underlying the findings described in their manuscript fully available without restriction, with rare exception (please refer to the Data Availability Statement in the manuscript PDF file). The data and code should be provided as part of the manuscript or its supporting information, or deposited to a public repository. For example, in addition to summary statistics, the data points behind means, medians and variance measures should be available. If there are restrictions on publicly sharing data or code —e.g. participant privacy or use of data from a third party—those must be specified.

Reviewer #1: None

Reviewer #3: Yes

**********

PLOS authors have the option to publish the peer review history of their article (what does this mean?). If published, this will include your full peer review and any attached files.

If you choose “no”, your identity will remain anonymous but your review may still be made public.

Do you want your identity to be public for this peer review? For information about this choice, including consent withdrawal, please see our Privacy Policy.

Reviewer #1: No

Reviewer #3: No

PLoS Comput Biol. doi: 10.1371/journal.pcbi.1009223.r004

Acceptance letter

Dina Schneidman-Duhovny

7 Feb 2022

PCOMPBIOL-D-21-01126R1

Bayesian calibration, process modeling and uncertainty quantification in biotechnology

Dear Dr Oldiges,

I am pleased to inform you that your manuscript has been formally accepted for publication in PLOS Computational Biology. Your manuscript is now with our production department and you will be notified of the publication date in due course.

The corresponding author will soon be receiving a typeset proof for review, to ensure errors have not been introduced during production. Please review the PDF proof of your manuscript carefully, as this is the last chance to correct any errors. Please note that major changes, or those which affect the scientific understanding of the work, will likely cause delays to the publication date of your manuscript.

Soon after your final files are uploaded, unless you have opted out, the early version of your manuscript will be published online. The date of the early version will be your article's publication date. The final article will be published to the same URL, and all versions of the paper will be accessible to readers.

Thank you again for supporting PLOS Computational Biology and open-access publishing. We are looking forward to publishing your work!

With kind regards,

Livia Horvath

PLOS Computational Biology | Carlyle House, Carlyle Road, Cambridge CB4 3DN | United Kingdom ploscompbiol@plos.org | Phone +44 (0) 1223-442824 | ploscompbiol.org | @PLOSCompBiol

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    S1 Fig. Comparison of Normal vs. Student-t (log) probability density functions.

    In the left chart, the probability density function (PDF) of a Normal distribution, as well as two Student-t distributions with varying degree of freedom (ν) are shown. Both distributions are parametrized by a location parameter μ that is equal to the mean and mode of these distributions. In addition to μ, the Normal is parametrized by its standard deviation parameter σ, influencing the spread of the distribution. In contrast, the Student-t distribution has two spread parameters {scale, ν} and is characterized by more probability mass in the tails of the PDF, not approaching 0 as quickly as the PDF of the Normal. With increasing ν, the Student-t distribution becomes more similar to the Normal distribution. The log probability density (right) of the Normal distribution accelerates has a quadratic dependency on the distance to the mean, whereas the log-PDF of the Student-t distribution does not go to extreme values as quickly. Because of this property, the Student-t distribution causes less numerical problems at extreme values.

    (PDF)

    S2 Fig. Pair plot of marginal posterior distribution.

    Axis labels mark the 90% HDI and subplot axis limits are set at the 98% HDI. Units are h−1 for μmax, gglucosegbiomass for YXS and gL for S0 and X0.

    (PDF)

    S1 File. Reparametrization of asymmetric logistic function.

    (PDF)

    S2 File. Mathematical notation of calibration models.

    (PDF)

    S3 File. Implementation, planning and saving of calibrations.

    (PDF)

    S4 File. Parameter mapping for fitting of Monod kinetics.

    (PDF)

    S1 Table. Parameter estimates from MLE and MCMC.

    Maximum likelihood estimates, posterior sample means, standard deviation, HDI interval and R^ statistic.

    (XLSX)

    Attachment

    Submitted filename: response.pdf

    Data Availability Statement

    All relevant data are within the manuscript and its Supporting information files. The code of our software packages as well as detailed documentation with application examples are provided to the readership (https://github.com/JuBiotech, https://murefi.readthedocs.io, https://calibr8.readthedocs.io) to enable straightforward dissemination in the scientific community.


    Articles from PLoS Computational Biology are provided here courtesy of PLOS

    RESOURCES