SigFun is an innovative computational framework that leverages whole-transcriptome data to systematically analyze multi-gene signature functions at the system level. SigFun overcomes the limitations of traditional single-gene interpretation and small gene set approaches by providing comprehensive functional insights into clinically validated yet mechanistically opaque signatures. SigFun effectively bridges the critical gap between established clinical utility and biological understanding, enabling researchers to uncover the mechanistic basis underlying signature predictive power in precision medicine applications.
- System-level analysis: Utilizes whole-transcriptome data for comprehensive functional interpretation
- Flexible input: Supports both numeric and binary signature formats
- Rich visualization: 12+ visualization functions for multi-perspective result interpretation
- Streamlined workflow: One-click analysis from SummarizedExperiment input to biological insights
-
QuickStart with Streamlined Workflow - Minimal working example and a demonstration of the streamlined
sig2Funworkflow using built-in test data. Start here to verify installation and understand the basic workflow. -
Data Preparation - How to build the required
SummarizedExperiment: expression,rowData,colData, andt2g(with quick validators). Start here if your data isn’t in SE format yet. -
Stepwise Workflow (
sigCor→ GSEA → plots) - Runs correlation and enrichment separately so you can inspect/modifycor.df, change ranking metrics, or swap enrichment settings. Use for advanced customization. -
Visualization Functions - What each SigFun plotting function does (bar, dot, heat, cnet, emap, tree, ridge, lollipop, UpSet, gsea, chord diagram) with concise usage examples. Use when crafting publication figures.
-
Custom Gene Ranking - Plug in your own gene-level stats (e.g.,
log2FC,zscore) by attaching acor.dfand settingranking.method. Use when you already computed rankings externally.
Ensure you have R 4.4.0 or later installed. You can download R from http://www.r-project.org. If you are a Windows user, install RTools following the guide in the CRAN official wed site https://cran.r-project.org/bin/windows/.
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c(
"org.Hs.eg.db",
"BiocManager",
"enrichplot",
"clusterProfiler",
"S4Vectors",
"DOSE",
"SummarizedExperiment",
"BiocStyle"
))install.packages(c(
"msigdbr",
"ggridges",
"DT",
"pandoc",
"dplyr",
"ggplot2",
"ggpubr",
"tibble",
"tidyr",
"scales",
"stringr",
"GseaVis",
"circlize",
"cli",
"forcats",
"igraph",
"randomcoloR",
"yulab.utils",
"devtools",
"roxygen2",
"rmarkdown",
"testthat",
"knitr",
"tidyverse"
))# Update repositories
options(repos = c(
CRAN = "https://cloud.r-project.org/",
BiocManager::repositories()))
# Install SigFun from GitHub
devtools::install_github(
"BioinfOMICS/SigFun",
build_vignettes = TRUE,
dependencies = TRUE)library(SigFun)
library(dplyr)# Load example data
data("demo_GSE181574")
# Construct SummarizedExperiment object
GSE181574.sigfun <- SummarizedExperiment::SummarizedExperiment(
assays = list(abundance = as.matrix(expr.data)),
rowData = S4Vectors::DataFrame(mapping, row.names = mapping$ensg_id),
colData = S4Vectors::DataFrame(SIG_MAT))
# Check the structure
show(GSE181574.sigfun)# Perform signature functional analysis
# Note: This demo uses a binary (1/0) classification signature
GSE181574.sigfun.res <- sig2Fun(
GSE181574.sigfun,
cor.method = "logit", # Use "logit" for binary signatures
t2g = t2g, # Ontology dataset
strings = c("GOBP", "GOCC", "GOMF", "KEGG",
"REACTOME", "WP", "HALLMARK", "SIGNALING"))
# View results summary
show(GSE181574.sigfun.res)# Extract GSEA results
GSEA_result <- GSE181574.sigfun.res@metadata$gseaResult@result
# View top positively enriched GO Biological Process terms
GSEA_result %>%
dplyr::slice(grep("GOBP", GSEA_result$ID)) %>%
dplyr::arrange(desc(NES)) %>%
dplyr::select(ID, Description, NES, pvalue, p.adjust, qvalue) %>%
head(10)
# View top negatively enriched terms
GSEA_result %>%
dplyr::slice(grep("GOBP", GSEA_result$ID)) %>%
dplyr::arrange(NES) %>%
dplyr::select(ID, Description, NES, pvalue, p.adjust, qvalue) %>%
head(10)# Generate heatmap visualizations
All_heatmaps <- GSE181574.sigfun.res@metadata$heatmap
# Display GO Biological Process heatmap
All_heatmaps$GOBP
# Display HALLMARK pathway heatmap
All_heatmaps$HALLMARKThe visualization includes: - Carplot (left): NES value visualization - NES (middle-left): Statistical results with NES and p-values - Enrichment plot (middle-right): Gene distribution across the transcriptome - Function name (right): Official pathway/function names
SigFun provides 12+ visualization functions for comprehensive result interpretation:
-
plot_heat()— Integrative multi-panel heatmap summarizing pathways by NES, p-values, and enrichment curves. -
barPlot()— Bar chart ranking top enriched pathways by significance or enrichment score. -
chordPlot()— Circular diagram linking genes to enriched pathways to show shared and unique memberships. -
cnetPlot()— Category–gene network visualizing shared genes and connectivity among pathways. -
dotPlot()— Dot chart encoding significance and gene ratio across pathways. -
emapPlot()— Enrichment map network showing similarity between pathways based on shared genes. -
gseaPlot()— Per-pathway running enrichment score curve with ranked gene metrics. -
heatPlot()— Simple gene × pathway dot heatmap encoding correlation and significance. -
lollipopPlot()— NES-oriented lollipop chart comparing enrichment magnitude and direction. -
ridgePlot()— Ridge density plot showing gene ranking distributions within each pathway. -
treePlot()— Hierarchical clustering tree grouping pathways by gene overlap or similarity. -
upsetPlot()— UpSet diagram illustrating intersections of genes among enriched pathways.
Choose the appropriate correlation method based on your signature type:
- Numeric signatures: Use
cor.method = "spearman"(default),"pearson", or"kendall" - Binary signatures: Use
cor.method = "logit"(univariate logistic regression)
SigFun requires a SummarizedExperiment object with:
- Assay: Gene expression matrix (genes × samples)
- RowData: Gene information including
ensg_id,gene_symbol, andgene_biotype - ColData: Sample information with
sample_idand signaturevalue
This project is licensed under the MIT License.