Mixology: a tool for calculating required masses and volumes for laboratory solutions

Laboratory work often requires making up solutions with defined concentrations of various components. Mixology is a tool we have created to simplify calculation of the masses and volumes required to obtain particular concentrations. It operates with many kinds of volumetric, mass and concentration units, including conversion between molarity- and mass-based concentrations using molecular masses retrieved from the Chemical Entities of Biological Interest (ChEBI) database. Mixology can be accessed at https://mixology.science.


Introduction
Performing calculations to make up solutions is one of the first skills that a laboratory researcher learns. Despite efforts to facilitate sharing of laboratory protocols 1 , solutions are often described in publications only in terms of the molarities of their constituent parts, meaning that calculations are needed to determine the absolute amounts needed to make up some defined volume. These calculations can be surprisingly lengthy.
Suppose a researcher is implementing a new protocol, and needs to make a buffer containing, amongst other ingredients, "500 μg/ml sodium chloride". She wants to make up 2 litres of the new buffer. On her bench she happens to already have a stock solution labelled "1.5 M NaCl". What volume of stock solution does she need to add for the new buffer? One approach that she might follow to calculate this would be to: If her buffer contains five different such ingredients, she might need to perform a similar set of steps five times, requiring perhaps 35 individual steps. If an error occurs in just one of these, the final buffer will not be to the expected specification.
We decided to build a simple tool to perform calculations such as these ( Figure 1). Mixology automates the retrieval of molecular masses, and the mathematical operations needed to calculate the required masses of reagent, or volumes of stock solutions, needed for desired final concentrations.

Implementation
Mixology provides a simple interface to record the specifications of a solution and calculate the required amount of each ingredient ( Figure 1). A user first enters the volume of the solution they want to make, and a descriptive name. Then they add any number of components to the solution. For each component, they enter a desired final concentration. Concentrations can be entered in any of several unit forms: • mass-based: g/ml, μg/ml, mg/l, % (w/v), etc.
The user also enters the name of the chemical. Chemical names are autocompleted with known entities from the Chemical Entities of Biological Interest (ChEBI) database 2 . Where a known chemical is entered, its molecular mass is inferred from the ChEBI database. Alternatively a custom compound name can be entered, and a molecular mass (if needed) entered manually.
If the desired concentration is mass-or molarity-based, the user can select whether to weigh out the compound (mass units) or to measure out a volume of stock solution (with a mass-or molarity-based stock concentration). If the desired concentration is volumetric, a volume of stock solution (which can be 100% (v/v)) is required.
In either case, the user enters the units of mass or volume to weigh out, and Mixology automatically calculates the quantity of this unit required to make up the final volume at the desired concentration ( Figure 2).  The user can add as many components as required, and also add notes, which might contain instructions such as "adjust pH to 7.2". Finally they can create a 'permalink' pointing to their solution, creating a unique URL for the solution that can be saved and shared.

Operation
The code behind Mixology is available in our GitHub repository 3 .
Mixology is developed with the Vue.js framework. This allows reactive behaviour in which all fields are updated in real time as others are changed. We use the vue-simple-suggest component 4 to list available units and chemical entities from ChEBI. Mixology has been tested on recent versions of Chrome, Firefox and Safari.
All concentration terms are converted into a standard format consisting of some quantity (moles, grams, litres, activity units) per litre, facilitating downstream steps. Mol/l and g/l can be interconverted using the molecular mass, but these cannot be interconverted to the other unit types (volumetric and activity units).
Molecular masses, and compound names for autocompletion, are taken from ChEBI 2 . ChEBI entities are processed into JSON with a custom R notebook, available in our GitHub repository, using R and the tidyverse 5,6 . We take as input ChEBI's three-star chemicals, which are those that have been curated. We exclude any name that is mapped to multiple distinct chemicals to avoid potential confusion. Sometimes multiple mass measurements are available for a chemical in ChEBI. Normally these are extremely similar, so we exclude only chemicals for which the standard deviation of masses is greater than 0.001.
Recipes can be saved using a "permalink" feature. This deposits a copy of the recipe in JSON format into an external Firebase database, with a unique identifier which can be used to retrieve it at the correct URL.

