Skip to main content
eLife logoLink to eLife
. 2026 Oct 9;14:RP107122. doi: 10.7554/eLife.107122

Obtaining maximum information from colony counts with REPOP

Pedro Pessoa 1,2,3, Carol Yunxiao Slayton 1,3,4,5,6, Stanimir Asenov Tashev 1,2,3, Rory Kruithoff 1,2, Doug P Shepherd 1,2, Steve Presse 1,2,3,4,✉
Editors: Anne-Florence Bitbol7, Aleksandra M Walczak8
PMCID: PMC13652539  PMID: 42853603

Abstract

Bacterial counts from native environments, such as soil or the animal gut, often show substantial variability across replicate samples. This heterogeneity is typically attributed to genetic or environmental factors. A common approach to estimating bacterial populations involves successive dilution and plating, followed by multiplying colony counts by dilution factors. This method, however, overestimates the heterogeneity in bacterial population because it conflates the inherent uncertainty in drawing a subsample from the total population with the uncertainty in the sample arising from biological origins. In other words, this approach may obscure features that may otherwise be present in the data, hinting at the presence of genuine subpopulations. For example, in plate counting applied to Caenorhabditis elegans gut microbiota, observed multimodality is often interpreted as large host-to-host variance, while the randomness introduced by measurement is frequently ignored. To explicitly account for the uncertainty introduced by dilution and plating randomness, we introduce REPOP, a PyTorch-based library to REconstruct POpulations from Plates within a Bayesian framework. Beyond simple cases, REPOP addresses more complex scenarios, including multimodal populations and correcting the mathematically subtle, but experimentally relevant, bias introduced by excluding plates deemed too crowded to distinguish individual colonies. We demonstrate REPOP’s ability to resolve distinct population peaks otherwise obscured by standard multiplication methods. Applications to both simulated and experimental datasets, including bacterial samples of different concentrations and ones from the gut microbiota of C. elegans, show that REPOP accurately recovers the underlying multimodality by properly accounting for error propagation, where naive multiplication fails. REPOP is available on GitHub: https://github.com/LabPresse/REPOP.

Research organism: C. elegans, E. coli

Introduction

Plate counting is fundamental to microbiology in estimating the number of living microorganisms in a sample (Corry et al., 2011; Smith and Brown, 2021). For example, it is essential in food safety testing (Vial et al., 2019), water quality assessments (Bartram et al., 2003; Some et al., 2021), among many other applications (Wang et al., 2020; Tamargo et al., 2022; Martini et al., 2024; Taylor et al., 2022) that require flexible quantification of microbial loads.

Briefly, plate counting involves serially diluting an original sample to ensure an appropriate colony density, allowing for the accurate enumeration of colonies for each sample (as summarized in Figure 1a). Subsequently, the diluted samples are spread over nutrient-rich agar plates and incubated. After incubation, each viable organism (typically a bacterium) spread over the plate forms a colony, or in some cases a plaque (Marine et al., 2020). All of the colonies or plaques on the plate are then enumerated as colony-forming units (CFUs) or plaque-forming units (PFUs), respectively. The degree of dilution (represented by the dilution factor) is typically set in such a way as to collect a statistically precise number of colonies but simultaneously avoiding colony overlap – usually aiming for 30–300 CFUs in a plate with a diameter of 10 cm. However, when studying a poorly characterized or highly variable bacterial population, collecting plates that are overcrowded is inevitable. Challenges related to counting crowded plates were only recently mitigated by AI-inspired tools (Geissmann, 2013; Khan et al., 2018; Albaradei et al., 2020; Zhang et al., 2022).

Figure 1. Visual description of the dilution and plate counting process and the need for its analysis.

Figure 1.

(a) A sample of volume V is mixed with sterile medium in a larger vial (e.g., 19V, for a total dilution of 20). A portion of volume V of this diluted sample is then spread on a plate and incubated. Further tenfold dilutions are performed by transferring V into a vial with 9V of medium before plating. The process continues until a reasonable number of counts is obtained. (b) The histogram on the left shows simulated counts across 1000 plates, obtained by diluting samples from the ground truth distribution by a factor of 200. The usual method of multiplying the counts by the total dilution factor produces the orange histogram (on the right), which is significantly broader than the ground truth (black line, right) due to additional stochasticity introduced by dilution and plating. The ground truth distribution is a Gaussian with a mean of 8000 and a standard deviation of 500. REPOP’s reconstruction (blue) corrects the broadening. (c) A similar simulation to (b) where the ground truth population distribution is trimodal (parameters in Figure 3). Here, the stochasticity introduced by dilution and plating obscures the three peaks, making them difficult to distinguish in the observed counts. Nevertheless, REPOP successfully reconstructs the trimodal distribution. Panel a was created with BioRender.com.

Beyond simple quantification, plate counting is often used to assess population variation within a single microbial species, the degree of phenotypic variability (Martino et al., 2016; De Martino, 2017; Pecht et al., 2020; Muntoni et al., 2022) and environmental resource availability (Armitage and Jones, 2019; Blanchet et al., 2020). This stems from interpreting multimodality – several samples exhibiting high and several others low counts – or general heterogeneity in plate counts as reflecting population differences in colony formation, growth rates, or stochastic expression of traits (Veening et al., 2008; Moore et al., 2013). This heterogeneity can then be used to understand ecological dynamics of bacterial populations (Mao and Lu, 2016; Armitage and Jones, 2019; Werner et al., 2022; Goberna and Verdú, 2022; Pinto et al., 2022) such as the competition of populations inside the gut of Caenorhabditis elegans (Lu et al., 2026; Vega and Gore, 2017).

On account of this, learning the variability from sample to sample is critical in accurately capturing a population’s heterogeneity. Thus, in order to draw biological conclusions, one must disentangle the effects of the stochasticity involved in the measurement (e.g., the randomness involved in the process of dilution and plating) from the heterogeneity in the original sample’s population arising from the underlying biological or ecological variation.

Naively, in dilution and plating, the total number of viable bacteria in the original sample is usually estimated by multiplying the number of colonies by the total dilution factor for each plate, resulting in a histogram of the population in the original sample. This process significantly overestimates the true variability in the bacterial count within the samples and can even obscure the multimodality in reconstructed population count histograms, as demonstrated in Figure 1b, c.

Indeed, this higher variance introduced in quantification is a major disadvantage of plate counting when compared to other methods, such as those based on flow cytometry or DNA quantification (Van Nevel et al., 2017; Wilkinson, 2018; Hansen et al., 2019; Weitzel et al., 2021; Tracey et al., 2023; Sun et al., 2024), which have the ability to count cells without dilution. Yet, plate counting remains the gold standard in several areas of microbiological research due to its ability to quantify only viable cells (Davey and Guyot, 2020; International Organization for Standardization, 2013; Bartram et al., 2003). In contrast, flow cytometry can only distinguish viable cells under specific conditions. It typically relies on fluorophore-based methods, assuming that a high intracellular concentration of non-membrane-permeable fluorescent probes indicates a compromised membrane and, therefore, a lack of viability (Taimur et al., 2020; Davey and Guyot, 2020). These challenges underscore why plate counting remains relevant, and improvements in the technique have wide downstream implications.

To overcome the limitations of traditional plate-count estimation, we developed REPOP (REconstruct POpulations from Plates), a software package that employs a Bayesian approach that rigorously accounts for the stochasticity introduced by dilution and plating. By modeling these statistical processes, REPOP infers both the full probability distribution of the original samples, preserving their inherent heterogeneity, as demonstrated in Figure 1b. Notably, REPOP can detect the multimodal structure of the data even when such multimodality is not readily apparent from dilution count histograms, as shown in Figure 1c. REPOP is developed in Python and built on PyTorch (Paszke et al., 2019). Although PyTorch was originally developed for neural networks, it is also well suited for the type of optimization and GPU-accelerated calculations required here. REPOP is pip-installable and can take advantage of a GPU when available.

REPOP is available on GitHub (Pessoa, 2026), where users can find recipe-like tutorials, including examples of how to reconstruct the underlying population distribution and obtain quantities such as quantiles. A schematic overview of the workflow is shown in Figure 2. Briefly, the input data consist of a sequence of observed colony counts together with their respective dilution factors, where each pair corresponds to a single biological sample. These data are passed to the inference pipeline, which evaluates the likelihood and reconstructs the distribution of the original bacterial population across samples. The main output is the inferred population distribution, along with summary statistics such as moments or quantiles.

Figure 2. REPOP workflow from plate counts to reconstructed population statistics.

Figure 2.

The input consists of observed colony counts and their corresponding dilution factors, organized as pairs (ki,ϕi), each arising from a single biological sample. From these data, REPOP evaluates the probability of each observed dilution count pair conditioned on the underlying bacterial number, p(ki,ϕi∣ni), thereby capturing the stochasticity introduced by dilution and plating. These likelihood contributions are then combined to reconstruct the distribution of the original bacterial population across samples. Created with BioRender.com.

When presenting our method, we address a mathematically subtle point that may qualitatively affect the inferred counts: the cutoff for ‘uncountable’ on a plate. That is to say, when multiple dilutions are performed in experiments to obtain plates with a large quantity of CFUs, plates that exceed a preset colony cutoff (a number beyond which colonies are considered too numerous to count) are excluded. While this practice is common, failing to properly account for the exclusion of such plates can introduce bias in the inferred population distribution.

Here, we will explain how REPOP is able to integrate previously ignored over-populated plates exceeding the cutoff in a more sophisticated albeit requisite iteration of our simpler method. Why requisite? Under the very general assumption that there is a nonzero probability of the population sizes being larger than the cutoff, no matter how low we set our dilution factor, a plate may still probabilistically exceed the countable cutoff, though increasingly rarely. Thus, if we can deal with over-populated plates, then we may collect better statistics on colony counts by avoiding too large a dilution.

To demonstrate REPOP’s applicability to real-world datasets, we analyzed two distinct experimental systems. First, we applied REPOP to plate counting data obtained from controlled mixtures of Escherichia coli populations at different optical densities. Without being provided the optical density condition from which each individual sample was drawn from, REPOP successfully reconstructed the mixture distribution of bacterial abundances across the different conditions. Second, we employed REPOP to study bacterial colonization dynamics in individual C. elegans hosts. By analyzing plate counts of gut bacterial populations over several days post feeding, REPOP revealed the progressive increase in bacterial load and captured the multimodal structure associated with host heterogeneity. These results highlight REPOP’s ability to disentangle true biological variability from stochastic sampling noise in complex, real experimental contexts.

Methods

Statistical description of plate counting

We first describe the process of serial dilutions in mathematical terms. From Figure 1a, we observe that, on each plate, a fraction of the volume of the initial sample, equal to the inverse of the dilution factor (ϕ), is spread over the plate.

