Skip to main content

grpredict

The study of the growth of bacterial cultures does not constitute a specialized subject or branch of research: it is the basic method of microbiology.” Monitoring and controlling the specific growth rate should not constitute a specialized subject or branch of research: it should be the basic method of advanced microbial bioprocessing.
- Jacques Monod

The first step to controlling a culture's growth is to measure it. To do this, we need to model the rate of growth. We've seen other attempts at modelling the growth rate, but they all assumed too much:

  • Exponential growth model: perhaps truly early on, but certainly not the case near stationary.
  • Logistic growth model: requires an assumption about the max optical density, and assumes symmetric growth around the inflection point.
  • Gompertz models and other models: more parameters, less interpretable, and still make strong assumptions about the trajectory of growth.

Further more, none of these can model a culture in a turbidostat or chemostat mode, where the optical density is dropping quickly during a dilution, but the growth rate should remain constant.

Re-visiting a growth model

We are often introduced to a growth model by the simple exponential growth model:

$\text{OD}(t) = \exp{ \text{gr} t }$

Plainly put, the culture grows exponentially at rate $\text{gr}$. Like we mentioned above, this might be true for small time-scales, but certainly over the entire lag, log, and then stationary phases, this is not the case.

There's a hint of an interesting idea in the last paragraph though: "over small time scales". What if we cut up the growth curve into many small time intervals, and computed a growth rate for each interval? Then our growth rate can be changing: starts near 0 in the lag phase, can increase to a peak in the log phase, and then drop to 0 again in the stationary phase. We also don't need to assume any parametric form for the growth rate, we can just measure it directly from the data.

Our new formula might look like:

$$\text{OD}(t) = \exp{ \left( \text{gr}_0 \Delta t + \text{gr}_1 \Delta t + ... \right)}$$

If we think more about this, and we keep shrinking our time interval towards zero, this is just an integral:

$$ \text{nOD}(t) = \exp{ \left( \int_0^t \text{gr}(s)ds \right)} $$

There's still no particular assumption about the shape of the growth rate function, $gr(s)$. For example, consider the following ODs from a batch experiment:

nod

Using our estimation technique outlined below, we can estimate the growth curve as:

gr

We can see that the growth is very dynamic, and certainly not a single number or a constrained form!

Estimating a non-parametric growth rate

A non-parametric, dynamic growth rate sounds great, but we've replaced a estimation of a single value (or handle of values) to an entire function! This seems expensive!

Luckily, we do the work for you. We will compute $gr(t)$ using a statistical algorithm, the Kalman filter. The Kalman filter is an algorithm that estimates the state of a dynamic system from noisy measurements. In our case, the state is the growth rate, and the measurements are the optical density readings. We input optical density observations one at a time, and the Kalman filter updates its estimate of the growth rate based on the new observation. This allows us to track the growth rate in real-time, as the culture grows.


gr od

Observation noise and changing growth

The filter keeps the startup observation-noise model fixed during updates. Persistent disagreement between predicted and measured OD can represent a change in growth, so it is not used to increase the sensor-noise estimate. Isolated outliers are still downweighted for their individual updates, and the recent_dilution flag still allows a sudden OD change.

This avoids self-reinforcing divergence during batch growth transitions. It can produce less smooth growth estimates when measurement noise increases after startup, especially with correlated noise. Filtered OD remains a smoothed estimate of the optical signal; agreement with raw OD does not establish biomass accuracy.

Metadata

Release files for grpredict 26.11.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for grpredict 26.11.2
File Size Uploaded Provenance Actions
grpredict-26.11.2.tar.gz 11.5 kB Without provenance Details for grpredict-26.11.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for grpredict 26.11.2
File Interpreter ABI Platform Actions
grpredict-26.11.2-py3-none-any.whl Python 3 none any Details for grpredict-26.11.2-py3-none-any.whl

Total release size: 20.9 kB

Release files / grpredict-26.11.2.tar.gz

Download URL grpredict-26.11.2.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5eb1aa62b118cca51d7ccc2fa89912cbd279e442763d461d59d731a504524013
BLAKE2b-256 checksum
How to use checksums
31a011d2b90feb049a713d0c9dc9da8a7ea3e9056d498769484f80aee69e6ed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / grpredict-26.11.2-py3-none-any.whl

Download URL grpredict-26.11.2-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fada798a54d922a775cb07e034680eb842b1fae1512bf2f9b546383e5388613d
BLAKE2b-256 checksum
How to use checksums
ccc1f6eb123465a88822481ab2bddb8e8cd312fe0e2fcaf294fc5c54f4e93edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for grpredict 26.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page