iobr_deg: Differential Expression Analysis

View source: R/iobr_deg.R

iobr_degR Documentation

Differential Expression Analysis

Description

Performs differential expression analysis on gene expression data using either the DESeq2 or limma method. It includes pre-processing steps like filtering low count data, and calculates fold changes and adjusted p-values. Optionally, it generates visualization outputs such as volcano plots and heatmaps. The results are saved in both RData and Excel file formats.

Usage

iobr_deg(
  eset,
  annotation = NULL,
  id_anno = NULL,
  pdata,
  group_id = "group",
  pdata_id = "ID",
  array = FALSE,
  method = "DESeq2",
  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

eset

A matrix of gene expression data where rows represent genes and columns represent samples.

annotation

(Optional) An object for mapping gene IDs to gene names, defaults to NULL.

id_anno

An optional parameter that specifies the identifier used to match the annotation data to the row names of 'eset'.

pdata

A DataFrame containing sample information and grouping labels necessary for differential analysis.

group_id

The name of the column in ‘pdata' that contains the grouping labels, defaults to ’group'.

pdata_id

The name of the column in ‘pdata' that specifies the sample IDs, defaults to ’ID'.

array

A logical indicating whether to perform quantile normalization on the expression data, defaults to TRUE.

method

The method used for differential expression analysis, with options 'DESeq2' or 'limma', default is 'DESeq2'.

contrast

Specifies the contrast groups for comparison, default is c("High", "Low").

path

The directory path where the results should be saved, if NULL, it defaults to creating a 'Result-of-DEGs' folder.

padj_cutoff

The cutoff for adjusted p-values to determine significant changes, default is 0.01.

logfc_cutoff

The log2 fold change cutoff for significance, default is 0.5.

volcano_plot

A logical indicating if a volcano plot should be generated, default is FALSE.

col_volcano

Specifies the color index for the volcano plot, default is 1.

heatmap

A logical indicating if a heatmap should be generated, default is TRUE.

col_heatmap

Specifies the color index for the heatmap, default is 1.

parallel

A logical value indicating if the DESeq2 or limma should run in parallel, default is FALSE.

Value

Returns an object containing the differentially expressed genes with additional statistics like log2 fold changes and adjusted p-values.

Author(s)

Dongqiang Zeng

Examples

data("eset_stad", package = "IOBR")
data("stad_group", package = "IOBR")
library(DESeq2)
deg<- iobr_deg(eset  = eset_stad, pdata = stad_group, group_id = "subtype", pdata_id = "ID", array = FALSE, method = "DESeq2", contrast = c("EBV","GS"), path = "STAD")

IOBR/IOBR documentation built on April 3, 2025, 2:19 p.m.