Generate Upset plots of an arbitrary list of GRaNIE objects to compare connections either on the TF-peak, TF-gene, peak-gene or TF-peak-gene level.

compareConnections_upsetPlots(
  GRN.list,
  type = c("TF-peak", "TF-gene", "TF-peak-gene", "peak-gene"),
  type_TFPeak = "all.filtered",
  type_TFPeak_fdr = 0.2,
  type_TFPeak_r_abs = 0.4,
  type_peakGene = "all.filtered",
  type_peakGene_praw = 0.1,
  type_peakGene_r_abs = 0.4,
  compareMethod = "p",
  outputDir = paste0(getwd(), "/summary"),
  outputFile_prefix = "upsetPlot",
  maxIntersects = 40,
  plotSubsets = FALSE,
  plotAsPDF = TRUE,
  pdf_width = 10,
  pdf_height = 10,
  forceRerun = FALSE
)

Arguments

GRN.list

A list of GRaNIE objects. This list can either be manually defined by constructing a list that contains an arbitrary number of GRaNIE objects or the helper functions generateGRNList_custom or generateGRNList_Seurat can be used to automatically populate that list given a specific root directory in which GRaNIE objects are located.

type

Character vector specifying the type of connections to compare. Options are `"TF-peak"`, `"TF-gene"`, `"TF-peak-gene"`, and `"peak-gene"`.

type_TFPeak

Character string specifying the type of TF-peak connections to consider. Default is `"all.filtered"`.

type_TFPeak_fdr

Numeric value specifying the FDR threshold for TF-peak connections. Default is `0.2`.

type_TFPeak_r_abs

Numeric value specifying the absolute correlation threshold for TF-peak connections. Default is `0.4`.

type_peakGene

Character string specifying the type of peak-gene connections to consider. Default is `"all.filtered"`.

type_peakGene_praw

Numeric value specifying the raw p-value threshold for peak-gene connections. Default is `0.2`.

type_peakGene_r_abs

Numeric value specifying the absolute correlation threshold for peak-gene connections. Default is `0.4`.

compareMethod

Character string specifying the method to compare connections. Default is `"p"`.

outputDir

Character string specifying the directory to save the output files. Default is the current working directory.

outputFile_prefix

Character string specifying the prefix for the output file names. Default is `"upsetPlot"`.

maxIntersects

Integer value specifying the maximum number of intersections to plot. Default is `40`.

plotSubsets

Logical value indicating whether to plot subsets. Default is `FALSE`.

plotAsPDF

Logical value indicating whether to save the plots as PDF files. Default is `TRUE`.

pdf_width

Numeric value specifying the width of the PDF plot. Default is `10`.

pdf_height

Numeric value specifying the height of the PDF plot. Default is `10`.

forceRerun

A logical value indicating whether to force rerun the function and re-generate the output even if the output files already exist on disk or in the object. Default is FALSE.

Value

The function does not return a value but generates UpSet plots saved in the specified output directory.

Examples

if (FALSE) {
# Example usage:
GRN.list <- list(GRN1, GRN2, GRN3)
compareConnections_upsetPlots(GRN.list, type = "TF-peak", outputDir = "results/")
}