% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/iobr_deg.R
\name{iobr_deg}
\alias{iobr_deg}
\title{Differential Expression Analysis}
\usage{
iobr_deg(
  eset,
  annotation = NULL,
  id_anno = NULL,
  pdata,
  group_id = "group",
  pdata_id = "ID",
  array = FALSE,
  method = c("DESeq2", "limma"),
  contrast = c("High", "Low"),
  path = NULL,
  padj_cutoff = 0.01,
  logfc_cutoff = 0.5,
  volcano_plot = FALSE,
  col_volcano = 1,
  heatmap = TRUE,
  col_heatmap = 1,
  parallel = FALSE
)
}
\arguments{
\item{eset}{A matrix of gene expression data where rows represent genes and
columns represent samples.}

\item{annotation}{Optional data frame for mapping gene IDs to gene names.
Default is `NULL`.}

\item{id_anno}{Character string specifying the identifier column in annotation.
Default is `NULL`.}

\item{pdata}{A data frame containing sample information and grouping labels.}

\item{group_id}{Character string specifying the column name in `pdata` containing
grouping labels. Default is `"group"`.}

\item{pdata_id}{Character string specifying the column name in `pdata` for sample IDs.
Default is `"ID"`.}

\item{array}{Logical indicating whether to perform quantile normalization.
Default is `FALSE`.}

\item{method}{Character string specifying the method: `"DESeq2"` or `"limma"`.
Default is `"DESeq2"`.}

\item{contrast}{Character vector of length 2 specifying contrast groups.
Default is `c("High", "Low")`.}

\item{path}{Character string for output directory. Default is `NULL`.}

\item{padj_cutoff}{Numeric cutoff for adjusted p-values. Default is `0.01`.}

\item{logfc_cutoff}{Numeric log2 fold change cutoff. Default is `0.5`.}

\item{volcano_plot}{Logical indicating whether to generate a volcano plot.
Default is `FALSE`.}

\item{col_volcano}{Integer specifying color index for volcano plot. Default is `1`.}

\item{heatmap}{Logical indicating whether to generate a heatmap. Default is `TRUE`.}

\item{col_heatmap}{Integer specifying color index for heatmap. Default is `1`.}

\item{parallel}{Logical indicating whether to run in parallel. Default is `FALSE`.}
}
\value{
Data frame containing differentially expressed genes with statistics
  including log2 fold changes and adjusted p-values.
}
\description{
Performs differential expression analysis on gene expression data using either
DESeq2 or limma. Includes pre-processing steps like filtering low count data,
and calculates fold changes and adjusted p-values. Optionally generates
volcano plots and heatmaps.
}
\examples{
# Simulate data
set.seed(123)
sim_eset <- matrix(abs(rnorm(100 * 20)), 100, 20)
rownames(sim_eset) <- paste0("Gene", 1:100)
colnames(sim_eset) <- paste0("Sample", 1:20)

sim_pdata <- data.frame(
  ID = paste0("Sample", 1:20),
  group = rep(c("High", "Low"), each = 10)
)

# Run DEG analysis
deg <- iobr_deg(
  eset = sim_eset, pdata = sim_pdata,
  group_id = "group", pdata_id = "ID",
  method = "limma", contrast = c("High", "Low"),
  heatmap = FALSE
)
if (!is.null(deg)) head(deg)
}
\author{
Dongqiang Zeng
}
