Learn R Programming

inDAGO (version 1.0.0)

EdgerDEG: EdgerDEG

Description

Perform differential expression analysis on RNA-seq count data using edgeR.

Usage

EdgerDEG(
  gr,
  WD_samples,
  WD_DEGs,
  colIDgene,
  colCounts,
  skip_preN,
  grContrast,
  filter,
  model,
  normMethod,
  min_count,
  min_total_count,
  large_n,
  min_prop,
  adjustPvalue,
  Th_logFC,
  Th_Pvalue
)

Value

A list invisibly returned containing any captured plots and log messages; primary results are written to CSV files in "WD_DEGs".

Arguments

gr

Data frame. Sample metadata with columns Samples and Groups.

WD_samples

Character. Directory containing raw count .tab files.

WD_DEGs

Character. Directory in which to write results and logs.

colIDgene

Integer. Column index in each count file for gene IDs.

colCounts

Integer. Column index in each count file for raw counts.

skip_preN

Integer. Number of header lines to skip when reading count files.

grContrast

Data frame. Two-column table with Test and Baseline group names for contrasts.

filter

Character. Filtering method: "filterByExpr" or "HTSFilter".

model

Character. Statistical test: "exactTest", "glmQLFTest", or "glmLRT".

normMethod

Character. Normalization method for edgeR (e.g., "TMM", "RLE").

min_count

Numeric. Minimum count per gene for "filterByExpr".

min_total_count

Numeric. Minimum total count per gene for "filterByExpr".

large_n

Integer. Sample size threshold for "filterByExpr".

min_prop

Numeric. Proportion threshold for "filterByExpr".

adjustPvalue

Character. P-value adjustment method (e.g., "fdr", "holm", "none").

Th_logFC

Numeric. Absolute log-fold-change threshold to call differential expression.

Th_Pvalue

Numeric. Adjusted p-value threshold to call differential expression.

Details

This function reads raw count tables, applies expression filtering (via "filterByExpr" or "HTSFilter"), normalizes library sizes, estimates dispersion, fits statistical models ("exactTest", "glmQLFTest", or "glmLRT"), and writes per-contrast results and diagnostic plots.

  1. Reads in per-sample count files and generate a DGEList.

  2. Builds the design matrix and contrast definitions from "grContrast".

  3. Filters lowly expressed genes, normalizes library sizes, and logs filtering summary.

  4. Estimates dispersion (standard or quasi-likelihood).

  5. Runs chosen differential test per contrast, annotates each gene as "UP", "DOWN", or "NO", and writes CSV output files named by filter, model, and contrast.

  6. Captures and saves BCV and QL dispersion plots as SVGs in WD_DEGs.