In practice, a sample is first collected from the biological system and then mixed as part of the dilution procedure prior to plating, resulting in a well-mixed solution from which a subvolume corresponding to a fraction 1/ϕ of the total volume is transferred to the plate. Consequently, each individual bacterium in the diluted sample has probability 1/ϕ of being transferred onto the plate.

We denote the total number of bacteria in the original sample as n. Assuming each bacterium is independently and equally likely to be transferred to the final plate and form a colony, the resulting number of colonies, denoted as k, follows a binomial distribution with parameters n (the number of trials) and 1ϕ (the probability of success in each trial), expressed as

p(k|n,ϕ)=(nk)(1ϕ)k(1−1ϕ)n−k. (1)

Here, for the numbers usually used in plate counting, the stochasticity introduced by the dilution is far from negligible. From (Equation 1), the variance of k is given by nϕ(1−1ϕ), while the mean is nϕ. Thus, for large dilution factors, the variance is approximately equal to the mean. In practice, we expect colony counts to remain below 300. For example, if the expected count is 150, then the binomial variance is approximately 150, corresponding to a standard deviation of 150≈12. Therefore, the observed count k will typically lie within one standard deviation of the mean, approximately in the interval [138, 162]. This corresponds to a relative error of approximately 8%. Similarly, for an expected count of 50 (smaller but still reasonable), the standard deviation of k is approximately 50≈7. Therefore, for a case where the expected number is 50, one standard deviation corresponds roughly to the interval [43, 57], which gives a relative error of approximately 14%.

Bayesian inference

For now, we assume that each sample (drawn from the sample at the previous dilution) gives rise to one plate. The dataset obtained consists of the sequence of plate counts, ki and their respective dilution factors ϕi for each replicate i. We denote the complete dataset as D=(k¯,ϕ¯) with k¯={k1,k2,…,kI} and ϕ¯={ϕ1,ϕ2,…,ϕI}, with each pair (ki,ϕi) generated independently as they arise from different samples.

Our overall goal is to learn the probability distribution for the number of bacteria in the original samples, n, from the dataset D. To achieve this, we assume a priori that the distribution over n follows a model of population distribution with a set of parameters θ, written as p(n|θ).

Later, we will consider both unimodal and multimodal population distributions, p(n|θ). First, assuming that the population distribution is unimodal, we represent p(n|θ) as a simple Gaussian distribution, where θ reflects the mean and standard deviation. Second, in order to model a multimodal distribution, we invoke non-parametric models which provide a means to describe multimodal probability distributions for which the number of modes is unknown a priori (Pressé et al., 2010; Jazani et al., 2019; Tavakoli et al., 2020; Kilic et al., 2021; Sgouralis et al., 2024; Pressé and Sgouralis, 2023). More specifically, we assume a non-parametric Gaussian mixture, where θ represents a (potentially infinite) set of means, standard deviations, and mixture weights. Importantly, in large datasets, non-parametric models can flexibly adapt to approximate probabilities that do not strictly follow a predefined functional form (Bryan et al., 2020; Pressé and Sgouralis, 2023; Pessoa et al., 2025).

The goal of reconstructing the distribution of bacteria in the original samples then becomes one of learning the underlying parameters (θ) from plate-count data (D). In other words, we want to learn the probability of θ conditioned on D, p(θ|D). This probability is called a posterior. As we will see later, calculating the posterior will require the use of p(n|θ), which is uni- or multimodal, and the use of p(ϕi|n) when cutoffs on countability of plates are used in order to eliminate plates containing too many colonies.

REPOP is applied here to three cases of increasing complexity: the first (Model 1) is the simplest, assumes unimodal p(n|θ) without cutoffs. In Model 2, we keep no cutoff in counts, but generalize p(n|θ) to a multimodal (which simplifies to the unimodal Model when all but one component is considered). In Model 3, we keep the most general multimodal distribution for p(n|θ), but expand the counting method to account for the cutoff, resulting in some plates not being counted due to exceeding the cutoff. We summarize the differences among the three mechanisms in Table 1.

Table 1. For ease of reference, we summarize the differences among the three models taken into account in the present article.

Models Plate counting method Population distribution p(n|θ)
Model 1 No cutoff Unimodal
Equation 5
Model 2 No cutoff Multimodal
Equation 6
Model 3 Cutoff Multimodal
Equation 6

For all models highlighted above, in order to compute p(θ|D), we need the likelihood, p(D|θ), then related to p(θ|D) through Bayes’ theorem

p(θ|D)∝p(θ)p(D|θ). (2)

Here, p(θ) is the prior. Further details on the prior are given in Appendix 1. Once we calculate probability p(θ|D), we may maximize this probability to obtain the MAP value, θMAP (as we describe later).

Population versus measurement stochasticity

In the following sections, we describe how the likelihood, p(D∣θ), is computed. We denote the dataset as D={(ki,ϕi)}i=1I, where each pair corresponds to the colony count and associated dilution factor for sample i. Assuming samples are uncorrelated, except in sharing the same underlying ecology, they may be treated as independent and identically distributed, so that the likelihood factorizes as

p(D∣θ)=∏i=1Ip(ki,ϕi∣θ). (3)

However, each observed plate count arises from an underlying (and unobserved) number of bacteria in the original sample, which we denote by ni. This latent variable captures the true population size for sample i and is the quantity directly informed by the ecological variability. Thus, we can rewrite each term in the likelihood by marginalizing over ni,

p(ki,ϕi∣θ)=∑ni=0∞p(ki,ϕi∣ni)p(ni∣θ). (4)

This decomposition makes explicit the two sources of stochasticity. The term p(ni∣θ) describes the population distribution, encoding the intrinsic variability across samples, while p(ki,ϕi∣ni) describes the measurement process, capturing the stochastic effects of dilution and plating. The following two subsections explain these two ingredients in detail. In particular, the population model p(ni∣θ) is flexible and must be chosen to reflect the underlying biological or ecological structure of interest, whereas the measurement model p(ki,ϕi∣ni), explained in the following subsection, is dictated by the experimental protocol itself.

In the following sections, we introduce a hierarchy of models for p(ni∣θ), ranging from simple unimodal distributions to flexible non-parametric multimodal representations. While REPOP provides general purpose choices for these models, users interested in specific ecological hypotheses may substitute alternative forms for p(ni∣θ) without modifying the measurement model. That is, REPOP can also be used to extract only the measurement component, p(ki,ϕi∣ni), whose implementation is described in detail on GitHub (Pessoa, 2026).

Models for the population distribution

Unimodal distribution (Model 1)

For Model 1, we can mathematically represent the probability of the true population count ni given the distribution parameters θ as

p(ni∣θ)=exp⁡(−(ni−μ)22σ2)∑n′=0∞exp⁡(−(n′−μ)22σ2). (5)

Here, θ includes the mean, µ, and standard deviation, σ, of the integer Gaussian p(ni|θ), θ={μ,σ}. The denominator above is necessary because we are dealing with (positive) integer Gaussians and will approach the usual 2πσ when μ−5σ≫1. For computational reasons, we assume that the probability of having a number of bacteria, n, larger than twice the largest number found by multiplying CFU counts per dilution is approximately zero. Thus, the infinite upper bound over the sum in the denominator of Equation 5 is substituted for N∗=2maxi(kiϕi). Note that, by using the integer Gaussian in Equation 5, we truncate the negative support of a Gaussian distribution, meaning we assume that even if we have a pair of µ and σ that assigns non-negligible probability to counts ni≤0, those probabilities are set to zero, and the distribution is renormalized accordingly.

Multimodal distribution non-parametric inference (Models 2 and 3)

Naturally, the choice of modeling n through a single Gaussian component, Model 1, already commits us to assuming a unimodal distribution. However, if bacteria are present across replicates in a multimodal distribution (such as observed in some studies of C. elegans gut microbiota Vega and Gore, 2017; Taylor and Vega, 2024; Martini et al., 2024), where some replicates have few bacteria and others have more based on rare colonization events (Vega and Gore, 2017; Taylor and Vega, 2024), how many modes should we consider?

This consideration immediately forces upon us an important motivation for considering a much more general choice for p(n|θ), namely a non-parametric Gaussian mixture. Loosely speaking, non-parametric Gaussian mixture models do not assume a fixed number of parameters (or components) beforehand. Instead, they adapt and determine the appropriate number of components as warranted by the data. Knowledge of non-parametric mixture models, while subtle and detailed in Pressé and Sgouralis, 2023 and references therein, is not required for running REPOP. In such a model, θ encompasses the means μ¯=(μ1,μ2,…), standard deviations σ¯=(σ1,σ2,…), and mixture weights (the relative weights of each Gaussian component with the weights summing to unity) ρ¯=(ρ1,ρ2,…), such that θ={μ¯,σ¯,ρ¯}. In this non-parametric model, the probability of having a sample of n bacteria is given as

p(ni|θ)=∑α=1∞ρα[exp⁡(−(ni−μα)22σα2)∑n′=0∞exp⁡(−(n′−μα)22σα2)]. (6)

When performing non-parametric inference, the choice of prior p(θ) is key. A well-chosen prior can add computational efficiency and avoid runaway pathologies associated with assigning every datapoint a different mixture component. A common choice of prior for the infinite mixture model satisfying both of these criteria is the Dirichlet process prior (Pressé and Sgouralis, 2023; see Appendix 1 for more details). While a finite truncation in the number of components can be avoided (Walker, 2007; Kalli et al., 2011), for computational reasons, here we use a finite truncation (defaulted to the smallest value among 25 and the square root of the total number of samples, though modifiable, in REPOP) for the sum over the components, α, in Equation 6.

Calculating the likelihood

Here, we explain how to calculate the likelihood, p(D|θ), appearing in Equation 2 and start with Models 1 and 2 and move to Model 3, where the cutoff is taken into consideration.

Likelihood for Models 1 and 2

In the models where cutoffs are not taken into consideration (i.e., where it is assumed that the colonies on a plate can always be counted and plates are never rejected for having too many colonies), the calculation of the total likelihood for all counted plates from the original number of bacteria in one sample, n, is given by Equation 1. However, ni is itself a realization of the population distribution p(n|θ). Thus, the probability that a plate with ki counts was generated from a (fixed) dilution ϕi is given by

p(ki|ϕi,θ)=∑ni=0∞p(ki|ϕi,ni)p(ni|θ). (7)

Here, the dilution factor is treated as fixed rather than as a random variable because it is assumed that the colonies can always be counted. Within the summation in Equation 7, each factor p(ki|ϕi,ni) within the summation given by Equation 1 and p(ni|θ) given by the respective population model as presented in Models 1–3 in the previous subsection.

This allows us to write Bayes’ theorem (Equation 2) as

p(θ|D)∝p(θ)∏i=1Ip(ki|ϕi,θ)∝p(θ)∏i=1I[∑ni=0∞p(ki|ϕi,ni)p(ni|θ)] (8)

where I is defined as the total number of replicates. Note that while this summation is truncated to twice the naively reconstructed maximum from observed CFU counts N∗=2maxi(kiϕi), these sums can still remain computationally intensive. Thus, while REPOP can run on CPUs, we automatically leverage GPU acceleration to enable faster evaluation of these summations if a GPU is available.

Likelihood for Model 3

For Model 3, we assume that the number of colonies may exceed a certain cutoff, kCO, and that such plates are not counted. Typically, for each sample, only one of the plates generated in the process described in Figure 1a is reported. In other words, for each collected sample only the counts (and dilution) of one of the plates at the first dilution resulting in a countable number of colonies (below a predefined cutoff) is recorded as a datapoint. This is illustrated in Figure 1a.

This process is different from the previous models. If a dilution different from the first dilution in the dilution schedule is reported, this implies that all lower dilutions therefore resulted in plates whose colony count (a stochastic variable) already exceeded the cutoff kCO.

To obtain the posterior over θ, it is necessary to know the dilution schedule from the plating experiment. We refer to the full set of these as Φ={ϕ1,ϕ2,…,ϕM} ordered from lowest to highest dilution factor. In the example given in Figure 1a, we have ϕ1=22, ϕ2=222, and ϕ3=2222. While, mathematically, we could extend this indefinitely by sequentially plating dilutions that are factors of 10 larger, in practice only a finite number of plates can be produced, thus justifying the upper limit M. It is expected that the dilution schedule leads to dilution values sufficiently large that the approximate number of colonies recovered approaches zero. Expanding upon the previous models, it is now important to report not only the counts but also the associated plate index. The datapoint is now reported as (ki,mi), which means that for the ith sample, the plate diluted by a total factor of ϕmi had ki counts and all plates with smaller dilution had counts larger than the cutoff kCO.

With the set of all possible dilutions Φ explicitly considered, we incorporate this dependence into the calculation of all relevant probabilities. Thus, the total posterior for the full dataset is given by

p(θ|D,Φ)∝p(θ|Φ)∏i=1Ip(ki,mi|θ,Φ)∝p(θ|Φ)∏i=1I∑ni=0∞p(ki,mi|ni,Φ)p(ni|θ,Φ)∝p(θ)∏i=1I∑ni=0∞p(ki,mi|ni,Φ)p(ni|θ). (9)

Here, we used the fact that the population distribution and its parameters, θ, are independent of the dilutions selected to plate, Φ. Therefore, p(θ|Φ)=p(θ) is the original prior and p(ni|θ,Φ)=p(ni|θ) is given by the respective population model. The remainder of this subsection focuses on how to calculate the likelihood of each datapoint, p(ki,mi|ni,Φ), within the summation above. To obtain this likelihood, we revisit the dilution and plating process. As described in Figure 1a, a plate is generated for each dilution within the set of dilutions Φ. For each sample, labeled i, the number of colonies on the plate with dilution ϕm is denoted as kim.

Since all plates originate from the same original sample (with a finite number of bacteria, ni), the values of kim for the same i are, in principle, not independent. Instead, the set of all kim is jointly sampled from a single multinomial distribution. However, as each bacterium has an independent probability of 1/ϕm of appearing on the mth plate, the correlations between the multiple kim arise solely due to the finite number of total bacteria in the sample. Consequently, as long as the fraction of plated bacteria remains significantly smaller than the total sample size (i.e., ∑m1/ϕm≪1), the number of plated bacteria can be treated as independent binomial random variables.

Under this assumption, each count kim can be modeled as a binomial realization of the original number of bacteria ni with dilution factor ϕm, as described in Equation 1. Thus, the likelihood of observing kim is written as

p(kim|ni,Φ)=(nikim)(1ϕm)kim(1−1ϕm)ni−kim. (10)

As previously described, the datapoint (ki,mi) corresponds to the counts and the index of the first value within the sequence (ki1,ki2,…,kiM) that satisfies the condition kim≤kCO, where kCO is the cutoff. To formalize this, we define mi as the (superscript) index of the first plate where the counts fall within the cutoff:

mi=min{m∣kim≤kCO}, (11)

from which the observed datapoint (ki,ϕi) is obtained with

ki=kimiandϕi=ϕmi. (12)

To avoid confusion, hereinafter we express the likelihood in terms of the plate index mi rather than the corresponding dilution factor ϕi, since the ordered dilution schedule Φ establishes a one-to-one correspondence between them.

Within this convention, the likelihood, p(ki,mi|ni,Φ), is written as

p(ki,mi|ni,Φ)=p(ki|mi,ni,Φ)p(mi|ni,Φ). (13)

Once more, we proceed by showing how to calculate each factor within the product above. Starting from the last factor, p(mi|ni,Φ), we note that if the plate with index mi is reported, we must have that both kimi≤kCO and kim>kCO for all m<mi,

p(mi|ni,Φ)=P({kimi≤kCO}|ni,Φ)∏m=1mi−1P({kim>kCO}|ni,Φ). (14)

Here, we use the capitalized P to represent that we are calculating the probability that a variable is within a set, rather than the probability of a single possible value. In this specific model, what we are asking is the probability that kim is smaller than or equal to kCO. This is given by summing the probability of every value of kim up to kCO, meaning

P({kim≤kCO}|ni,Φ)=∑kim=0kCOp(kim|ni,Φ), (15)

so Equation 14 becomes

p(mi|ni,Φ)=(∑kimi=0kCOp(kimi|ni,Φ))[∏m=1mi−1(1−∑kim=0kCOp(kim|ni,Φ))] (16)

with each p(kim|ni,Φ) given by Equation 10.

Then, for the remaining factor in Equation 13, p(ki|mi,ni,Φ), since counts above the cutoff are not reported as data, the likelihood of finding ki colonies in a plate diluted by a total factor ϕmi is re-scaled to account for the fact it was truncated at the cutoff

p(ki∣mi,ni,Φ)=(niki)(1ϕmi)ki(1−1ϕmi)ni−ki∑k′=0kCO(nik′)(1ϕmi)k′(1−1ϕmi)ni−k′, (17)

for ki≤kCO and zero otherwise.

Thus, in order to obtain the posterior Equation 9, we need to substitute the likelihood per datapoint, p(ki,mi|ni,Φ) in Equation 13, which is computed using Equation 17 and Equation 16.

Bayesian MAP

In Bayesian inference, we compute the posterior distribution p(θ|D) as it captures the updated probability over the model parameters after observing the data. However, posteriors are often complex and high-dimensional (technically infinite in non-parametric models), making direct computation and visualization challenging. To address this, we often resort to sampling methods to approximate the posterior. However, these samplers can also require long computation.

Since our objective here is to create a tool that is quick and easy to run, we resort to maximum a posteriori (MAP) estimation. This reduces the problem of knowing the distribution over θ to identifying the optimal θ. In this model, we maximize p(θ|D) and denote the maximum value as θMAP,

θMAP=arg⁡maxθp(θ|D), (18)

with p(θ|D) given by Equation 8 for Models 1 and 2, or Equation 9 for Model 3. For our purposes here, we say that p(n|θMAP) is the distribution of n we learned from the data. In REPOP, the maximum value θMAP is found using optimization libraries within PyTorch (Paszke et al., 2019).

Results and discussion

In the previous section, we have constructed the posterior p(θ|D) across unimodal and multimodal population distributions, and by using a likelihood that either assumes all plates are countable (Models 1 and 2) or considers plates exceeding the cutoff (Model 3).

When all plates are considered countable

For the first model, we generate simulated data drawn from a single Gaussian with equal dilution factors across all samples. This assumes that the dilution factor used (200) is able to generate a countable number of colonies in all samples. We also assume a unimodal Gaussian, as in Model 1. The reconstruction obtained by REPOP was shown earlier in Figure 1b, where we see that REPOP corrects for the overestimation of variance introduced by the stochasticity in dilution and plating.

In the more complex multimodal Gaussian case (Model 2), we further observe that REPOP uncovers the true underlying distribution’s peaks with greater resolution and sensitivity to multimodality than by using naive multiplication. As an example, in Figure 3 we generate simulated data for a mixture of Gaussians with three modes.

Figure 3. REPOP can reconstruct multimodal populations even when they are not directly observable by naively multiplying colony counts by dilution.

Figure 3.

Similar to Figure 1b, c, we show above the observed colony counts, the naive estimate obtained by multiplying counts by the dilution factor, and the reconstruction produced by REPOP, compared to the ground truth. In both cases, the population size n is drawn from a mixture of three Gaussians, shown as the black curves. In (a), the mixture has means (4000, 8000, 14,000), standard deviations (200, 1500, 1000), and weights (0.25, 0.4, 0.35). In (b), the mixture has means (8000, 16,000, 24,000), standard deviations (1000, 1000, 1000), and weights (0.3, 0.2, 0.5). Observed counts are sampled from Equation 1, with dilution factor 200, and are shown as histograms on the left. In (a), a trimodal structure is visible in the observed count histogram. However, in (b), the trimodal structure is strongly obscured by stochasticity from dilution and plating, making it difficult to discern even in large datasets. Despite this, applying REPOP to datasets of increasing size shows that, although small datasets of 25 plates may miss some modes, larger datasets allow REPOP to accurately recover the underlying multimodal structure in both cases. We quantify this behavior further in Appendix 2, where we analyze the error between the reconstructed and ground-truth means, as well as the relative entropy between the reconstructed and ground-truth distributions, as a function of the number of plates. Together, these results demonstrate REPOP’s ability to infer the true population despite stochastic noise introduced by dilution and plating.

In Figure 3a, we show a relatively simple dataset, where the three peaks are already discernible in the histogram obtained via naive multiplication. Nonetheless, REPOP improves the resolution of these peaks, particularly as the number of samples increases. In Figure 3b, we present a more challenging case where the modes are less distinct under the naive multiplication approach; the additional stochasticity introduced by dilution causes the resulting histogram to appear as a single broad peak. Nonetheless, REPOP is able to accurately recover the underlying multimodality. In both cases, the performance of REPOP improves with larger datasets, as evidenced by the progressively sharper resolution of each peak. We quantify this improvement in Appendix 2, where we analyze the reconstruction error in the mixture means and the Kullback–Leibler divergence between the reconstructed and ground-truth distributions as functions of the number of plates.

When the cutoff is taken into account

