This helper function provides an easy and flexible way to retain particular connections for plotting and discard all others. Note that this filtering is only relevant and applicable for the function `visualizeGRN()` and ignored anywhere else. This makes it possible to visualize only specific TF regulons or to plot only connections that fulfill particular filter criteria. Due to the flexibility of the implementation by allowing arbitrary filters that are passed directly to dplyr::filter, users can visually investigate the eGRN, which is particularly useful when the eGRNs is large and has many connections.

filterConnectionsForPlotting(GRN, plotAll = TRUE, ..., forceRerun = FALSE)

Arguments

GRN

Object of class GRN

plotAll

TRUE or FALSE. Default TRUE. Should all connections be included for plotting? If set to TRUE, all connections are marked for plotting and everything else is ignored. This resets any previous setting. If set FALSE, the filter expressions (if any) are used to determine which connection to plot

...

An arbitrary set of arguments that is used directly, without modification, as input for dplyr::filter and therefore has to be valid expression that dplyr::filter understands. The filtering is based on the all.filtered table as stored in GRN@connections$all.filtered$`0`. Thus, the specific filters can be completely arbitrary for ultimate flexibility and must only adhere to the column names and types as defined in GRN@connections$all.filtered$`0`. See the examples also for what you can do.

forceRerun

TRUE or FALSE. Default FALSE. Force execution, even if the GRN object already contains the result. Overwrites the old results.

Value

An updated GRN object, with added data from this function.

Examples

# See the Workflow vignette on the GRaNIE website for examples
GRN = loadExampleObject()
#> Downloading GRaNIE example object from https://git.embl.de/grp-zaugg/GRaNIE/-/raw/master/data/GRN.rds
#> Finished successfully. You may explore the example object. Start by typing the object name to the console to see a summaty. Happy GRaNIE'ing!
GRN = filterConnectionsForPlotting (GRN, plotAll = FALSE, TF.ID == "E2F6.0.A")
#> INFO [2024-04-04 17:36:13]  Filter connections for GRN visualization
#> INFO [2024-04-04 17:36:13]  Keep connections for a total of 192 connections
GRN = filterConnectionsForPlotting (GRN, plotAll = FALSE, TF_peak.r > 0.7 | TF_peak.fdr < 0.2)
#> INFO [2024-04-04 17:36:13] Data already exists in object or the specified file already exists. Set forceRerun = TRUE to regenerate and overwrite.
GRN = filterConnectionsForPlotting (GRN, plotAll = FALSE, TF_peak.r > 0.7, TF_peak.fdr < 0.2)
#> INFO [2024-04-04 17:36:13] Data already exists in object or the specified file already exists. Set forceRerun = TRUE to regenerate and overwrite.