BioChem Calculator

Course project for Coursera Developing Data Projects

A.Bailey - 22nd October 2015

A simple calculator for use in the Biochemistry Lab


Two everyday problems I and my colleagues encounter in the laboratory are:

  1. How much of X do I need to weigh out to make a solution of concentration Y ?
  2. How much of solution A do I need to dilute to make a soluton of concentration B ?

This is straightforward, but often requires converting units between different scales.

So I have created a simple Shiny app to do these two calculations and convert the units, making things quicker and easier than pen and paper.

The app is at: BioChem Calculator

The R code for the app is at: BioChem Calculator GitHub Repo

For example if I have a stock solution of EDTA at M1 = 0.5 Molar.
To make a volume V2 = 100 mL of EDTA at a concentration of M2 = 10 mM from the stock solution M1, I need the concentration and volumes in the same units to do the calculation, like so:

# Input conc. and vols in Molar and Litres
M1 <- 0.5; M2 <- 10e-3; V2 <- 100e-3;
# Calcluate vol of stock needed in Litres
V1 <- (V2*M2)/M1; paste("vol. of stock needed", V1, "Litres");
## [1] "vol. of stock needed 0.002 Litres"
# Convert back to millilitres
paste("vol. of stock needed", V1*1e3, "mL")
## [1] "vol. of stock needed 2 mL"

My Shiny app allows the user to choose the input and output units and do the conversion on the fly.

Mass Molarity Calculator

\[Formula\,weight\,(g/mol) \times Desired\,vol.\,(L) \times Desired\,conc.\,(M) = Mass\,req.\,(g)\]

This calculator calculates the dry mass of a substance in grams required to make up a solution to the desired volume and molar concentration.

The user selects the desired volume and molar concentration unit using the drop down tabs. They then enter the volume of solution, the concentration and the formula weight of the substance to be dissolved into the boxes.

The mass required in grams is then calculated as:

Solution Dilution Calculator

This calculates the volume of stock concentrate required to achieve a specified volume and molar concentration.

The user selects the stock solution concentraion units, the desired concentration and volume units using the drop down tabs. They then enter the stock concentration, the desired concentration, and the desired volume of solution into the boxes.

The volume of stock required is then calculated as: \[\frac{Vol_{desired}\times Conc_{desired}}{Conc_{stock}} = Vol_{stock}\]