For our final demonstration with simulated data, we show results when the data follows a cutoff in reporting, as described in the likelihood for Model 3. We have generated simulated data according to the following scheme: starting from the lowest dilution (20, as shown in Figure 1a). If the counts are larger than the cutoff, we used kCO, we sample again at a dilution factor 10 times higher until we find a plate that has fewer colonies than kCO. We then record that number of counts and that dilution factor as the ith datapoint (ki,ϕi), as would be done by rigorously following the cutoff. If we know the dilution schedule, this is equivalent to having the data as the counts and the index of the reported dilution (ki,mi) as in Equation 17, with each reported dilution matched to the corresponding index mi, meaning the dilution reported is the mi th in the schedule ϕi=ϕmi.

We visualize the data generated this way and show the reconstruction obtained for Model 3 in Figure 4. In the rightmost column, we demonstrate how failing to account for the cutoff leads to an artificial peak (e.g., an extra mode near the leftmost peak in the ground truth, Figure 4b). This occurs because counts near the cutoff kCO are ambiguously assigned to incorrect dilutions.

Figure 4. Not accounting for the cutoff can lead to incorrectly attributed multimodality.

Figure 4.

This figure compares population reconstructions with and without accounting for the cutoff effect (using Models 3 and 2, respectively). (a) Simulated data generated with a cutoff kCO=50. The ground truth population consists of three Gaussian components with means μ¯=(1000,5000,15,000), standard deviations σ¯=(100,300,1000), and weights ρ=(16,12,13). (b) A more realistic cutoff kCO=300, with ground truth parameters μ¯=(6000,30,000,60,000), σ¯=(1200,3600,12,000), and ρ=(25,15,25). The middle column shows reconstructions using Model 3 (which accounts for the cutoff), while the rightmost column shows results from Model 2 (which ignores it). The rightmost column also highlights key cutoff crossings, using red dashed lines. These lines indicate where bacterial counts approach the cutoff at different dilutions. Notably, failing to account for the cutoff leads to incorrect mode placement, including the emergence of an extra peak observed in (b). As discussed in the main text, when the true distribution has substantial probability near these points (meaning there is a non-negligible probability to find a sample with these number of bacteria close to those cutoff values) failing to account for the cutoff effects results in inaccurate reconstructions.

These errors become particularly pronounced when colony counts approach kCO, as the cutoff procedure forces certain samples to be reported at different dilutions. For example, consider a cutoff kCO=300 and two possible dilution factors, ϕ1=20 and ϕ2=200. A sample with an original bacterial count ni near kCOϕ1=6000 may yield counts at dilution ϕ1 that either exceed or fall below the cutoff due to variability in the plating process. When the cutoff effect is ignored, the algorithm mistakenly interprets these counts as coming from separate populations, leading to incorrect peak formation, as seen in the rightmost column of Figure 4b. Beyond this qualitative observation, we also assess the magnitude of these errors by computing the relative deviation between the estimated and ground truth means for each component (see Appendix 2).

Results for experimental data: discerning different true concentrations of bacteria

While we have demonstrated in the previous subsections how to resolve overlapping distributions in simulated datasets, here we move on to obtaining a similar case built with real-world plate counting. In particular, we construct a case that emulates multiple peaks at different dilutions, as shown in Figure 4, by generating four different sample sources of bacteria.

We prepared vials with four different concentrations of E. coli measured by optical density, and consider samples of a volume equivalent to 0.2 nL from these vials. These samples are further diluted according to the dilution schedule Φ=20,200,2000. However, in practice, we do not directly dilute 0.2 nl. Instead, we take 1 µl and dilute it by factors of 105, 106, and 107 – further details in Appendix 2. This approach ensures that while the original vials can be assumed to have negligible variability, the small 0.2 nl subsamples may no longer be, resulting in a unimodal but with a larger relative variance population for each vial.

The colony counts obtained are processed without identifying their original vial, aiming to reconstruct the underlying four components structure. However, the dataset remains relatively small, consisting of only 97 total samples (see details in Appendix 2). This dataset and the reconstructed distribution are presented in Figure 5a.

Figure 5. Reconstructing, from real experimental plate counting, the population from vials with different optical densities.

Figure 5.

(a) Distribution of observed colony counts obtained as described in text. The data is passed to the system without vial identification, aiming to reconstruct the underlying structure. (b) Results from a simulated dataset with 750 datapoints (plates). The increased sample size improves the estimation of the four main components, (which appear as approximately three peaks because two components substantially overlap), yielding a more accurate reconstruction.

Although the limited sample size results in an imperfect match, the method successfully captures the four main components – corresponding to the estimated values of μα and σα associated with the four highest values of ρα. To further validate the approach, we supplement the dataset by generating 750 synthetic datapoints from the mixture distribution made of the four main components, leading to a dataset considerably larger than what is typical of plate counting. The results, shown in Figure 5b, demonstrate a significant improvement in capturing the underlying structure of the data.

Application: capturing host differences through examining gut microbiota population

Here, we use REPOP to study heterogeneity in more complex biological systems, such as microbial ecology within a host organism. Thus, we apply our framework to analyze gut bacterial counts from individual C. elegans.

Heterogeneity in bacterial counts among individual C. elegans has been reported and is typically attributed to rare colonization events and size variability (Vega and Gore, 2017; Taylor and Vega, 2024; Eisenmann, 2005). However, to derive meaningful insights into gut ecology, it is essential to distinguish true population heterogeneity from the stochasticity introduced by dilution and plating.

To minimize confounding factors, we restrict our analysis to the OP50 strain of E. coli, which is well-characterized in laboratory settings and, under idealized conditions, is expected to produce a unimodal population distribution. Any deviations from this expected pattern may reflect individual C. elegans variability, either due to differences in the gut microenvironment or the fact that gut colonization is a rare event (Vega and Gore, 2017).

Due to this, we conducted an experiment in which C. elegans were synchronized, cleared of gut bacteria at 3 days post-hatching, and subsequently fed live E. coli for controlled durations (1, 3, 5, 7, or 9 days). At each studied time point, 25 individual worms were picked, cleaned of all non-gut adhered bacteria, and crushed. The worm homogenate was then serially diluted and plated with a dilution schedule, Φ={22,222,2222}. The plates were counted after a 24-hr incubation. More detailed experimental methods may be found in Appendix 2.

The results presented in Figure 6 demonstrate a clear trend in bacterial population dynamics within the C. elegans gut. The population distribution shifts consistently to higher values with each successive day, aligning with our expectation that bacterial numbers increase over time due to colonization and replication inside the gut.

Figure 6. Results for the population of E. coli-fed C. elegans’ gut at days 3, 5, 7, and 9 of adulthood.

Figure 6.

Here, we are able to observe the shift in the population distribution obtained with plate counting shifts to higher population for longer-living C. elegans. To better visualize the distribution and model fits, we use a split-log x-axis: bacterial counts from 0 to 100 are shown on a linear scale, and counts above 100 on a logarithmic scale. The population distribution shifts toward higher values each day, as expected from colonization and replication within the gut. If biological significance, such as different C. elegans types, as proposed in e.g. (Boddu et al., 2024) is to be inferred from this multimodality, a rigorous separation of population heterogeneity and plating stochasticity, as implemented by REPOP, is essential.

The multimodality exhibited in Figure 6 can be explained by the heterogeneity of the host. Recently, this has been corroborated by in vivo experiments (Boddu et al., 2024). This phenomenon could be related to the well-established stratification in heat-shock protein expression, which is also correlated with aging and lifespan in nematodes (Yashin et al., 2002; Wu et al., 2006; Vertti-Quintero et al., 2021). Thus the variation in the population could be due to the fact that ingestion and egestion exhibit an age-related change (Bolanowski et al., 1981; Huang et al., 2004) or due to state switching (Boddu et al., 2024) in feeding and digestion, akin to genetic state switching (Pessoa et al., 2024; Kilic et al., 2023). The results in Figure 6 support the conclusion that biologically meaningful differences in population counts are being captured, rather than the data being dominated by instrumentation error. REPOP provides a robust method for distinguishing multiple peaks in the population distribution, indicating that intrinsic variability among individual C. elegans can be deconvolved from measurement noise.

Resolving different species

One possible extension of plate counting is the quantification of multiple bacterial species or phenotypes within the same biological sample. In practice, this could be done when different bacteria produce distinguishable colony colors or morphologies (Maeda et al., 2017; Qamer et al., 2003; Haldeman and Amy, 1993). In such cases, the counts of different bacterial species can be obtained separately from the same sample.

To illustrate how the framework can be extended to this setting, we consider a synthetic dataset consisting of two correlated species. For each sample i, we denote by niA and niB the unobserved numbers of bacteria of species A and B, respectively, drawn from a joint distribution that captures their correlation. Correspondingly, the plate-count measurements yield observations (kiA,kiB,ϕi). In this section, we use these synthetic data to examine how well the framework can recover the marginal population distributions of the two species from their respective plate-count measurements.

In the example shown in Figure 7, we generate a synthetic two-species population distribution with three modes. The mixture components have equal weights and means (4000, 24,000), (14,000, 8000), and (8000, 16,000), where the first and second coordinates denote the population sizes of species A and B, respectively. The covariance matrices are chosen so that the marginal distribution of species A matches the trimodal distribution used in Figure 1c, while the marginal distribution of species B consists of three approximately equally spaced modes at 8000, 16,000, and 24,000, with equal variances. In the ground truth distribution, two of the mixture components include correlations between the populations of species A and B, as seen in the population samples shown by the black points in Figure 7.

Figure 7. REPOP reconstructs marginal population distributions when individual plates distinguish two species.

Figure 7.

A synthetic dataset of 1500 samples contains two correlated bacterial populations. Black points denote the true underlying populations (nA,nB), which are drawn from a joint distribution with three well-separated modes, as described in the text. Orange points denote the corresponding plate counts after a dilution factor of 200, naively reconstructed as counts multiplied by the dilution factor. Although the true population (black) modes are well separated, stochasticity introduced by dilution and plating causes the observed measurements (orange) to overlap. We assume that the two species can be distinguished on each plate, so that separate counts are obtained for species A and B. Applying REPOP separately to the counts from each species recovers the corresponding marginal population distributions, as shown in the side panels.

We then simulate plate-count measurements from this population distribution using a dilution factor ϕi=200, generating a synthetic dataset of 1500 samples. As shown in Figure 7, the true population modes are well separated. However, after dilution and plating, the naively reconstructed observations, obtained by multiplying the plate counts by the dilution factor, are broadened and partially overlap. Nevertheless, applying REPOP separately to the species-specific counts recovers the marginal population distributions for both species.

Conclusion

