Generate an UpSet plot of overlapping DEGs across multiple contrasts.
UpSetPlot(
WD_samples,
Th_logFC,
Th_Pvalue,
collapseName,
nintersects,
st_significance,
scale
)
An UpSet plot.
Character. Directory containing DEG result CSV files.
Numeric. Absolute log2 fold-change threshold to include a gene.
Numeric. P-value threshold for significance (0 < Th_Pvalue <= 1).
Logical. If TRUE, strip method/model prefixes from file names when labeling sets.
Integer. Maximum number of intersections to display.
Character. Which p-value to use: "adjustPvalue" (FDR or FWER) or "PValue".
Numeric. Text scaling factor for plot labels and annotations.
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 an UpSet plot.
Validates thresholds (Th_logFC >= 0, 0 < Th_Pvalue <= 1).
Lists all CSV files in WD_samples and reads each into a data frame.
Checks for duplicate IDs and standardizes to columns ID, logFC, and adjustPvalue or PValue.
Filters each set of results by |logFC| >= Th_logFC and p-value < Th_Pvalue.
Renames each gene-ID column to the (optionally collapsed) file name.
Converts the list of filtered ID sets to an UpSetR input and calls UpSetR::upset().