Learn R Programming

rtpcr (version 2.1.3)

ANOVA_DCt: Delta Ct ANOVA analysis with optional model specification

Description

Performs Delta Ct (dCt) analysis of the data from a 1-, 2-, or 3-factor experiment with support for both fixed effects and mixed effects models. Per-gene statistical grouping is performed for all treatment combinations.

Usage

ANOVA_DCt(
  x,
  numOfFactors,
  numberOfrefGenes,
  block = NULL,
  alpha = 0.05,
  p.adj = "none",
  analyseAllTarget = TRUE,
  model = NULL,
  set_missing_target_Ct_to_40 = FALSE
)

Value

An object containing expression tables, lm/lmer models, ANOVA tables, residuals, and raw data for each gene:

relativeExpression

dCt expression table for all treatment combinations along with per-gene statistical grouping

perGene

Nested list containing detailed results for each target gene:

  • ANOVA_table: Full factorial ANOVA table

  • lm: lm/lmer model for factorial design

  • Final_data: Processed data with wDCt values

  • resid(object$perGene$gene_name$lm): Residuals

Arguments

x

The input data frame containing experimental design columns, target gene E/Ct column pairs, and reference gene E/Ct column pairs. Reference gene columns must be located at the end of the data frame. See "Input data structure" in vignettes for details about data structure.

numOfFactors

Integer. Number of experimental factor columns (excluding rep and optional block).

numberOfrefGenes

Integer. Number of reference genes. Each reference gene must be represented by two columns (E and Ct).

block

Character. Block column name or NULL. When a qPCR experiment is done in multiple qPCR plates, variation resulting from the plates may interfere with the actual amount of gene expression. One solution is to conduct each plate as a randomized block so that at least one replicate of each treatment and control is present on a plate. Block effect is usually considered as random and its interaction with any main effect is not considered. Note: This parameter is ignored if model is provided.

alpha

Statistical level for comparisons (default: 0.05).

p.adj

Method for p-value adjustment. See p.adjust.

analyseAllTarget

Logical or character. If TRUE (default), all detected target genes are analysed. Alternatively, a character vector specifying the names (names of their Efficiency columns) of target genes to be analysed.

model

Optional model formula. If provided, this overrides the automatic formula (CRD or RCBD based on block and numOfFactors). The formula uses wDCt as the response variable. For mixed models, random effects can be defined using lmer syntax (e.g., "wDCt ~ Treatment + (1|Block)"). When using model, the block and numOfFactors arguments are ignored for model specification, but still used for data structure identification.

set_missing_target_Ct_to_40

If TRUE, missing target gene Ct values become 40; if FALSE (default), they become NA.

Details

The function performs ANOVA analysis on weighted delta Ct (wDCt) values and returns variance components along with an expression table containing:

  • gene: Name of target genes

  • Factor columns: Experimental design factors

  • dCt: Mean weighted delta Ct for each treatment combination

  • RE: Relative expression = 2^-dCt

  • log2FC: log2 of relative expression

  • LCL: 95% lower confidence level

  • UCL: 95% upper confidence level

  • se: Standard error of the mean calculated from wDCt values

  • Lower.se.RE: Lower limit error bar for RE (2^(log2(RE) - se))

  • Upper.se.RE: Upper limit error bar for RE (2^(log2(RE) + se))

  • Lower.se.log2FC: Lower limit error bar for log2 RE

  • Upper.se.log2FC: Upper limit error bar for log2 RE

  • sig: Per-gene significance grouping letters

Examples

Run this code
# Default usage with fixed effects
result <- ANOVA_DCt(data_2factorBlock3ref, numOfFactors = 2, numberOfrefGenes = 3, 
                    block = "block")

# Mixed model with random block effect
result_mixed <- ANOVA_DCt(data_2factorBlock3ref, numOfFactors = 2, numberOfrefGenes = 3,
                          block = "block")

# Custom mixed model formula with nested random effects
result_custom <- ANOVA_DCt(data_repeated_measure_2, numOfFactors = 2, numberOfrefGenes = 1,
                            block = NULL,
                            model = wDCt ~ treatment * time + (1 | id))


Run the code above in your browser using DataLab