DEGprepR turns a DESeq2-like differential-expression result table into either:
- ORA / GO input gene lists:
UP,DOWN,DEG,NS,BACKGROUND - GSEA ranked vector: values are log fold-changes and names are the selected gene IDs
- Annotated table: original statistics plus
INPUT_ID,OUTPUT_ID, andstatus
It accepts SYMBOL, ENTREZID, or ENSEMBL input IDs and can convert to any of those three output types.
- Chunlin Pu — concept, workflow design, biological use cases, and package specification
- ChatGPT (OpenAI) — co-design, R implementation, package structure, and documentation
DEGprepR was developed collaboratively from a practical workflow for turning differential-expression results into reusable inputs for ORA, GO analysis, and GSEA.
Full package tutorials are included in both languages:
- 中文教程:
inst/doc/DEGprepR_Chinese_Tutorial.md - English tutorial:
inst/doc/DEGprepR_English_Tutorial.md
They cover DEG classification, ID conversion, ORA/GOFunction input, GSEA ranked vectors, non-default column names, ENSEMBL versions, duplicated IDs, other organisms, and common questions.
install.packages("/path/to/DEGprepR_0.1.2.tar.gz", repos = NULL, type = "source")Bioconductor dependencies for human data:
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("AnnotationDbi", "org.Hs.eg.db"))Then:
library(DEGprepR)If gene symbols are in row names:
library(org.Hs.eg.db)
genes <- prepare_deg(
object = res,
input_type = "SYMBOL",
output_type = "ENTREZID",
return_type = "gene_list",
padj_cutoff = 0.05,
logfc_cutoff = 1,
OrgDb = org.Hs.eg.db
)
genes$UP
genes$DOWN
genes$DEG
genes$BACKGROUNDFor GOFunction, for example:
interestGenes <- genes$UP
refGenes <- genes$BACKGROUNDgeneList <- prepare_deg(
object = res,
input_type = "SYMBOL",
output_type = "ENTREZID",
return_type = "gsea",
OrgDb = org.Hs.eg.db
)
head(geneList)The result has the standard form:
ENTREZID -> log2FoldChange
7157 4.21
4609 3.72
...
The GSEA vector deliberately uses all mapped genes, not only significant DEGs.
genes <- prepare_deg(
object = res,
input_type = "ENSEMBL",
output_type = "SYMBOL",
return_type = "gene_list",
OrgDb = org.Hs.eg.db
)ENSEMBL version suffixes such as ENSG00000141510.18 are removed automatically by default.
prepare_deg(
object = res,
gene_col = "gene_id",
input_type = "ENSEMBL",
output_type = "ENTREZID",
return_type = "table",
OrgDb = org.Hs.eg.db
)prepare_deg(
object = res,
input_type = "AUTO",
output_type = "ENTREZID",
return_type = "gene_list",
OrgDb = org.Hs.eg.db
)For formal analyses, explicitly specifying input_type is recommended.
By default:
UP:padj < 0.05andlog2FoldChange > 1DOWN:padj < 0.05andlog2FoldChange < -1NS: all remaining genes
Both cutoffs are user-adjustable.