Skip to contents

The function is used to merge the results obtained by multiple cross-talk analyses by creating a union network and highlighting the shared edges and vertices

Usage

comparing_results_network(
  res_list,
  vertex_number = F,
  vertex_number_pal = NULL,
  vertex_number_adj = 0.7,
  vertex_size = 5,
  vertex = NULL,
  vertex_pal = NULL,
  voronoi_radius = 0.8,
  voronoi_alpha = 0.3,
  vertex_label = TRUE,
  edge_color_by = "number",
  edge_width = TRUE,
  edge_pal = NULL,
  edge_adj_col = 0.7,
  file_out,
  width = 200,
  height = 200,
  res = 300,
  units = "mm",
  ...
)

Arguments

res_list

list of resulting data.frame from `gs_cross_talk()`

vertex_number

logical, if the vertices should be colored by the number of results in which are present

vertex_number_pal

vector of two colors to be used for gradient coloring the vertices when `vertex_number = TRUE`. If `NULL` the gradient is build from "red" to "blue".

vertex_number_adj

value used to set transparency to vertex colors in `vertex_number_pal`

vertex_size

size of the vertices

vertex

can be either `name` value to color the vertices according to their name, or a list of two vector, where the first is the name of the attribute and the second is a named vector with the attribute per vertices to be used for color (only discrete value), or `NULL` if the vertices should be not colored (thus "grey65" is passed as default color). If `vertex_number = TRUE`, `vertex` is represented as cells of voronoi tessellation (see `ggraph::geom_node_voronoi()`)

vertex_pal

named vector with the colors to be used for each unique `vertex` element. If `NULL` pals::alphabet2() palette is used

voronoi_radius, voronoi_alpha

parameters passed to `geom_node_voronoi()`. If both `vertex` and `vertex_number` arguments are enabled, then the first is represented as cells of voronoi tessellation (see `ggraph::geom_node_voronoi()`). In this case, these argument are used to control the radius of the cells and the transparency, respectively.

vertex_label

logical, if vertex names should be plotted or not, or a named vector, with the label that should be associated to each vertex named by them

edge_color_by

=c("number","which") if the edges should be colored by number of results that share that edge ("number") or which results contain it ("which")

edge_width

logical, if the edge width should be proportional to the number of results that share that edge.

edge_pal

palette used to color the edges according to `edge_color_by`. If `edge_color_by="number` than the palette should be the two color used for gradient coloring them; if `NULL` "red" to "blue" is used. If `edge_color_by="which` than the palette should be a (named) vector with enought colors for each results name combination

edge_adj_col

value used to adjust color transparency of the edges

file_out

name used to save the plot in jpeg format plot. If `NULL` the functions returns also the plot object

width, height, res, units

graphical value of `jpeg()` function

...

further graphical parameters to be passed to `ggraph()` function

Value

If `file_out` is null the function returns the plot and the igraph object used for plotting. Otherwise, only the igraph object is returned and the plot is saved through to `file_out`

Details

The function takes as an input a list of data.frames resulting from multiple `gs_cross_talk()` analyses and produce a union network that will be plotted with the edges colored by the number or which of results that have that cross-talk