knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
   devtools::install_github("hadley/emo")

thermgRad

R-CMD-check codecov

Tools to Visualize and Analyze Germination in Temperature Gradient Plates

thermgRad package aims to provide with useful tools to visualize and analyze germination experiments conducted using a temperature gradient plate (TGP) with a bidirectional setting (day/night cycle) and obtain cardinal temperatures for each of the temperature fluctuations thresholds across the thermal gradient plate.

Installation

You can install the development version of thermgRad from GitHub with:

#install.packages("devtools")
#devtools::install_github("pgomba/thermgRad") 
library(thermgRad)

What data does the package require?

View(thermgRad::tg_example)

Functions

How is T~50~ calculated?

T~50~ values are obtained via thermgRad::coolbear, a function adapting Coolbear et al. (1984) formula modified by Farooq et al.(2005).

where N represents the number of sowed seeds (germinated + viable + moldy) from a single replicate in all the experiments and n~i~ and n~j~ are the number of seeds germinated adjacently to (N/2) at time t~i~ and t~j~ respectively. An example:

scoring_days<-c(seq(1,20,2))
cumulative_germination<-c(0,0,0,6,7,12,18,23,23,23)
total_seeds<-25

thermgRad::coolbear(scoring_days,cumulative_germination,total_seeds) #Outputs T50

thermgRad::coolbear can be used as a standalone function or looped through a data frame, which is what thermgRad::petri_grid does, outputting individual information for each Petri dish (label, final germination %, T~50~ and germination rate). thermgRad::petri_grid is one of the core sub-functions of thermgRad::cardinal, but I'll get to that later (or jump to it now!).

data<-thermgRad::tg_example
head(petri_grid(data))

Visualizing your experiment

thermgRad::plot_results collects your experiments results and temperatures and collects them on a Day/Night temperature graph. The basic inputs this function needs are: - a formatted data frame like thermgRad::tg_example - number of Petri dishes per column/row - Corner temperatures following this order (Day Bottom Left, Day Bottom Right, Day Top Left, Day Top Right, Night Bottom left, Night Bottom Right, Night Top Left and Night Top Right) e.g:0,0,40,40,0,40,0,40 - Desired output via the parametertoplot, which allows to choose between several options. Use ="daytemp",="nighttemp" or ="average" to show day, night or average temperature, respectively. Additionally, use ="fluctuation" to show the temperature fluctuation of each dish or ="germina" to show final germination %.

data<-thermgRad::tg_example
thermgRad::plot_results(data, 0,0,40,40,0,40,0,40, petri=13, toplot= "germina")

By default, thermgRad:plot_results uses average temperature between "equal" temperature corners (i.e. If the bottom left corner is at 0°C and the bottom right corner is at 2°C, it will assume the whole bottom row is at 1°C). However, using method="precise" will create a temperature gradient based in individual corner temperatures and will likely give each Petri dish an individual temperature. The output plot does not look as straight and good as one without using the method (remember the grid is not a visual representation of the TGP, but a day vs night temperature plot) but the temperature grid will be more accurate

data<-thermgRad::tg_example
thermgRad::plot_results(data, 0,3,40,38,0,38,2,39, petri=13, toplot= "daytemp",method="precise")

There is yet another possible adjustment to do. If temperatures were recorded in each of the TGP corners, this can be adjusted to the center of each Petri dish for more accurate analysis. By adding the parameter adjust=TRUE

data<-thermgRad::tg_example
thermgRad::plot_results(data, 0,3,40,38,0,38,2,39, petri=13, toplot= "daytemp",method="precise",adjust=TRUE)

To obtain the dataset used to create the graph use the function thermgRad::grid_results which uses the same parameters from thermgRad::plot_results withouttoplot.

data<-thermgRad::tg_example
head(thermgRad::grid_results(data, 0,3,40,38,0,38,2,39, petri=13,method="precise",adjust=TRUE))

Obtaining cardinal temperatures

thermgRad::cardinal is the main function of package thermgRad. As seen before, Petri dishes with similar fluctuation run in parallel to the diagonal line crossing the TGP from left bottom corner to top bottom corner. thermgRad::cardinal allows to isolate a range of temperature fluctuation an obtain cardinal temperatures, sub and supra optimal equations and a plot. Fluctuation thershold is inputted via fs (lower threshold) and fs (upper threshold). In this example we obtain cardinal temperature data for the diagonal, where the temperature fluctuation is 0.

data<-thermgRad::tg_example
thermgRad::cardinal(data,0,0,40,40,0,40,0,40, petri=13,fs=0,fe=1)

This outputs a very simple graph representing your GR vs average temperature:

and table with the data in the graph with a user prompt at the end asking the user to select which PD_ID is to be used for both (sub- and supra-optimal)equations.

For this example we have selected number 7 (highest GR), obtaining the following outputs:

# [1] "Suboptimal eq: y = 0.007x - 0.04, R.rsq = 0.963, p-value = 1e-04"
# [1] "Supraoptimal eq: y = -0.016x - 0.5, R.rsq = 0.957, p-value = 0.022"
# [1] "Tb = -6 3"
# [1] "Tc = 31 3"
# [1] "To = 20.12"

References

Fernández-Pascual, E., Seal, C. E., & Pritchard, H. W. (2015). Simulating the germination response to diurnally alternating temperatures under climate change scenarios: comparative studies on Carex diandra seeds. Annals of Botany, 115(2), 201-209.

Disclaimer

thermgRad is a hobby project. I only work on this during quiet times, when I usually try to improve the code with newly acquired knowledge or implement functions that could be useful to interpret the data. Please feel free to suggest changes/improvements or raise any existing issues via github.

Roadmap



pgomba/thermgRad documentation built on Sept. 4, 2022, 8:15 a.m.