This function can visualize a filtered eGRN in a very flexible manner and requires a GRN object as generated by build_eGRN_graph.

visualizeGRN(
GRN,
outputFolder = NULL,
basenameOutput = NULL,
plotAsPDF = TRUE,
pdf_width = 12,
pdf_height = 12,
title = NULL,
maxEdgesToPlot = 500,
nCommunitiesMax = 8,
graph = "TF-gene",
colorby = "type",
layout = "fr",
vertice_color_TFs = list(h = 10, c = 85, l = c(25, 95)),
vertice_color_peaks = list(h = 135, c = 45, l = c(35, 95)),
vertice_color_genes = list(h = 260, c = 80, l = c(30, 90)),
vertexLabel_cex = 0.4,
vertexLabel_dist = 0,
forceRerun = FALSE
)

## Arguments

GRN

Object of class GRN

outputFolder

Character or NULL. Default NULL. If set to NULL, the default output folder as specified when initiating the object in link{initializeGRN} will be used. Otherwise, all output from this function will be put into the specified folder. We recommend specifying an absolute path.

basenameOutput

NULL or character. Default NULL. Basename of the output files that are produced. If set to NULL, a default basename is chosen. If a custom basename is specified, all output files will have the chosen basename as file prefix, be careful with not overwriting already existing files (if forceRerun is set to TRUE)

plotAsPDF

TRUE or FALSE. Default TRUE.Should the plots be printed to a PDF file? If set to TRUE, a PDF file is generated, the name of which depends on the value of basenameOutput. If set to FALSE, all plots are printed to the currently active device. Note that most functions print more than one plot, which means you may only see the last plot depending on your active graphics device.

pdf_width

Number>0. Default 12. Width of the PDF, in cm.

pdf_height

Number >0. Default 12. Height of the PDF, in cm.

title

NULL or Character. Default NULL. Title to be assigned to the plot.

maxEdgesToPlot

Integer > 0. Default 500. Refers to the maximum number of connections to be plotted. If the network size is above this limit, nothing will be drawn. In such a case, it may help to either increase the value of this parameter or set the filtering criteria for the network to be more stringent, so that the network becomes smaller.

nCommunitiesMax

Integer > 0. Default 8. Maximum number of communities that get a distinct coloring. All additional communities will be colored with the same (gray) color.

graph

Character. Default TF-gene. One of: TF-gene, TF-peak-gene. Whether to plot a graph with links from TFs to peaks to gene, or the graph with the inferred TF to gene connections.

colorby

Character. Default type. Either type or community. Color the vertices by either type (TF/peak/gene) or community. See calculateCommunitiesStats

layout

Character. Default fr. One of star, fr, sugiyama, kk, lgl, graphopt, mds, sphere

vertice_color_TFs

Named list. Default list(h = 10, c = 85, l = c(25, 95)). The list must specify the color in hcl format (hue, chroma, luminence). See the colorspace package for more details and examples

vertice_color_peaks

Named list. Default list(h = 135, c = 45, l = c(35, 95)).

vertice_color_genes

Named list. Default list(h = 260, c = 80, l = c(30, 90)).

vertexLabel_cex

Numeric. Default 0.4. Font size (multiplication factor, device-dependent)

vertexLabel_dist

Numeric. Default 0 vertex. Distance between the label and the vertex.

forceRerun

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

## Value

The same GRN object, without modifications.

build_eGRN_graph

## Examples

GRN = loadExampleObject()