Bioprotocols / labop

Laboratory Open Protocol (LabOP) Language
MIT License
40 stars 11 forks source link

Handling and/or propagation of uncertainties #178

Open photocyte opened 1 year ago

photocyte commented 1 year ago

Hi there folks, hope our US team members had a great Thanksgiving! And for everyone else, hope you had a great Thursday of last week ;)

Wanted to raise this idea of handling and/or propagation of measurement uncertainties. Is that something that could fit into LabOP executed protocols?

See here for a relevant discussion around the concept, and an example library in the Python ecosystem: https://twitter.com/MoseGiordano/status/1595116178070175744

https://github.com/lebigot/uncertainties/

Don't know if there are alternative libraries worth looking into.

jakebeal commented 1 year ago

I think it's important to realize that "uncertainty" means many different things as well as many different distributions, and that a one-size-fits-all approach is unlikely to be workable.

I would suggest that we take specific use cases as motivators for figuring out any path and scheduling around it.

photocyte commented 1 year ago

Good point!

For reference, I brushed off my Analytical Chemistry textbook [Harris, D.C., and Lucy, C.A. (2016). Quantitative chemical analysis Ninth edition. (W.H. Freeman & Company)]. Chapter 3, and Appendix B (Harris and Lucy, 2016) seem to be the relevant sections. That source has been my exclusive introduction to measurement uncertainty and propagation of uncertainty. That being said, a quick search of (Harris and Lucy, 2016) doesn't seem to suggest they've treated anything other than Gaussian uncertainty propagation.

As a student I did these propagations, but as a professional scientist doing analytical chemistry, I've never had to actually think about measurement uncertainty - i.e. a reviewer has never requested it's propagation be done across a stated process. But I imagine a first-class treatment of measurement uncertainty and it's propagation in LabOP, would be much appreciated by regulated industries. I agree, it's probably not a "top-ticket" issue.

I'd be curious if you have a reference in mind for the "higher complexity" uncertainty distributions & their propagation? Just for my own curiosity. Imagine NIST would be the experts in this...

As for a specific use case, here is one: Let's say we want to do a serial dilution on the OT-2, of IPTG. The starting IPTG stock, might be 500 mM +/- 5 mM. If we pipette to serial dilute that stock 10x times, and knowing that the OT-2 pipette accuracy at the transferred volumes is 1%, what is the propagated uncertainty of the IPTG concentration in the lowest dilution? Just an example - point is: If LabOP automatically managed these propagation, would be a nice & scientifically useful feature.

jakebeal commented 1 year ago

The first major challenge you have is in identifying what "+/- 5 mM" actually means. Is it one standard deviation or two standard deviations of a Gaussian distribution? Or is it actually a bound, e.g., as an output of a quality control process that would flag exceptions on anything beyond these values. The latter doesn't actually imply a distribution at all, although in many cases people will incorrectly treat a bound as implying a distribution.

photocyte commented 1 year ago

I agree, however the perfect may be the enemy of the good in this case :) A bench scientist, is not going to have a strong basis for that +/- 5 mM measure. They're just going to ball park and say, eh my balance or my pipettes might be off by 5% or so, so let's just call this +/- 5 mM (probably the closest interpretation is a bound, as they're not making multiple stocks & thinking about distributions true concentrations across multiple stocks). Gets into the random error vs systematic error distinction.

I think one of the big realizations in my training is that - basically all of biochemical work follows this "good enough" approach to accuracy and uncertainty - it's an understandable response, given the incredible variability of biology!

Tooling to help people get outside that mindset, might be appreciated.

photocyte commented 1 year ago

I came across this Mastodon post: https://fediscience.org/@StephanMatthiesen@troet.cafe/110332533225600148

Which led me to: https://us.flukecal.com/blog/introduction-iso-guide-expression-uncertainty-measurement-gum

And, finally, the ISO Guide to Expressing Uncertainty Guide (GUM): https://www.bipm.org/en/committees/jc/jcgm/publications/

So, seems there are some great resources out there on this topic (which I just learned about & wanted to share, if people weren't already aware)