Contributors: Carolynn Harris
This project provides R scripts to visualize growth curves and calculate growth rate of microbial cultures based on optical density (OD) observations. Growth rate during the exponential phase is calculated and outputs include associated statistics (growth rate, doubling time, fit of growth model, and maximum OD). A unique data visualization is included to help beginners understand how the growth rate algorithm iteratively calculates growth rates based on a subset of the observations, until the optimal growth rate is reached. This growth rate calculator code was initially developed with the help of Alec Cobban and Beverly Chiu for use by members of the Leavitt Geomicrobiology Lab (Dartmouth College). Carolynn Harris later developed the associated data visualizations. The growth rate algorithm used is a modification of the algorithm published in Hall et al., 2014.
This code is meant to be accessible to users with beginner R skills. Example input and output files are provided from an experiment conducted by Dartmouth undergraduate, Abigail Shepard, that tested the impact of salinity on growth by the halophilic archaeon, Haloarcula marismortui. This should allow first-time users to confirm that they are running the code correctly and is generally an interesting dataset to examine that shows very clear trends.
The scripts are set up to accept an .xlsx file generated by a google form as input. Carolynn Harris uses these google forms to allow easy data entry and validation by undergraduate research assistants (see an example here: https://docs.google.com/forms/d/e/1FAIpQLSd9GHRwFEFNnLlRBWeWxza8MHV_SXgP0tcxN1bNObzH1BVasw/viewform?usp=sharing).
This algorithm calculates the growth rate during exponential phase for several microbial cultures. First, the user specifies a number of OD observations to consider. Let’s say the user specified n = 3. The algorithm will compare the slope of a line forced through every sequence of 3 OD observations in your dataset. It will select the 3 points that produce the steepest slope (i.e. fastest growth). The algorithm will then add the next observation to that subset of 3 points, and force a trend line through those 4 OD observations. If this produces a steeper slope, it will keep the 4th point and try adding a 5th point, and so on. It stops when the addition of another OD observation doesn’t result in a steeper slope. This takes the guesswork out of calculating growth rates and speeds up analysis considerably!
Script that creates a function (plotODs) to create growth curves (OD vs elapsed time). The name of the OD observation file and the experimental setup/ metadata file in the 00_DataInputs file should be specified. Also, you need to specify the name of the experiment and inoculation date in lines 23,24. These will be used to name the files and figures produced by this script. This script produces figures and files as outputs. First, it creates a growth curve for every culture as well as a summary plot showing every treatment on the same plot, these are saved in the 01_DataWranglingFigs folder. Two files are produced that are saved to the working directory. First, the “date_expname_long.csv” file merges the OD observations and metadata files to create a list of every OD observation for every culture in long format. Second, the “date_expname_summary.csv” file contains the mean and stdev of OD observations across replicates for each treatment.
Script that creates a function (GrowthRateCalculator) to calculate the growth rate (during exponential growth) and associated statistics for each culture in the experiment. As inputs, specify the “date_expname_long.csv” file and the experimental setup/ metadata file. The experiment name and inoculation date should be specified in rows 17. 18. Additionally, you can specify parameters for the growth rate calculation algorithm in lines 21-23. n = the number of OD observations that should be included in the initial model. Sim = the similarity to be used. includingNegControls = should data from negative (i.e. uninoculated controls) be included. (Typically, this is no). This script produces figures and files as outputs. First, it creates one growth curve for each experimental replicate that visualizes the process of the growth rate algorithm and shows the statistics for the final growth rate mode. The blue points and dashed blue line represent the starter model. The purple points and solid purple line represent the final model used to calculate growth statistics. It also creates summary barplots that compare growth rate statistics (i.e. growth rate, doubling time, sacrifice OD and linear model fit (r2)) among treatments. A biplot of sacrifice OD vs. doubling time is also produced that shows every replicate for each treatment. These are saved in the 02_GrowthRateCalculator folder. Two files are produced that are saved to the working directory. First, “date_GrowthRate_Compile.csv” contains growth statistics for each experimental replicate. Second, “date_GrowthRate_Summary.csv”contains mean and stdev of growth statistics for every experimental treatment (average of replicates).
Contains two .xlsx files that are necessary inputs for the OD wrangling script. (1) the “date_experimentalSetup.xlsx” contains metadata (temp, pH, RPM, media, treatment, etc.) and symbology (symbol shape and color) data for each culture. Note that negative (i.e., uninoculated controls) should be entered as distinct treatments. Any other necessary metadata can be added. (2) the “date_OD600_(Responses).xlsx” sheet is a contains observations of OD600 data from every culture in the experiment. This is generated automatically by the google form Carolynn Harris uses for data collection. To use this growth rate script, you should manipulate your data into this format with the same column headers.
This folder is populated with growth curve figures as .pngs when the Data Wrangling R script is run. All figures show growth curves (i.e. OD vs elapsed time) on a linear and log axis. One plot is produced for each individual culture. Two summary plots are also produced, one that displays every experimental replicate and negative control for a certain treatment, and one that shown mean +/- stdev OD averaged across experimental replicates for each treatment.
This folder is populated with figures as .pngs when the Growth Rate Calculator R script is run. It contains one growth curve for each experimental replocate. Several summary plots are also created. Barplots are created that compare the mean growth rate, doubling time, model fit (r2), and sacrifice OD among treatments. A biplot of sacrifice OD vs. doubling time is also produced that shows every replicate for each treatment.
Hall BG, Acar H, Nandipati A, Barlow M. Growth rates made easy. Mol Biol Evol. 2014 Jan;31(1):232-8. doi: 10.1093/molbev/mst187. Epub 2013 Oct 28. PMID: 24170494.
Cobban R scripts: https://git.dartmouth.edu/leavitt_lab/cobban-saci-lipids-batch-and-fed-batch-2020/-/blob/master/README.md
Chiu python scripts: https://git.dartmouth.edu/leavitt_lab/growth-rate-calculations-python