In accurately estimating bacterial counts, simply multiplying counts by the dilution factor provides only a rough first approximation. As we showed here, this method alone often fails to capture the original individual counts across samples, as straightforward multiplication of colony counts by the total dilution factor typically leads to an overestimation of the spread (Figure 1b) that may obscure multimodal behavior (Figure 1c).

This is not merely a technical issue in quantification: it directly affects the biological interpretation of the data. For example, inferring population growth dynamics (Armitage and Jones, 2019; Martino et al., 2016; Taylor and Vega, 2024; Martini et al., 2024; Boddu et al., 2024) and learning features driving population heterogeneity across samples (Armitage and Jones, 2019; Goberna and Verdú, 2022; Pinto et al., 2022), demands a deeper analysis of the statistics involved in dilution and counting. Indeed, such a treatment avoids attributing ecological (or other) significance to the randomness introduced by plating.

The Bayesian reconstruction presented here and implemented through REPOP provides a rigorous method to obtain the distribution of populations from plate counts, including observing the correct multimodality of the population, as seen in Figures 1—4. This allows the method to extract more information from each individual plate and to reconstruct population features that may be obscured in the raw observations, including multimodality and distributional differences across conditions. This setting is naturally suited to a Bayesian treatment because the quantity of interest is not the observed colony count itself, but the latent population distribution that gave rise to the observed colony counts.

The study of the multimodal case accounting for cutoff (Model 3) also demonstrates that retaining all data, regardless of their individual importance in reconstructing the final population size distribution, remains crucial. As shown in Figure 4, ignoring the cutoff can lead to misidentifying multimodality, especially for plates with colony counts near the cutoff. Consequently, REPOP’s results emphasize that explicitly reporting both the dilution schedule and the cutoff values used should be a fundamental part of data reporting, as they impact the form in which likelihoods are calculated.

Moreover, due to REPOP’s joint statistical description of dilution and plating, REPOP can be extended beyond the specific cases considered here. In particular, the same treatment of measurement stochasticity can be combined with alternative population models designed for more specific ecological hypotheses, as explored in related work by some of us (Lu et al., 2026). In that work, the joint measurement model was combined with a specific parameterized ecological model, allowing posterior inference over p(θ∣D) and therefore uncertainty quantification over the model parameters. Specifically, the REPOP measurement model was used to provide the measurement probabilities p(ki,ϕi∣ni), as described in the section ‘Population versus measurement stochasticity’.

Therefore, while the main implementation of REPOP focuses on finding the population distribution that maximizes the posterior, as described in Equation 18, and is designed to remain model-agnostic by using Gaussian or mixtures of Gaussians as flexible models for the population distribution, its measurement model can also be incorporated into hypothesis-specific population models. This makes REPOP not only a practical reconstruction tool but, more importantly, a foundation for future inference problems involving plate counting data.

Furthermore, to help with computational scalability, REPOP can optionally, as specified by the user, rely on GPU acceleration. This can become helpful as likelihood expressions in Equation 8 and Equation 9 require summations over all possible values of the underlying population size, which can become memory and time intensive. REPOP mitigates these computational demands through GPU parallelization, as performance can be improved substantially from CPU-only systems. Moreover, extending the framework to jointly infer multiple interacting populations in the future would increase computational cost considerably, since the relevant sums must then be performed over the product space of possible population values. In the species case, this leads to an effective quadratic scaling with population range. This quickly becomes prohibitive for larger populations, which is why, in Figure 7, we focus on marginal rather than full joint distributions. Developing more efficient strategies for multiple species inference problems remains an important direction for future work.

Beyond that, a natural extension of the present framework is to refine the measurement model itself by incorporating additional sources of counting error beyond dilution and plating stochasticity. For instance, integrating the notion of additional error sources, such as false positive or negative rates in counting that are due to e.g. bacterial colony overlap, could help in further reducing the breadth in the original counts over bacteria. For instance, intuitively, we may imagine the probability of miscounting two or more colonies as a single one grows as we reach colony counts near the cutoff. Simple simulations, for instance, considering typical colony and plate size, may be used to gain initial insight on potential false negative rates, and thus its effect on the original sample size.

Finally, REPOP provides a means by which to test hypotheses (Boddu et al., 2024; Martini et al., 2024) relating observed multimodality in gut microbial content of C. elegans, as shown in Figure 6, to distinct categories of hosts. What is more, REPOP can also be used to study other organisms, exhibiting similar multimodality in their microbiota (Acuña Hidalgo and Armitage, 2022; Clemmons et al., 2015; Chen et al., 2024). The central point is that identifying biologically meaningful heterogeneity requires more than collecting large datasets: it requires a framework that distinguishes true ecological structure from variability introduced by the measurement itself. Without such a framework, one risks assigning ecological significance to artifacts of dilution and plating. REPOP is designed precisely to avoid those biases while remaining flexible enough to accommodate complex and multimodal population structure.

Acknowledgements

SP acknowledges support from the NIH (R35GM148237), ARO (W911NF-23-1-0304), and NSF (Grant No. 2310610). We also thank Ayush Saurabh, Max Schweiger, Lance (W Q) Xu, and Ioannis Sgouralis for insightful discussions in the development of this work.

Appendix 1

Prior selection across the unimodal and non-parametric models

When estimating the non-parametric model by MAP, we use a prior p(θ) designed to accommodate multimodal population distributions. Here, we describe this prior choice in detail.

As mentioned in the main text, this prior encompasses all of the parameters needed to construct the probability distribution for n, given by Equation 5 in the main text. Therefore, θ must include the means μ¯=(μ1,μ2,…), standard deviations σ¯=(σ12,σ22,…), and mixture weights ρ¯=(ρ1,ρ2,…) of the Gaussian mixture, θ={μ¯,σ¯,ρ¯}. As mentioned in the main text, for practical purposes we assume a weak limit, which we refer to as A and equivalent to the truncation on the number of components in Equation 6 in the main text (defaulted as the smallest value among 25 and the square root of the total number of samples) although it is changeable in our software.

Let us separate each piece of the prior p(θ)=p(μ¯,σ¯,ρ¯). First, we consider the prior for the weights. In a unimodal distribution, case 1, the result is trivial: we have ρ1=1 with probability 1. However, in multimodal cases (2–3) where the number of components is unknown, we use a Dirichlet distribution, a common choice for mixture models in Bayesian non-parametrics (Pressé and Sgouralis, 2023), given by

ρ¯∼Dirichlet(ξ¯),p(ρ¯)=1B(ξ¯)∏α=1Aραξα−1 , (19)

where ξ¯ is a sequence of the same shape as ρ¯, ξ¯={ξ1,ξ2,…,ξA}, and B(ξ¯)=∏α=1AΓ(ξα)Γ(∑α=1Aξα) with Γ representing the gamma function. In order to prevent overfitting, it is a usual choice to have an exponentially decreasing. Let us write ξ¯=λη¯ with η¯ being a sequence η¯={η1,η2,…,ηA} where the parameters decay exponentially by a factor q, such that ηα=qα, and λ being a scalar (we use λ=1.1qA). The expected value of ρα sampled from Equation 19 will be ⟨ρα⟩=ηα∑α′ηα′.

With the prior for ρ¯ established, we proceed to define the prior for the means μ¯ and standard deviations σ¯. Here, each component α is independent from each other. Initially, for the means, we select a distribution that avoids biasing the choice by being nearly uniform, but preventing too small numbers and adhering to a sensible cutoff in n. The mean of each Gaussian must be smaller than twice the largest number found by naively multiplying counts per dilution; we denote this largest cutoff as N∗=2maxiϕiki. Thus, the prior for each mean, μα, is given by

μαN∗∼Beta(1.1,1.1),p(μα)∝1N∗(μαN∗)0.1(1−μαN∗)0.1. (20)

For the prior in σ¯, we write a prior that scales with its respective means, but is still broad; we choose a lognormal prior here

σα|μα∼LogNormal(log⁡μα,1),p(σα|μα)=12π1σαexp⁡[−(log⁡σα/μα)22] . (21)

Thus, the prior used to generate the figures in the main text is defined as:

p(θ)=p(ρ¯)∏α=1Ap(μα)p(σα|μα), (22)

with p(ρ¯),p(μα), and p(σα|μα) given by Equations 19, 20, and 21, respectively.

Appendix 2

Error metrics between reconstructed and ground-truth distributions

In Figures 3 and 4, we showed that REPOP can reconstruct underlying population distributions obscured by dilution and plating stochasticity. Here, we make this comparison quantitative using two complementary error metrics. The first measures how well the inferred mixture components recover the locations of the ground-truth modes. The second compares the full reconstructed and ground-truth distributions using the Kullback–Leibler (KL) divergence.

To compare two distributions, p(ni|θ) and p(ni|θGT), in terms of how well their component means match, we use the relative error between the means defined as

M(θ,θGT)=∑α=1AραminαGT|μα−μαGTμαGT|. (23)

Here, p(ni|θ) is the reconstructed distribution (through REPOP) and p(n|θGT) is the ground-truth distribution. The index α labels the components of the reconstructed distribution, while αGT labels the components of the ground-truth distribution. The quantity inside the absolute value is the relative error between the reconstructed component mean μα and a ground-truth component mean μαGT. We take the minimum over αGT to account for cases in which component labels do not match across the two distributions. The weights ρα are the reconstructed mixture weights, so components with larger inferred probability mass contribute more strongly to the metric.

To compare the full reconstructed and ground-truth distributions, rather than only the locations of their modes, we use a standard metric for comparing probability distributions: the relative entropy, also known as the KL divergence. For each reconstructed distribution p(n|θ) and corresponding ground-truth distribution p(n|θGT), we define

DKL[p(n|θGT)‖p(n|θ)]=∑np(n|θGT)log⁡p(n|θGT)p(n|θ). (24)

The sum is taken over the population size n. Here, p(n|θGT) is the known ground-truth mixture distribution used to generate the simulated data, while p(n|θ) is the mixture distribution reconstructed by REPOP. Roughly, KL divergence measures how much information is lost when the reconstructed distribution is used as an approximation to the ground-truth distribution. In the figure, we show how both metrics decay as the dataset size increases for the same examples shown in Figure 3.

Analogously, for the dataset shown in Figure 4a, the relative error M in Equation 23 is 1.50% when the cutoff in the total number of colonies is accounted for (Model 3). When the cutoff is ignored (Model 2), the error increases substantially to 7.47%. The same trend is observed for the KL divergence in Equation 24, which increases from 0.13 when the cutoff is included to 1.73 when the cutoff is ignored. Similarly, for the dataset shown in Figure 4b, the relative error is 2.07% when the cutoff is considered, compared with 11.5% when it is not. The KL divergence likewise increases from 0.03 to 0.64 when the cutoff is ignored. Together, these results show that accounting for the cutoff is necessary to accurately reconstruct both the mode locations and the full population distribution. Full details of these calculations are available in our GitHub repository, Pessoa, 2026.

Appendix 2—figure 1. Decay of error metrics as the dataset size increases for the distributions shown in Figure 3.

Appendix 2—figure 1.

We show the relative error defined in Equation 23 (left) and the KL divergence defined in Equation 24 (right) for the distributions in Figure 3a, b. Both metrics decrease as the number of plates increases, indicating improved agreement between the REPOP reconstruction and the ground-truth.

Appendix 3

Escherichia coli culture for simulating different expected population peaks

An overnight culture of the OP50 strain of E. coli was grown in lysogeny broth (LB) media, and its optical density at 600 nm (OD600) was measured against an LB blank. The culture was concentrated to an expected 5X of OD600 = 1.0 by centrifugation and resuspension in phosphate-buffered saline (PBS). The 5X suspension was then diluted to an expected OD600 of 0.5, 0.1, and two at 0.01, with empirical OD600 values recorded against a PBS blank, which were 0.804, 0.188, 0.025, and 0.02. From the first three vials, we obtained 25 samples (each with 3 dilutions), while the last vial yielded 22 samples.

For each OD600 condition, serial dilutions were prepared to 1:100,000, 1:1,000,000, and 1:10,000,000 in PBS. A total of 90 µl from each dilution was plated onto LB agar, resulting in 75 plates per OD condition. Plates were incubated at 37°C for 18–24 hr before counting colony-forming units (CFUs) to estimate bacterial concentration.

Caenorhabditis elegans culture

The temperature-sensitive, reproductively sterile strain AU37 of C. elegans was cultivated and synchronized according to standard protocols (Eisenmann, 2005). Following the protocol described by Vega and Gore, 2017, synchronized eggs were cultivated at the non-permissive temperature of 25°C to produce sterile adult worms. These worms were then washed and transferred to a heat-killed E. coli OP50 suspension in S media supplemented with gentamicin for 24 hr to clear gut bacteria.

Once cleared of gut bacteria, worms were washed once with 10 ml M9 buffer containing 0.1% Triton X and twice with 10 ml M9 buffer. They were then transferred to a live bacterial suspension (E. coli OP50 at OD600 = 1.0 in 1 ml S media) for a duration of 3, 5, 7, or 9 days. Fresh bacterial suspension was provided at 24, 72, 120, and 168 hr (approximately every 48 hr after the initial 24-hr feeding).

On the designated sampling days for gut bacterial enumeration, worms were washed to remove non-adhered surface bacteria and manually disrupted following the protocol outlined in the section titled Disruption of Worms and Plating of Intestinal Populations of Vega and Gore, 2017. The resulting homogenate was serially diluted using a tenfold dilution series, with final expected dilution factors of 1:22, 1:222, and 1:2222 before plating. Colony-forming units were enumerated after incubating the plates for 24 hr.

Funding Statement

The funders had no role in study design, data collection, and interpretation, or the decision to submit the work for publication.

Contributor Information

Steve Presse, Email: spresse@asu.edu.

Anne-Florence Bitbol, Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.

Aleksandra M Walczak, CNRS, France.

Funding Information

This paper was supported by the following grants:

  • National Institutes of Health 35GM148237 to Steve Presse.

  • Army Research Office W911NF-23-1-0304 to Steve Presse.

  • National Science Foundation 2310610 to Steve Presse.

Additional information

Competing interests

No competing interests declared.

Author contributions

Conceptualization, Resources, Software, Formal analysis, Investigation, Writing – original draft, Writing – review and editing.

Investigation, Methodology, Writing – original draft, Writing – review and editing.

Resources, Data curation, Investigation, Visualization, Writing – original draft, Writing – review and editing.

Resources, Project administration.

Writing – original draft, Project administration.

Resources, Funding acquisition, Methodology, Writing – original draft, Writing – review and editing.

Additional files

MDAR checklist

Data availability

All data and code used in this study are publicly available at https://github.com/PessoaP/REPOP (Pessoa, 2026). The repository contains the experimental plate-count data analyzed in the manuscript, code for generating the synthetic datasets, the REPOP implementation, and scripts for reproducing the analyses and figures. No restrictions apply to data availability.

