Learn R Programming

inDAGO (version 1.0.0)

UpsetjsPlot: UpsetjsPlot

Description

Create an interactive UpSet plot of overlapping DEGs using "UpsetJS".

Usage

UpsetjsPlot(
  WD_samples,
  Th_logFC,
  Th_Pvalue,
  collapseName,
  nintersects,
  st_significance
)

Value

An interactive "UpsetJS" object.

Arguments

WD_samples

Character. Directory containing DEG result CSV files.

Th_logFC

Numeric. Absolute log2 fold-change threshold to include a gene.

Th_Pvalue

Numeric. P-value threshold for significance (0 < Th_Pvalue <= 1).

collapseName

Logical. If TRUE, strip method/model prefixes from file names when labeling sets.

nintersects

Integer. Maximum number of intersections to display.

st_significance

Character. Which p-value to use: "adjustPvalue" (FDR or FWER) or "PValue".

Details

This function reads DEG CSV files from a directory, filters genes by log-FC and p-value thresholds (adjusted or raw), optionally simplifies file names, and visualizes the intersections of gene sets using the "UpsetJS" package.

  1. Lists all CSV files in "WD_samples" and reads each into a data frame.

  2. Checks for duplicate IDs and selects "ID", "logFC", and either "adjustPvalue" or "PValue".

  3. Filters each set by "|logFC| >= Th_logFC" and p-value < "Th_Pvalue".

  4. Renames each gene-ID list to the (optionally collapsed) file name.

  5. Feeds the list of gene sets into "upsetjs::upsetjs()"