Discussion
We have created a simple tool which we hope will be useful to laboratory scientists. In the day following Mixology's release on Twitter, a user testing it identified an inconsistency with the calculations in a published protocol 7 . This turned out not to be a problem with the tool, but the use of an incorrect molar mass (hydrated vs. anhydrate) for calculations in the official protocol. This provides one example of how easily small mistakes can occur performing these operations manually.
Mixology has some limitations. It cannot currently perform any calculations which would require knowing the density of a substance (interconversion between mass and purely volumetric units). Additionally, it does not provide the facility to calculate quantities required to obtain a particular pH or osmolarity. We welcome feature suggestions and pull requests in our GitHub repository.
We do not argue that the availability of a tool such as this replaces the need for scientists to know how to perform these types of calculations. However, we hope that by providing a streamlined tool that eases this process, Mixology can make one aspect of routine laboratory life simpler, and reduce errors.

Data availability
The

Pablo Cárdenas
Department of Biological Engineering, Massachusetts Institute of Technology, Cambridge, MA, USA This article describes "Mixology", a novel software tool used for preparing chemical solutions used in laboratory science. Given a list of user-defined reagents with their initial and desired concentrations, the software automates calculations for quantity conversion of different molar amounts, activities, masses, and volumes required to prepare a specified amount of solution. The software automatically retrieves any relevant molecular weights of reagents for the calculations. This not only saves time for researchers preparing experiments but more importantly, can reduce mistakes committed when doing the calculations by hand, as explained by the author. Mixology is free and open source, simple in design and use, and quickly accessible across platforms as an online application. Because of these reasons, it has the potential to be a very useful tool for wet lab scientists accessing it from a variety of devices, both in and out of the lab.
I have no comments on the article text. Below, I will offer some potentially useful feedback on the web app itself:

Design and functionality:
Although the web app is very easy to use once I understood exactly what it does and how it works, this was not immediately evident to me. This is clearly explained in the video linked under the expandable "About" section, as well as on the animated GIF file on the GitHub README (which I thought was particularly useful, since I found it to be quicker than the full video). However, the simplest way I can think of to show what the app does is to have an "example" button on the bottom row of links that opens the permalink to an example solution for the user to play with, maybe the one displayed on Figure 2.

○
The permalink function is an excellent idea, as it allows users to easily store and share recipes. However, some users might prefer (or might be required) to copy the full recipe onto their own laboratory notebooks, whether electronic or physical. A drawback of Mixology's excellent dynamically-updated user interface is that it does not allow for easy ○ copy-paste of text off of the app. Adding a function to export recipes as plain text would be very useful.
If not too involved, it could be intuitive to allow users to click on the grey "(MW: XX.XXXX)" text that appears to the right of a chemical reagent's name as an additional shortcut to the " Custom molecular mass: " pop-up. ○ This is absolutely trivial, but adding uppercase L as an alternative symbol for liters (as well as mL, µL, etc.) would be appreciated for aesthetic reasons and muscle memory. Fortunately, the issue was solved after updating to iOS 14.6, and I suspect the desktop Safari issue would be solved in a similar fashion. I was not able to replicate and trace the original bug on mobile debuggers and emulators, but I would expect it to be related to the software's dependencies rather than the code presented here. I was not able to test the app's performance on Android-based mobile operating systems.
In this light, perhaps the "About" section could include a reminder for users to update their operating system if they run into trouble. I can envision mobile access to be one of the main usage contexts for the app, especially in lab spaces without a computer on the bench. I realize this may not be the original application context envisioned for the app, as I found a warning message displaying "mixology is easier to use with a wider screen" to be triggered by mobile browsers in the source code (incidentally, this warning did not trigger on my mobile devices).
Overall, I very much value the work presented by the author and will surely be using it in my own work.

Is the rationale for developing the new software tool clearly explained? Yes
Is the description of the software tool technically sound? Yes

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? The paper reports on a new, freely available and open-source web app 'Mixology' that simplifies the calculations necessary for preparing solutions that are used in labs. The advantages of using an app over manual calculations are clearly explained in the paper.
I have reviewed the manuscript and the app, but I haven't reviewed the source code (as the coding language that is used is outside my area of expertise).

Comments on the manuscript:
The example calculation in the paper (11.2 ml) and the screenshot of the app (figure 1, 11.41 ml) show slightly different numbers (probably due to rounding at step 4). I'd recommend to make the numbers consistent.

○
Using the same abbreviation for litre (uppercase L or lowercase l) improves consistency.

○
The paper states "Concentrations can be entered in any of several unit forms", including µg/ml, but the app seems unable to accept the greek symbol 'mu' (see also comments below). If this is a limitation of the app, it should be highlighted in the paper.

Comments on the webtool:
The webtool can be used without reading the paper, suggesting that the user interface is intuitive.

○
The automatic retrieval of molecular weights is elegant and works smoothly.