Skip to contents

This function performs differential expression analysis using DESeq2 for a comparison between two groups. It calculates fold changes, p-values, and adjusted p-values for each gene, and ranks genes based on their statistical and biological significance.

Usage

run_diffexp(
  dds,
  org,
  group_by,
  comparison,
  order = "pxfc",
  save_data = T,
  save_dir = getwd(),
  ...
)

Arguments

dds

DESeq2 object containing the expression data

org

The organism to use, either "human" or "mouse".

group_by

Column name in colData(dds) to use for grouping.

comparison

Comparison to run.

order

Column name to use for ranking genes. Default is "pxfc"

save_data

Logical. If TRUE, saves results to TSV file. Default is TRUE

save_dir

Directory to save the results. Default is current working directory

...

Additional arguments passed to DESeq2::DESeq()

Value

A data frame containing differential expression results with columns: - gene: gene identifier - comparison: name of the comparison - log2FoldChange: log2 fold change between groups - padj: adjusted p-value - pxfc: combined score (-log10(padj) * log2FoldChange)

Examples

if (FALSE) { # \dontrun{
# Basic differential expression analysis
res <- run_diffexp(dds)

# Differential expression analysis with custom parameters
res <- run_diffexp(dds, group_by = "Treatment", save_data = TRUE)
} # }