#' Calculation of dCt values
#'
#' Function to calculate dCt values according to primer efficiency and a calibrator sample
#'
#' @param x a row of data from the averaged qPCR data as generated by \code{\link{ct_avg_fun}}, effectively containing the averaged data for a single sample
#' @param calib a character string with the name of the sample to be used as reference for dct calculation. This sample will have an
#' expression value of 1 for all targets and the rest of the samples will have values expressing their relative expression to this sample.
#' @param eff.matrix a data.frame containing the efficiency values for each primer pair as generated in \code{\link{qpcr_analysis}}
#'
#' @return the dCt value calculated for the row of data
#' @export
#'
#' @examples
dct <- function(x, calib, eff.matrix) { # takes a row of data for a single sample, the ct values
# of the calibrator sample and the efficiency of each primer pair, computes the dct value
ct <- as.numeric(x["ctaverage"])
sample <- x["sample"]
primers <- x["primers"]
eff.primers <- eff.matrix[eff.matrix$primers == primers, "efficiency"]
dct_value <- eff.primers^(calib[primers] - ct)
dct_value
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.