% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/D-Test.R
\name{perform_dunnett_test}
\alias{perform_dunnett_test}
\title{Dunnett's Test for Differential Gene Expression}
\usage{
perform_dunnett_test(
  dataframe,
  con1,
  con2,
  exp1,
  exp2,
  alpha = 0.05,
  annot_df = NULL
)
}
\arguments{
\item{dataframe}{A numeric matrix or data.frame of gene expression values
(rows = genes, columns = samples).  Values are automatically log2-
transformed when they appear to be on a linear / intensity scale.}

\item{con1}{Integer. Index of the first control column.}

\item{con2}{Integer. Index of the last control column.}

\item{exp1}{Integer. Index of the first experiment column.}

\item{exp2}{Integer. Index of the last experiment column.}

\item{alpha}{Numeric significance threshold for BH-adjusted p-values
(default \code{0.05}).}

\item{annot_df}{Optional annotation data.frame with columns \code{ID} and
\code{Gene.Symbol} (or \code{Gene.symbol}).  When \code{NULL} (default)
row names of \code{dataframe} are used as gene identifiers.}
}
\value{
A named list:
  \describe{
    \item{Table}{Data.frame with columns \code{G_Symbol}, \code{log2FC},
      \code{p.value}, \code{BH}, \code{fdr}.}
    \item{DEGs}{Data.frame of significant gene identifiers.}
  }
}
\description{
Performs Dunnett's multiple comparison test (control vs. treatment) for every
gene (row) in the expression matrix using \code{\link[DescTools]{DunnettTest}},
applies BH correction, and returns a results table with the list of significant
DEGs.  Genes with insufficient variance, missing values, or other numerical
issues are skipped gracefully and receive \code{NA} p-values.
}
\examples{
library(DGEAR)
data("gene_exp_data")
result <- perform_dunnett_test(dataframe = gene_exp_data,
                               con1 = 1, con2 = 10,
                               exp1 = 11, exp2 = 20)
head(result$Table)
result$DEGs
}
