Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEGprepR

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, and status

It accepts SYMBOL, ENTREZID, or ENSEMBL input IDs and can convert to any of those three output types.

Authors

  • 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.

Tutorials

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.

Installation

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)

1. DEG gene lists for ORA / GOFunction

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$BACKGROUND

For GOFunction, for example:

interestGenes <- genes$UP
refGenes <- genes$BACKGROUND

2. GSEA ranked vector

geneList <- 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.

3. ENSEMBL input

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.

4. Gene IDs stored in a column

prepare_deg(
    object = res,
    gene_col = "gene_id",
    input_type = "ENSEMBL",
    output_type = "ENTREZID",
    return_type = "table",
    OrgDb = org.Hs.eg.db
)

5. Automatic ID detection

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.

DEG definition

By default:

  • UP: padj < 0.05 and log2FoldChange > 1
  • DOWN: padj < 0.05 and log2FoldChange < -1
  • NS: all remaining genes

Both cutoffs are user-adjustable.

About

gene ID conversion; Prepare Differential Expression Results for ORA and GSEA

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages