返回资讯中心
外部精选
软件工程
#开发者实时流

A Beer Brewer's Noise Estimation

As a control for my bioreactor trials, I aim to get a constant number of algae cells in every experiment I do. To do this, I have to count the number of algae colonies in a given volume of water, to get a concentration.…

Hacker News 最新surprisetalk2026/11/23 · 今天18 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

5

1

Share

As a control for my bioreactor trials, I aim to get a constant number of algae cells in every experiment I do. To do this, I have to count the number of algae colonies in a given volume of water, to get a concentration. Both the number and the volume are susceptible to error, which I will discuss.

One cheap approach to estimate a concentration of cells with a microscope is to use use a hemocytometer. I got one last time, thanks to suggestions by Kevin Lynagh and David Jordan. The hemocytometer is a slide with dips and a visible has a grid that lets me count the number of cells across a fixed length on the x and y axes. It also comes with a depth of 0.1 mm when used with a 0.4 mm coverslip¹.

The side view of a hemocytometer

The grid etched on the hemocytometer

For my first trial I’m using Scenedesmus quadricauda from Blades Biological. It's probably safe. I pipetted it onto my hemocytometer, put the coverslip on and used my Swift microscope.

I used a new disposable pipette to put it on the sample.

I connected the Swift microscope to my computer and then took the following images.

This is what a single colony looks like. It is usually made out of 4 cells, but if you look closely the number of cells in a colony can vary.

I wanted to use these images to count the number of colonies. I got Claude to write a script to count the dark spots, which are the algae colonies. The procedure it used is in the footnote below².

There are 14 squares where I've counted the number of algae organisms. Each square is 0.2 mm × 0.2 mm. The volume per square is 0.2 mm × 0.2 mm × 0.1 mm = 0.004 mm³ = 4 nL.

We've counted 27 algae colonies. This means that a point estimate for the concentration of our algae is 27 / (14 × 4 nL) = 27 / 56 nL = 4.8 × 10⁵ colonies per mL.

We can never know the exact, true value of what the concentration is. This is just a point estimate. And in experiments, these measurements have noise and uncertainty. Experiments have multiple sources of uncertainty. In my bioreactor experiment, it could come from a faulty CO2 or O2 sensor. Or a wrong optical density measurement.

Now, it would be impossible and impractical to eliminate all uncertainty. But, we should at least guess the magnitude of uncertainty at each step of our protocol. If we do this, we can get a sense for the biggest uncertainties that we need to eliminate.

And so let's try to find an uncertainty band around this estimate of our algae concentration.

The first naive method would be to just guess subjective uncertainty bounds. I could just say, based on gut feel, that the concentration has a higher and lower band of 20%. But we can do slightly better than this. One of the earliest methods was made by William Sealy Gosset at the Guinness brewery, who tried to estimate the uncertainty bands around the number of yeast cells present in the brewing mixture. The original paper was Student (1907), On the error of counting with a haemacytometer, Biometrika 5, 351–360. Gosset was originally anonymously credited as 'Student' in the original paper, because Guinness didn't want to reveal the methods it was using to brew its stuff.

Gosset uses a hemocytometer to count cells in a volume, and then estimates a quantity called the standard error. The interpretation of standard error is the following. Suppose that we repeated the sampling procedure several times under the same conditions. The standard error is the spread of the estimates we would get.

Here is a sketch of Gosset's approach. It is general enough to calculate standard errors for other distributions too.

First, we label the true values in the problem. The full sample in the bottle, which has a fixed volume V, contains some true number of colonies. Suppose we split the bottle into N thin squares, each with volume V / N, and set the true value of the number of colonies as cV, where c is the true concentration.

To obtain an estimate for c, we need to design an estimator. An estimator is a way of sampling our system to find a parameter.

It would be impractical to count every single colony in our full volume. So in our case, one estimator we can make is to look at one of the squares above and count the number of colonies we see. We then divide by the volume V, which we assume is known, to get the concentration. The next step is to calculate the statistical properties of this estimator.

Given that we have cV colonies, what is the likelihood that we observe r colonies in a given square that we select? The probability that a given colony lands in chosen square is 1/N. The odds of r colonies appearing in a square are given the binomial theorem, which is

Now, if we take the limit as N gets large, it turns out that the probability converges to an easy expression. The details of this limit are in Gosset's paper³. The probability of getting r colonies in a selected square as N gets large becomes

This is known as a Poisson distribution. The average of a distribution is the sum of its set of values multiplied by the probability that it gets the value. Doing this for the Poisson distribution, we find that the average of our estimate r is given by

If we take multiple counts on separate occasions using our hemocytometer, then on average, r is the concentration multiplied by the volume we have sampled.

This makes sense. The formula is saying that the average of our estimator is the true concentration, multiplied by the scaled volume of the sample we collected. And since we know the volume we have collected, calculating the concentration is just a matter of taking r and dividing it by our known volume.

In our case the "selected square" is the 14 hemocytometer squares I counted together, with v = 56 nL, and the number we've counted was 27.

To get the standard error, we want to know how much a sample count would deviate over multiple trials. Now we know the distribution of the estimator is Poisson, we can calculate the standard deviation by calculating the standard deviation of a general Poisson distribution.

The standard deviation is the square root of the variance.

To calculate this, we need to find the expected value of r². To do this, we use a trick and calculate the expected value of r(r-1), since it factorises out nicely.

We don't know m, so we estimate it with the one count we have m̂ = r, giving σ_r ≈√(r). The concentration estimate is ĉ = r / v, so its standard error is

For our count, r = 27 in v = 56 nL. And √(27) ≈5.2. Therefore, our

The volume I need to pipette to get a target number of colonies n is v_pipette = n / ĉ. Since n is fixed, the relative error in the volume is the same 19 % as the relative error in the concentration; the pipette's own error (about 1 % for a 1 mL pipette) is negligible beside it. For a million colonies:

Student (W. S. Gosset), 1907. On the error of counting with a haemacytometer. Biometrika 5 (3), 351–360. doi:10.2307/2331633. PDF

¹ I learned that standard 0.1 mm coverslips don't work because the capillary effect moves the coverslip in.

³ Student (W. S. Gosset), 1907. On the error of counting with a haemacytometer. Biometrika 5 (3), 351–360. doi:10.2307/2331633. PDF

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →