Learn R Programming

pcr (version 1.2.2)

pcr_ddct: Calculate the delta_delta_ct model

Description

Uses the \(C_T\) values and a reference gene and a group to calculate the delta delta \(C_T\) model to estimate the normalized relative expression of target genes.

Usage

pcr_ddct(
  df,
  group_var,
  reference_gene,
  reference_group,
  mode = "separate_tube",
  plot = FALSE,
  ...
)

Arguments

df

A data.frame of \(C_T\) values with genes in the columns and samples in rows rows

group_var

A character vector of a grouping variable. The length of this variable should equal the number of rows of df

reference_gene

A character string of the column name of a control gene

reference_group

A character string of the control group in group_var

mode

A character string of; 'separate_tube' (default) or 'same_tube'. This is to indicate whether the different genes were run in separate or the same PCR tube

plot

A logical (default is FALSE)

...

Arguments passed to customize plot

Value

A data.frame of 8 columns:

  • group The unique entries in group_var

  • gene The column names of df. reference_gene is dropped

  • normalized The \(C_T\) value (or the average \(C_T\) value) of target genes after subtracting that of the reference_gene

  • calibrated The normalized average \(C_T\) value of target genes after subtracting that of the reference_group

  • relative_expression The expression of target genes normalized by a reference_gene and calibrated by a reference_group

  • error The standard deviation of the relative_expression

  • lower The lower interval of the relative_expression

  • upper The upper interval of the relative_expression

When plot is TRUE, returns a bar graph of the relative expression of the genes in the column and the groups in the column group. Error bars are drawn using the columns lower and upper. When more one gene are plotted the default in dodge bars. When the argument facet is TRUE a separate panel is drawn for each gene.

Details

The comparative \(C_T\) methods assume that the cDNA templates of the gene/s of interest as well as the control/reference gene have similar amplification efficiency. And that this amplification efficiency is near perfect. Meaning, at a certain threshold during the linear portion of the PCR reaction, the amount of the gene of the interest and the control double each cycle. Another assumptions is that, the expression difference between two genes or two samples can be captured by subtracting one (gene or sample of interest) from another (reference). This final assumption requires also that these references don't change with the treatment or the course in question.

Examples

Run this code
# NOT RUN {
## locate and read raw ct data
fl <- system.file('extdata', 'ct1.csv', package = 'pcr')
ct1 <- read.csv(fl)

# add grouping variable
group_var <- rep(c('brain', 'kidney'), each = 6)

# calculate all values and errors in one step
pcr_ddct(ct1,
         group_var = group_var,
         reference_gene = 'GAPDH',
         reference_group = 'brain')

# return a plot
pcr_ddct(ct1,
         group_var = group_var,
         reference_gene = 'GAPDH',
         reference_group = 'brain',
         plot = TRUE)

# }

Run the code above in your browser using DataLab