References

  1. Acuña Hidalgo B, Armitage SAO. Host resistance to bacterial infection varies over time, but is not affected by a previous exposure to the same pathogen. Frontiers in Physiology. 2022;13:860875. doi: 10.3389/fphys.2022.860875. [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Albaradei SA, Napolitano F, Uludag M, Thafar M, Napolitano S, Essack M, Bajic VB, Gao X. Automated counting of colony forming units using deep transfer learning from a model for congested scenes analysis. IEEE Access. 2020;8:164340–164346. doi: 10.1109/ACCESS.2020.3021656. [DOI] [Google Scholar]
  3. Armitage DW, Jones SE. How sample heterogeneity can obscure the signal of microbial interactions. The ISME Journal. 2019;13:2639–2646. doi: 10.1038/s41396-019-0463-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Bartram J, Cotruvo J, Exner M, Fricker C, Glasmacher A. Heterotrophic Plate Counts and Drinking-Water Safety. Genève, Switzerland: World Health Organization; 2003. [DOI] [Google Scholar]
  5. Blanchet FG, Cazelles K, Gravel D. Co-occurrence is not evidence of ecological interactions. Ecology Letters. 2020;23:1050–1063. doi: 10.1111/ele.13525. [DOI] [PubMed] [Google Scholar]
  6. Boddu SS, Martini KM, Nemenman I, Vega NM. Variance in C. elegans gut bacterial load suggests complex host-microbe dynamics. bioRxiv. 2024 doi: 10.1101/2024.12.09.627557. [DOI] [PMC free article] [PubMed]
  7. Bolanowski MA, Russell RL, Jacobson LA. Quantitative measures of aging in the nematode Caenorhabditis elegans. I. Population and longitudinal studies of two behavioral parameters. Mechanisms of Ageing and Development. 1981;15:279–295. doi: 10.1016/0047-6374(81)90136-6. [DOI] [PubMed] [Google Scholar]
  8. Bryan JS, Sgouralis I, Pressé S. Inferring effective forces for Langevin dynamics using Gaussian processes. The Journal of Chemical Physics. 2020;152:124106. doi: 10.1063/1.5144523. [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Chen JZ, Kwong Z, Gerardo NM, Vega NM. Ecological drift during colonization drives within-host and between-host heterogeneity in an animal-associated symbiont. PLOS Biology. 2024;22:e3002304. doi: 10.1371/journal.pbio.3002304. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Clemmons AW, Lindsay SA, Wasserman SA. An effector Peptide family required for Drosophila toll-mediated immunity. PLOS Pathogens. 2015;11:e1004876. doi: 10.1371/journal.ppat.1004876. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Corry JEL, Curtis GDW, Baird RM. Handbook of Culture Media for Food and Water Microbiology. The Royal Society of Chemistry; 2011. [Google Scholar]
  12. Davey H, Guyot S. Estimation of microbial viability using flow cytometry. Current Protocols in Cytometry. 2020;93:e72. doi: 10.1002/cpcy.72. [DOI] [PubMed] [Google Scholar]
  13. De Martino D. Maximum entropy modeling of metabolic networks by constraining growth-rate moments predicts coexistence of phenotypes. Physical Review. E. 2017;96:060401. doi: 10.1103/PhysRevE.96.060401. [DOI] [PubMed] [Google Scholar]
  14. Eisenmann DM. WormBook. 2005. [October 7, 2026]. http://www.wormbook.org
  15. Geissmann Q. OpenCFU, a new free and open-source software to count cell colonies and other circular objects. PLOS ONE. 2013;8:e54072. doi: 10.1371/journal.pone.0054072. [DOI] [PMC free article] [PubMed] [Google Scholar]
  16. Goberna M, Verdú M. Cautionary notes on the use of co-occurrence networks in soil ecology. Soil Biology and Biochemistry. 2022;166:108534. doi: 10.1016/j.soilbio.2021.108534. [DOI] [Google Scholar]
  17. Haldeman DL, Amy PS. Diversity within a colony morphotype: implications for ecological research. Applied and Environmental Microbiology. 1993;59:933–935. doi: 10.1128/aem.59.3.933-935.1993. [DOI] [PMC free article] [PubMed] [Google Scholar]
  18. Hansen SJZ, Tang P, Kiefer A, Galles K, Wong C, Morovic W. Droplet digital PCR is an improved alternative method for high-quality enumeration of viable probiotic strains. Frontiers in Microbiology. 2019;10:3025. doi: 10.3389/fmicb.2019.03025. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Huang C, Xiong C, Kornfeld K. Measurements of age-related changes of physiological processes that predict lifespan of Caenorhabditis elegans. PNAS. 2004;101:8084–8089. doi: 10.1073/pnas.0400848101. [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. International Organization for Standardization Microbiology of the food chain -— horizontal method for the enumeration of microorganisms —- part 2: colony count at 30 degrees c by the surface plating technique. Geneva, CH 2013
  21. Jazani S, Sgouralis I, Pressé S. A method for single molecule tracking using a conventional single-focus confocal setup. The Journal of Chemical Physics. 2019;150:114108. doi: 10.1063/1.5083869. [DOI] [PubMed] [Google Scholar]
  22. Kalli M, Griffin JE, Walker SG. Slice sampling mixture models. Statistics and Computing. 2011;21:93–105. doi: 10.1007/s11222-009-9150-y. [DOI] [Google Scholar]
  23. Khan A, Torelli A, Wolf I, Gretz N. AutoCellSeg: robust automatic colony forming unit (CFU)/cell analysis using adaptive image segmentation and easy-to-use post-editing techniques. Scientific Reports. 2018;8:7302. doi: 10.1038/s41598-018-24916-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  24. Kilic Z, Sgouralis I, Pressé S. Generalizing HMMs to continuous time for fast kinetics: hidden markov jump processes. Biophysical Journal. 2021;120:409–423. doi: 10.1016/j.bpj.2020.12.022. [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Kilic Z, Schweiger M, Moyer C, Shepherd D, Pressé S. Gene expression model inference from snapshot RNA data using Bayesian non-parametrics. Nature Computational Science. 2023;3:174–183. doi: 10.1038/s43588-022-00392-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Lu CY, Tashev SA, Pessoa P, Kruithoff R, Shepherd DP, Presse S. Stochastic colonization and host-to-host transmission shape gut bacterial variability. bioRxiv. 2026 doi: 10.64898/2026.05.11.724410. [DOI]
  27. Maeda Y, Dobashi H, Sugiyama Y, Saeki T, Lim T-K, Harada M, Matsunaga T, Yoshino T, Tanaka T. Colony fingerprint for discrimination of microbial species based on lensless imaging of microcolonies. PLOS ONE. 2017;12:e0174723. doi: 10.1371/journal.pone.0174723. [DOI] [PMC free article] [PubMed] [Google Scholar]
  28. Mao J, Lu T. Population-dynamic modeling of bacterial horizontal gene transfer by natural transformation. Biophysical Journal. 2016;110:258–268. doi: 10.1016/j.bpj.2015.11.033. [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Marine E, Milner DS, Lambert C, Sockett RE, Pos KM. A novel method to determine antibiotic sensitivity in Bdellovibrio bacteriovorus reveals a DHFR-dependent natural trimethoprim resistance. Scientific Reports. 2020;10:5315. doi: 10.1038/s41598-020-62014-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Martini KM, Boddu SS, Nemenman I, Vega NM. Maximum likelihood estimators for colony-forming units. Microbiology Spectrum. 2024;12:e0394623. doi: 10.1128/spectrum.03946-23. [DOI] [PMC free article] [PubMed] [Google Scholar]
  31. Martino DD, Capuani F, Martino AD. Growth against entropy in bacterial metabolism: the phenotypic trade-off behind empirical growth rate distributions in E. coli. Physical Biology. 2016;13:036005. doi: 10.1088/1478-3975/13/3/036005. [DOI] [PubMed] [Google Scholar]
  32. Moore LS, Stolovicki E, Braun E. Population dynamics of metastable growth-rate phenotypes. PLOS ONE. 2013;8:e81671. doi: 10.1371/journal.pone.0081671. [DOI] [PMC free article] [PubMed] [Google Scholar]
  33. Muntoni AP, Braunstein A, Pagnani A, De Martino D, De Martino A. Relationship between fitness and heterogeneity in exponentially growing microbial populations. Biophysical Journal. 2022;121:1919–1930. doi: 10.1016/j.bpj.2022.04.012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  34. Paszke A, Gross S, Massa F, Lerer A, Bradbury J, Chanan G, Killeen T, Lin Z, Gimelshein N, Antiga L, Desmaison A, Kopf A, Yang E, DeVito Z, Raison M, Tejani A, Chilamkurthy S, Steiner B, Fang L, Bai J. In: Advances in Neural Information Processing Systems. Wallach H, Larochelle H, Beygelzimer A, d’Alché-Buc F, Fox E, Garnett R, editors. Curran Associates, Inc; 2019. PyTorch: an imperative style, high-performance deep learning library; pp. 8026–8037. [Google Scholar]
  35. Pecht T, Aschenbrenner AC, Ulas T, Succurro A. Modeling population heterogeneity from microbial communities to immune response in cells. Cellular and Molecular Life Sciences. 2020;77:415–432. doi: 10.1007/s00018-019-03378-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  36. Pessoa P, Schweiger M, Pressé S. Avoiding matrix exponentials for large transition rate matrices. The Journal of Chemical Physics. 2024;160:094109. doi: 10.1063/5.0190527. [DOI] [PMC free article] [PubMed] [Google Scholar]
  37. Pessoa P, Schweiger M, Xu LWQ, Manha T, Saurabh A, Camarena JA, Pressé S. Avoiding subtraction and division of stochastic signals using normalizing flows: NFdeconvolve. iScience. 2025;28:113823. doi: 10.1016/j.isci.2025.113823. [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Pessoa P. REPOP. cdfb1bcGithub. 2026 https://github.com/PessoaP/REPOP
  39. Pinto S, Benincà E, van Nes EH, Scheffer M, Bogaards JA. Species abundance correlations carry limited information about microbial network interactions. PLOS Computational Biology. 2022;18:e1010491. doi: 10.1371/journal.pcbi.1010491. [DOI] [PMC free article] [PubMed] [Google Scholar]
  40. Pressé S, Ghosh K, Phillips R, Dill KA. Dynamical fluctuations in biochemical reactions and cycles. Physical Review E. 2010;82:031905. doi: 10.1103/PhysRevE.82.031905. [DOI] [PubMed] [Google Scholar]
  41. Pressé S, Sgouralis I. Data Modeling for the Sciences: Applications, Basics, Computations. Cambridge University Press; 2023. [DOI] [Google Scholar]
  42. Qamer S, Sandoe JAT, Kerr KG. Use of colony morphology to distinguish different enterococcal strains and species in mixed culture from clinical specimens. Journal of Clinical Microbiology. 2003;41:2644–2646. doi: 10.1128/JCM.41.6.2644-2646.2003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  43. Sgouralis I, Xu LWQ, Jalihal AP, Kilic Z, Walter NG, Pressé S. BNP-Track: a framework for superresolved tracking. Nature Methods. 2024;21:1716–1724. doi: 10.1038/s41592-024-02349-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  44. Smith H, Brown A. Benson’s Microbiological Applications Laboratory Manual. McGraw-Hill Education; 2021. [Google Scholar]
  45. Some S, Mondal R, Mitra D, Jain D, Verma D, Das S. Microbial pollution of water with special reference to coliform bacteria and their nexus with environment. Energy Nexus. 2021;1:100008. doi: 10.1016/j.nexus.2021.100008. [DOI] [Google Scholar]
  46. Sun Q, Huynh K, Muratovic D, Gunn NJ, Zelmer AR, Solomon LB, Atkins GJ, Yang D. Beyond the colony-forming-unit: rapid bacterial evaluation in osteomyelitis. eLife. 2024;13:RP93698. doi: 10.7554/eLife.93698.2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  47. Taimur MM, Acevedo R, Sklar LA, Thomsen K, Tegos GP, Camper AK. Rapid identification of bacterial viability, culturable and non-culturable stages by using flow cytometry. Protocol Exchange. 2020 doi: 10.21203/rs.3.pex-1153/v1. [DOI]
  48. Tamargo A, Molinero N, Reinosa JJ, Alcolea-Rodriguez V, Portela R, Bañares MA, Fernández JF, Moreno-Arribas MV. PET microplastics affect human gut microbiota communities during simulated gastrointestinal digestion, first evidence of plausible polymer biodegradation during human digestion. Scientific Reports. 2022;12:528. doi: 10.1038/s41598-021-04489-w. [DOI] [PMC free article] [PubMed] [Google Scholar]
  49. Tavakoli M, Jazani S, Sgouralis I, Heo W, Ishii K, Tahara T, Pressé S. Direct photon-by-photon analysis of time-resolved pulsed excitation data using bayesian nonparametrics. Cell Reports. Physical Science. 2020;1:100234. doi: 10.1016/j.xcrp.2020.100234. [DOI] [PMC free article] [PubMed] [Google Scholar]
  50. Taylor MN, Spandana Boddu S, Vega NM. Using single-worm data to quantify heterogeneity in Caenorhabditis elegans-bacterial interactions. Journal of Visualized Experiments. 2022;185:e64027. doi: 10.3791/64027. [DOI] [PubMed] [Google Scholar]
  51. Taylor MN, Vega NM. Sample pooling inflates error rates in between-sample comparisons: an empirical investigation of the statistical properties of count-based data. bioRxiv. 2024 doi: 10.1101/2022.07.25.501406. [DOI]
  52. Tracey H, Coates N, Hulme E, John D, Michael DR, Plummer SF. Insights into the enumeration of mixtures of probiotic bacteria by flow cytometry. BMC Microbiology. 2023;23:48. doi: 10.1186/s12866-023-02792-2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  53. Van Nevel S, Koetzsch S, Proctor CR, Besmer MD, Prest EI, Vrouwenvelder JS, Knezev A, Boon N, Hammes F. Flow cytometric bacterial cell counts challenge conventional heterotrophic plate counts for routine microbiological drinking water monitoring. Water Research. 2017;113:191–206. doi: 10.1016/j.watres.2017.01.065. [DOI] [PubMed] [Google Scholar]
  54. Veening J-W, Smits WK, Kuipers OP. Bistability, epigenetics, and bet-hedging in bacteria. Annual Review of Microbiology. 2008;62:193–210. doi: 10.1146/annurev.micro.62.081307.163002. [DOI] [PubMed] [Google Scholar]
  55. Vega NM, Gore J. Stochastic assembly produces heterogeneous communities in the Caenorhabditis elegans intestine. PLOS Biology. 2017;15:e2000633. doi: 10.1371/journal.pbio.2000633. [DOI] [PMC free article] [PubMed] [Google Scholar]
  56. Vertti-Quintero N, Berger S, Casadevall I Solvas X, Statzer C, Annis J, Ruppen P, Stavrakis S, Ewald CY, Gunawan R, deMello AJ. Stochastic and age-dependent proteostasis decline underlies heterogeneity in heat-shock response dynamics. Small. 2021;17:e2102145. doi: 10.1002/smll.202102145. [DOI] [PubMed] [Google Scholar]
  57. Vial SL, Doerscher DR, Hedberg CW, Stone WA, Whisenant SJ, Schroeder CM. Microbiological testing results of boneless and ground beef purchased for the U.S. national school lunch program, school years 2015 to 2018. Journal of Food Protection. 2019;82:1761–1768. doi: 10.4315/0362-028X.JFP-19-241. [DOI] [PubMed] [Google Scholar]
  58. Walker SG. Sampling the dirichlet mixture model with slices. Communications in Statistics - Simulation and Computation. 2007;36:45–54. doi: 10.1080/03610910601096262. [DOI] [Google Scholar]
  59. Wang X, Cao Z, Zhang M, Meng L, Ming Z, Liu J. Bioinspired oral delivery of gut microbiota by self-coating with biofilms. Science Advances. 2020;6:1472. doi: 10.1126/sciadv.abb1952. [DOI] [PMC free article] [PubMed] [Google Scholar]
  60. Weitzel MLJ, Vegge CS, Pane M, Goldman VS, Koshy B, Porsby CH, Burguière P, Schoeni JL. Improving and comparing probiotic plate count methods by analytical procedure lifecycle management. Frontiers in Microbiology. 2021;12:693066. doi: 10.3389/fmicb.2021.693066. [DOI] [PMC free article] [PubMed] [Google Scholar]
  61. Werner J, Pietsch T, Hilker FM, Arndt H. Intrinsic nonlinear dynamics drive single-species systems. PNAS. 2022;119:e2209601119. doi: 10.1073/pnas.2209601119. [DOI] [PMC free article] [PubMed] [Google Scholar]
  62. Wilkinson MG. Flow cytometry as a potential method of measuring bacterial viability in probiotic products: A review. Trends in Food Science & Technology. 2018;78:1–10. doi: 10.1016/j.tifs.2018.05.006. [DOI] [Google Scholar]
  63. Wu D, Rea SL, Yashin AI, Johnson TE. Visualizing hidden heterogeneity in isogenic populations of C. elegans. Experimental Gerontology. 2006;41:261–270. doi: 10.1016/j.exger.2006.01.003. [DOI] [PubMed] [Google Scholar]
  64. Yashin AI, Cypser JW, Johnson TE, Michalski AI, Boyko SI, Novoseltsev VN. Heat shock changes the heterogeneity distribution in populations of Caenorhabditis elegans: does it tell us anything about the biological mechanism of stress response? The Journals of Gerontology. Series A, Biological Sciences and Medical Sciences. 2002;57:B83–B92. doi: 10.1093/gerona/57.3.b83. [DOI] [PubMed] [Google Scholar]
  65. Zhang J, Li C, Rahaman MM, Yao Y, Ma P, Zhang J, Zhao X, Jiang T, Grzegorzek M. A comprehensive review of image analysis methods for microorganism counting: from classical image processing to deep learning approaches. Artificial Intelligence Review. 2022;55:2875–2944. doi: 10.1007/s10462-021-10082-4. [DOI] [PMC free article] [PubMed] [Google Scholar]

eLife Assessment

Anne-Florence Bitbol 1

This important study introduces a Bayesian method to determine bacterial counts that accounts for the experimental noise inherent to dilution and plating methods and distinguishes it from biological uncertainty. The evidence supporting the conclusions is compelling, combining simulated data and experimental data. The method will be of interest to microbial ecologists, and potentially to the broader community interested in inference from biological data, even more so if the domain of application and the limitations are further clarified.

Reviewer #1 (Public review):

Anonymous

Summary:

The authors developed a novel theoretical/computational procedure to count bacterial populations without introducing artificial randomness effects due to dilution. Surprisingly, this very important aspect of studies of bacterial systems has been overlooked. The proposed method provides a simple and transparent approach to eliminate the randomness of bacterial accounting procedures, allowing now to fully concentrate on the intrinsic effects of the studied systems.

Strengths:

A very simple and clear procedure is introduced and explained in full detail. This elegant approach finds an excellent compromise between mathematical rigor and computational efficiency, which is important for practical applications. The provided examples are convincing beyond a doubt, clearly indicating the potential strong impact of the proposed framework. Various complications and possible issues are also discussed and analyzed. This seems to be a very powerful novel method that should significantly advance the analysis of complex biological systems.

Weaknesses:

The only minor weakness that I found is the assumption of independence of bacterial species, which is expressed as the well-stirred approximation. One could imagine that bacterial species might cooperate, leading to non-uniform distributions that are readerivedl. How to distinguish such situations?

I believe that this method can be extended to determine if this is the case or not before the application. For example, if the bacteria species are independent of each other and one can use the binomial distributions - then the Fano factor would be proportional to the overall relative fraction of bacterial species. Maybe a simple test can be added to test it before the application of REPOP. However, I believe that this is a minor issue.

Comments on revised version.

I am satisfied with the correction proposed by the authors. The method is already quite impressive, and there is no need to complicate it at this stage.

Reviewer #2 (Public review):

Anonymous

I appreciate the thorough responses from the authors, which address my concerns. The expansion of Appendix B as well as the addition of text discussing how the REPOP method interacts with data collection efforts are very useful. These new sections show that relative error decreases with increasing samples, as expected, yet these error metrics, including KL divergence, describing the fit of the full distributions not just the modes, drop off fairly quickly with increasing number of samples showing that REPOP likely minimizes discrepancies between estimated and true distributions even at lower sampling efforts.

Additionally, the extension of the REPOP method to the quantification of multiple bacterial species or phenotypes shows the potential utility of the method in contexts beyond basic plate counts. Between this example and the additional information on how to implement REPOP, I believe this workflow will be attractive and accessible to the audience.

eLife. 2026 Oct 9;14:RP107122. doi: 10.7554/eLife.107122.3.sa3

Author response

Pedro Pessoa 1, Carol Yunxiao Slayton 2, Stanimir Asenov Tashev 3, Rory Kruithoff 4, Doug P Shepherd 5, Steve Presse 6

The following is the authors’ response to the original reviews.

Public Reviews:

Reviewer #1 (Public review):

(R1C1) The only minor weakness that I found is the assumption of independence of bacterial species, which is expressed as the well-stirred approximation. One could imagine that bacterial species might cooperate, leading to non-uniform distributions that are real. How to distinguish such situations?

I believe that this method can be extended to determine if this is the case or not before the application. For example, if the bacteria species are independent of each other and one can use the binomial distributions, then the Fano factor would be proportional to the overall relative fraction of bacterial species. Maybe a simple test can be added to test it before the application of REPOP. However, I believe that this is a minor issue.

This is an interesting point raised by the reviewer.

First, we need to clarify an important point: we do not make a well-stirred assumption. Samples can be drawn and plated from any region of space however small and that region’s population can be quantified using our method. The stirring only occurs after we collect a sample in order to dilute the contents and pour the solution homogeneously over the plate.

As such, learning multiple independent species is possible and not impacted by the dilution (“well-stirred” assumption). In the new first paragraph of the methods section, we made it clear that this assumption concerns the dilution process. REPOP is designed to recover the true underlying heterogeneity in species abundance (even from limited data) by leveraging a Bayesian framework that remains valid regardless of whether species are independent or correlated.

If the method is applied to multiple species as currently implemented, REPOP can recover the marginal distribution of each species, provided that the species are either selectively cultured or produce sufficiently distinguishable colonies on the same plate. To demonstrate this, we have added a new Results subsection with a synthetic two-species example in which the species abundances are correlated across samples.

However, in order to learn the joint distribution and capture correlations between species within samples, the method would need to be extended. At present, in Eq. 5 we sum the likelihood over all values of n, using a data-driven cutoff (twice the largest naïvely estimated count times the dilution factor). Extending this to multiple species adding up to (n1,n2), while retain the generality of the method, would require quadratically scaling memory with this cutoff in the population number. For this reason while we comment on this in the new paragraph in the conclusion, it is not implemented as part of REPOP.

Reviewer #2 (Public review):

(R2C1) A more thorough discussion of when and by how much estimated microbial population abundance distributions differ from the ground truth would be helpful in determining the best practices for applying this method. Not only would this allow researchers to understand the sampling effort necessary to achieve the results presented here, but it would also contextualize the experimental results presented in the paper. Particularly, there is a disconnect between the discussion of the large sample sizes necessary to achieve accurate multimodal distribution estimates and the small sample sizes used in both experiments.

That is a great suggestion from the reviewer. To address it, we expanded Appendix B. We know report (1) the relative error in the estimated means (as already done for Fig. 4 formally 3), and (2) the Kullback-Leibler (KL) divergence between the reconstructed and ground-truth distributions. These metrics will are show as a function of the size of the dataset, for the examples in Fig 3. enabling a direct assessment of how the sampling effort affects the precision of the inference.

That said, we now highlight in the Conclusion that, by explicitly modeling the dilution process within a Bayesian framework, REPOP extracts the maximum information available from each individual sample at a given sample size. This strategy therefore enables more accurate inference with fewer measurements, which is particularly important in applications such as plate counting, where data acquisition is labour-intensive.

Reviewer #3 (Public review):

(R3C1) While the study is promising, there are a few areas where the paper could be strengthened to increase its impact and usability. First, the extent to which dilution and plating introduce noise is not fully explored. Could this noise significantly affect experimental conclusions? And under what conditions does it matter most? Does it depend on experimental design or specific parameter values? Clarifying this would help readers appreciate when and why REPOP should be used.

We agree with the reviewer that this is an important point, and we expanded Appendix B to include a quantitative analysis using simulated data (Fig. 3, formely 2), reporting both relative error and KL divergence as a function of dataset size. This complements our response to R2C1 clarifying when REPOP offers the greatest benefit.

In addition, we will expand the discussion on how modeling dilution noise becomes essential when learning population dynamics. In particular, we emphasize? the role of Model 3, especially relevant when working with multiple plates and approaching the asymptotic regime; an aspect that was alluded to in Fig. 3 but not fully explored.

(R3C2) Second, more practical details about the tool itself would be very helpful. Simply stating that it is available on GitHub may not be enough. Readers will want to know what programming language it uses, what the input data should look like, and ideally, see a step-by-step diagram of the workflow. Packaging the tool as an easy-to-use resource, perhaps even submitting it to CRAN or including example scripts, would go a long way, especially since microbiologists tend to favor user-friendly, recipe-like solutions.

In the new paragraphs of the introduction, we made clear that REPOP is written in Python (PyTorch), installable via pip, and designed for ease of use. We are also expanding the tutorials to include clearer guidance on data formatting and common workflows. The new workflow figure (Fig 2) better illustrates the full process.

(R3C3) Third, it would be great to see the method tested on existing datasets, such as those from Nic Vega and Jeff Gore (2017), which explore how colonization frequency impacts abundance fluctuation distributions. Even if the general conclusions remain unchanged, showing that REPOP can better match observed patterns would strengthen the paper’s real-world relevance.

We thank the reviewer for this interesting suggestion. We agree that applying REPOP to additional existing datasets would make REPOP’s relevance clearer. However, the Vega and Gore datasets lack the information required. REPOP requires the plate count measurement process to be specified, including the dilution factors used for each measurement. Furthermore, we can leverage on additional information about the experimental procedure when the colony cutoffs and dilution schedules used are reported. Without the dilution factors, the likelihood connecting the observed colony counts to the underlying population size is not possible. We hope this clarification will help make future datasets made available publicly more useful for purposes of uncertainty propagation.

(R3C4) Lastly, it would be helpful for the authors to briefly discuss the limitations of their method, as no approach is without its constraints. Acknowledging these would provide a more balanced and transparent perspective.

We agree with the reviewer. We have added two new paragraphs to the conclusion highlighting important current constraints and future development directions of the framework. In particular, we now discuss that, in its present implementation, REPOP focuses on the population distribution that maximizes the posterior, rather than returning posterior uncertainty over the reconstructed distributions themselves. We also note the computational demands of the method, making GPU acceleration highly beneficial and more complex multi-population inference computationally challenging. This discussion synthesizes points raised throughout our response to R1C1 and the reviewers and provides a more balanced perspective on the current scope of the method.

Associated Data

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

    Supplementary Materials

    MDAR checklist

    Data Availability Statement

    All data and code used in this study are publicly available at https://github.com/PessoaP/REPOP (Pessoa, 2026). The repository contains the experimental plate-count data analyzed in the manuscript, code for generating the synthetic datasets, the REPOP implementation, and scripts for reproducing the analyses and figures. No restrictions apply to data availability.


    Articles from eLife are provided here courtesy of eLife Sciences Publications, Ltd

    RESOURCES