Create an interactive UpSet plot of overlapping DEGs using "UpsetJS".
UpsetjsPlot(
WD_samples,
Th_logFC,
Th_Pvalue,
collapseName,
nintersects,
st_significance
)
An interactive "UpsetJS" object.
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".
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.
Lists all CSV files in "WD_samples" and reads each into a data frame.
Checks for duplicate IDs and selects "ID", "logFC", and either "adjustPvalue" or "PValue".
Filters each set by "|logFC| >= Th_logFC" and p-value < "Th_Pvalue".
Renames each gene-ID list to the (optionally collapsed) file name.
Feeds the list of gene sets into "upsetjs::upsetjs()"