% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/DGEAR.R
\name{DGEAR}
\alias{DGEAR}
\title{Differential Gene Expression Analysis with R}
\usage{
DGEAR(
  dataframe,
  con1,
  con2,
  exp1,
  exp2,
  alpha = 0.05,
  votting_cutoff = 3,
  annot_df = NULL
)
}
\arguments{
\item{dataframe}{A numeric matrix or data.frame of gene expression values
(rows = genes, columns = samples).  Raw intensity / count values are
automatically log2-transformed when they appear to be on a linear 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{votting_cutoff}{Integer. Minimum number of tests (out of 5) that must
independently declare a gene significant for it to be included in the
majority-vote DEG list (default \code{3}).  Must be between 1 and 5.}

\item{annot_df}{Optional annotation data.frame with columns \code{ID} and
\code{Gene.Symbol} (or \code{Gene.symbol}) that maps probe/row identifiers
to gene symbols.  When \code{NULL} (default) row names of \code{dataframe}
are used directly as gene identifiers.  Typical source: a GEO SOFT family
file parsed with \code{read.delim()}.}
}
\value{
A named list with four elements:
  \describe{
    \item{\code{DEGs}}{Data.frame of gene identifiers that passed majority
      voting.}
    \item{\code{FDR_Table}}{Wide data.frame with BH-adjusted p-values from
      every test, the Fisher-combined FDR, the ensemble voting score, and
      log2 fold change for every gene.}
    \item{\code{Results_Table}}{Concise data.frame with \code{G_Symbol},
      \code{CombineFDR}, \code{log2FC}, and \code{Ensemble} score.}
    \item{\code{IndividualTests}}{Named list of the raw output from each
      of the five test functions (each containing a \code{Table} and a
      \code{DEGs} element).}
  }
}
\description{
Main orchestration function that runs five statistical tests (Welch t-test,
one-way ANOVA, Dunnett's test, Half's modified t-test, and Wilcoxon-Mann-Whitney
U-test) on a gene expression matrix, combines their BH-adjusted p-values with
Fisher's combined probability method, and identifies differentially expressed
genes (DEGs) by majority voting.
}
\details{
The function internally calls:
\itemize{
  \item \code{\link{perform_t_test}} — Welch two-sample t-test
  \item \code{\link{perform_anova}} — one-way ANOVA
  \item \code{\link{perform_dunnett_test}} — Dunnett's test
  \item \code{\link{perform_h_test}} — Half's modified t-test
  \item \code{\link{perform_wilcox_test}} — Wilcoxon rank-sum test
}
Each test independently assigns an FDR flag (1 = significant, 0 = not).
The five flags are summed per gene; genes whose sum meets or exceeds
\code{votting_cutoff} are reported as DEGs (majority voting, Boyer & Moore
1991).  Combined p-values across all five tests are computed with Fisher's
method via \code{\link[metapod]{parallelFisher}}.

Annotation via \code{annot_df} is entirely optional.  When supplied, the
first gene symbol listed for each probe (delimited by \code{ /// }) is used.
When absent, row names serve as identifiers, making the function fully
self-contained without GEO annotation files.
}
\examples{
library(DGEAR)
data("gene_exp_data")

## Basic usage — no annotation file needed
result <- DGEAR(dataframe    = gene_exp_data,
                con1         = 1,
                con2         = 10,
                exp1         = 11,
                exp2         = 20,
                alpha        = 0.05,
                votting_cutoff = 2)
result$DEGs
head(result$FDR_Table)

## With an optional annotation data.frame (GEO SOFT format)
## annot <- read.delim("GSExxxxx_family.soft")
## result <- DGEAR(dataframe = gene_exp_data,
##                 con1 = 1, con2 = 10, exp1 = 11, exp2 = 20,
##                 annot_df = annot)
}
\references{
Boyer, R.S. and Moore, J.S. (1991). MJRTY — A Fast Majority Vote Algorithm.
In \emph{Automated Reasoning: Essays in Honor of Woody Bledsoe}, pp. 105–117.
Springer, Dordrecht. \doi{10.1007/978-94-011-3488-0_5}
}
