Analyse ELISA data in R
2018-11-27
1 Introduction
This document shows how to analyse ELISA data in R. The code was written to analyse ELISA experiments performed in our lab: the script reads the excel file provided by a Synergy H1 96-well plate reader from BioTek, performs a background-correction, generates the calibration curve and computes the sample concentrations with respect to this calibration curve.
Note from 04-Apr-2024: This document was developed in 2018 and may contain outdated and partially experimental code – use on your own responsibility. You should understand the calculations behind the analysis before applying them to your data.
1.1 About the experiment in brief
We measured the IgG amount in blood serum of four donors using an indirect ELISA. The detection antibody was conjugated to horseradish peroxidase (HRP). As a substrate solution, we used TMB from Thermo Fisher Scientific. We measured absorbance at 450 nm – to measure the substrate specific absorbance – and at 620 nm – to measure the (unspecific) background absorbance. The absorbance of both wavelength is provided by the plate reader in a single excel sheet. If we say background correction we mean that we substract the values obtained at 620 nm from the values obtained at 450 nm.
1.2 Load libraries and import excel file
We first load some R libraries that we want to use.
# load packages
if (!requireNamespace("pacman", quietly = TRUE)){
install.packages("pacman")}
::p_load(bookdown, # to create this document
pacman# for data wrangling
tidyverse, # for nice plots
ggplot2, cowplot, # for axis scales with '%'
scales, # to read excel files
readxl, # to find the absolute path of the project
here, # for functional programming
purrr, # for color palettes
viridis, # for 4-param logistic regression drc, minpack.lm)
Now we read the excel file:
# Set the name of the excel file
# Note: this is example data used for illustrative purposes only.
<- file.path(here::here(), "example-data.xlsx")
xlsx.file # Import excel data
<- readxl::read_xlsx(xlsx.file, sheet = 1, col_names = FALSE) %>% as.tibble
data # Let's have a look at the absorbance data.
# View(data)
The odd rows show the absorbance at 450 nm and the even rows the absorbance at 620 nm. As expected, the background absorbance at 620 nm is very low.
1.3 Set cell indices and set experimental parameteres
We need to specify some experiment-specific parameters manually such as the position of the wells with the standard samples and blanks, the number of replicates, etc.
## BLANKS
# Location of the 450 nm measurement of our blanks in the `data` table.
# Use View(data) to double-check row and column indices:
<- 40
row.idx.blank <- 13
col.idx.blank
## STANDARD SAMPLES
# Location of the 450 nm measurement of the first well
# of our standard (well 1A in our case -> row 26 and column 3 in `data` table)
<- 26
row.idx.std <- 3
col.idx.std # Number of replicates of the standard
<- 2
n.repl.std # Maximal concentration of the standard
<- 1 # i.e. 100 %, we use a relative scale
max.conc.std # Number of dilutions performed to obtain the calibration curve
<- 8
n.dilutions # Dilution factor
= 2
dilution.fact
## BIOLOGICAL SAMPLES
# Location of first well with the sample of the first donor (here well 3A)
.1 <- 26
row.idx.donor.1 <- 5
col.idx.donor<- 4 # Four donors, pipetted in horizontal order
n.donors <- c(0, 7, 30, 60, 180) # Five time points, pipetted in vertical order
tpoints <- 2 # Two replicate measurements per donor and time point n.repl.donors
Now we can start analysing the data.