Skip to content
songif edited this page Jun 12, 2026 · 6 revisions

DSGE: Disruption Score of Gene Expression

Pathway-level transcriptional perturbation analysis. Converts differential expression p-values into absolute z-scores and tests whether GO pathways show significantly stronger transcriptional disruption than expected by chance, using permutation-based null distributions with optional GPD tail extrapolation.

Installation

# install.packages("devtools")   # if not already installed
devtools::install_github("LHJLab/DSGE")

Quick Start

library(DSGE)
library(org.Hs.eg.db)

# Build pathway-gene map from Bioconductor OrgDb
pw <- get_pathway_genes_db(org.Hs.eg.db, min_size = 10)

# Read DE results (any tool — DESeq2, edgeR, limma, Seurat, etc.)
res <- read.csv("your_de_results.csv")

# Run pathway analysis
result <- pathway_dsge(pw, pvalue = res$pvalue, base_mean = res$AveExpr,
                        gene_names = res$gene, gene_id_col = "db_object_symbol",
                        n_perm = 100000, n_cores = 4,
                        directional = TRUE, direction_vec = res$log2FoldChange,
                        nds_top_frac = 0.25,
                        return_null = TRUE)

# Significant pathways
head(result$table[result$table$p_adj < 0.05, c("go_id", "go_name", "dsge_std", "p_adj")])

# Plot null distribution for selected pathways
plot_dsge(result, go_ids = c("GO:0007264", "GO:0018108"))

Workflow

The typical DSGE analysis follows these steps:

Step Function Description
1 read.csv() Import differential expression results
2 read_gaf() / read_obo() Read GO annotation files (GAF mode)
3 get_pathway_genes() / get_pathway_genes_db() Build pathway-gene mapping
4 pathway_dsge() Core analysis (permutation test for all pathways)
5 plot_dsge() Visualise null distributions

See the sidebar for detailed documentation of each step.

Clone this wiki locally