calib_plot: qPCR Calibration Plot

Description Usage Arguments Details Value Examples

View source: R/calib_plot.R

Description

Create a qPCR calibration plot.

Usage

1
calib_plot(data, target, lod = NULL, robust = FALSE, ...)

Arguments

data

A tibble or data.frame containing calibration curve data (see details).

target

A character string containing a unique identifier for the target calibration curve to be plotted.

lod

A vector or tibble or data.frame specifying LOD and optionally LOQ values to plot.

robust

A logical value indicating whether the fitted model should exclude standards with less than 50% detections. Default = FALSE.

...

Placeholder for further arguments that might be needed by future implementations.

Details

The data object contains data for at least one qPCR calibration curve usually presented as Cq (Ct) value and corresponding copy number from from a series of serial dilutions. The data.frame must contain the headers Target, Cq and SQ. The Target column must contain unique identifiers for each calibration curve. The Cq column contains the Cq (Ct) values and SQ contains the copy number data. Additional columns will be ignored.

The target argument takes a single character string specifying the target calibration curve to plot.

The optional lod argument can be supplied as a vector or as a data.frame or tibble. If supplied as a vector then a single LOD value or optionally an LOD and LOQ value can be included. If both LOD and LOQ values are specified then LOD much be supplied first in the vector (i.e. c(1.5, 4.1)). If supplied as a data.frame or tibble the object must contain the headers Target, and lod and with an optional loq header specifying the calibration curve target, the lod and loq values respectively.

Non-detections in data should be represented as NA.

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
require(tibble)
# lod as tibble
lod_data <- tibble(Target = "706", lod = 1.5, loq = 4.3)
calib_plot(calib_data, target = "706", lod = lod_data)

# lod as vector
lod_data <- c(1.5, 4.3)
calib_plot(calib_data, target = "706", lod = lod_data)

# loq missing and robust = TRUE
lod_data <- tibble(Target = "706", lod = 1.5)
calib_plot(calib_data, target = "706", lod = lod_data, robust = TRUE)

## End(Not run)

alexd106/ednar documentation built on Sept. 1, 2021, 2:37 p.m.