qPCR.plot: Plot raw qPCR data

View source: R/qPCR.plot.R

qPCR.plotR Documentation

Plot raw qPCR data

Description

This function takes raw real-time PCR data and produces a convenient plot and table, which can be used to assess the quality of the data.

Usage

qPCR.plot(
  std.conc = NULL,
  std.cq = NULL,
  unk.cq = NULL,
  nrt.cq = NULL,
  ntc.cq = NULL,
  replicate.number = 3,
  outlier.method = c("absolute", "IQR"),
  unk.replicates = FALSE,
  error.bars = TRUE,
  unk.ids = NULL,
  unk.loading = 1,
  unk.loading.on.plot = FALSE,
  main = NULL,
  xlab = "log10 template / ul",
  ylab = "Cq",
  plot.only = FALSE,
  ...
)

Arguments

std.conc

A numeric vector providing the concentrations of the standards used.

std.cq

A numeric vector of Cq values measured for the standard samples.

unk.cq

A numeric vector of Cq values measured for unknown samples.

nrt.cq

A numeric vector of Cq values measured for no-reverse transcription control (NRT) samples.

ntc.cq

A numeric vector of Cq values measured for no-template control (NTC) samples.

replicate.number

The number of technical replicates in the standards (Default value is 3).

outlier.method

A character specifying the method to use in determining outliers among the standards. The default is absolute which flags values more than 1.5 cycles from the median. Alternatively IQR will flags replicates more than 1.5 times the interquartile range from the median Cq value.

unk.replicates

Specifies whether unk.cq contains technical replicates (or previously averaged) values. The default value is FALSE. If set to TRUE, then the function assumes the same replicate.number used for standards. Alternatively, a single numeric value can specify a different number of technical replicates for the unknown samples.

error.bars

A logical factor specifying whether to include error bars on the unknowns. Only applies if there are replicates for the unknowns.

unk.ids

An optional character vector with ID names for the unknown samples. Alternative, if set to TRUE, then unk.cq values will be numbered in order. If unk.replicates is TRUE or set to a numeric, then one only one value should be provided in the unk.ids vector for each sample.

unk.loading

A single numeric value or a vector with one value for each unknown sample. (If there are technical replicates for unknowns, provide one value for each replicate group.) If the plate contains unknowns with different loading volumes or concentrations, this argument can be used to adjust the calculation of starting template concentrations in the unknowns to a per-unit value. This is applied to the concentrations calculated in the output table. To apply the argument to the plot too, set unk.loading.on.plot = TRUE

unk.loading.on.plot

A logical factor specifying whether to apply the unk.loading to the unknown values as they appear on the plot.

main

An overall title for the plot.

xlab

A title for the x axis.

ylab

A title for the y axis.

plot.only

A logical factor specifying whether to limit output to the plot. If FALSE (the default), then the function also returns tables of the input data and the inferred unknown concentrations as well as descriptive statistics from the standards.

Details

The function takes information on the standard concentrations (unitless, but assumed to be log10 of template molecules per microliter) and Cq values measured by the real-time PCR instrument. A linear regression provides intercept and slope, from which PCR efficiency is calculated. The correlation coefficient is also displayed. Potential outlier values in the standard Cq values are highlighted on the plot in red. Efficiency values outside the range of 1.8 to 2.2 (90 as are correlation coefficients (R^2) less than 0.9.

If Cq values are provided for unknown samples, they are plotted on the line and the corresponding starting concentrations are provided in the output table.

If they are provided, the minimum Cq values for negative controls (NRT and NTC) are plotted as horizontal lines (gray and blue, respectively) and used to call unknowns as reliably above zero.

Any additional arguments are passed to graphics::plot.

Source

Dave Angelini david.r.angelini@gmail.com [aut, cre]

Examples

std.conc <- c(rep(6,3),rep(5,3),rep(4,3),rep(3,3))
std.cq <- c(25.74, 26.33, 25.03,  28.42, 28.90, 27.30,
            32.15, 32.31, 30.61,  34.46, 34.04, 34.29)
unk.cq <- c(28.531, 29.331, 29.466,  29.597, 30.168, 30.258,
            30.535, 31.206, 31.279,  32.332, 33.096, 32.114)
nrt.cq <- c(32.76, 32.80, 31.51)
ntc.cq <- c(36.08, 35.56, 37.62)

qPCR.plot(std.conc, std.cq, unk.cq, nrt.cq, ntc.cq, main="TFX (FAM)")

qPCR.plot(std.conc, std.cq, unk.cq, nrt.cq, ntc.cq, main="TFX (FAM)",
          unk.ids = TRUE)

qPCR.plot(std.conc, std.cq, unk.cq, nrt.cq, ntc.cq, main="TFX (FAM)",
          unk.replicates = TRUE,
          unk.ids = c("A","B","C","control"))

qPCR.plot(std.conc, std.cq, unk.cq, nrt.cq, ntc.cq, main="TFX (FAM)",
          unk.replicates = TRUE,
          unk.loading = c(0.5,1,2,2),
          unk.loading.on.plot = TRUE,
          unk.ids = c("A","B","C","control"))

# It's often convenient to scan in values copied from a spreadsheet, e.g.
# std.conc <- scan()

# If no inputs are provided, the function simulates data and analysis,
# which can be useful when training people new to real-time PCR.
qPCR.plot()


aphanotus/borealis documentation built on Nov. 4, 2022, 8:44 p.m.