Skip to contents

The function elaborates the results of `gs_cross_talk()` functions to obtain a graphical representation of the cross-talk network

Usage

plot_network_CT(
  ct,
  filtering = FALSE,
  p_val,
  FDR,
  ct_val,
  community,
  pal_community = NULL,
  voronoi_radius = 0.8,
  voronoi_alpha = 0.3,
  vertex = "name",
  vertex_pal = NULL,
  vertex_size = 5,
  vertex_label = TRUE,
  edge_col_by = "ct_score",
  edge_pal = NULL,
  edge_width = T,
  edge_adj_col = 0.7,
  file_out = NULL,
  width = 200,
  height = 200,
  res = 300,
  units = "mm",
  ...
)

Arguments

ct

output of `gs_cross_talk()` function

filtering

logical, if the function have to plot all the edges or only the significant ones. If `TRUE`, the function uses `p_val, FDR` and `ct_val` to identify the significant ones, that are plotted with a solid line, and the not significant with a dashed line. If `FALSE`, all edges are plotted as a solid line.

p_val, FDR, ct_val

filtering values. If one of these is set to `NULL` the function ignores it

community

logical or an object resulting from igraph community calculation. If `TRUE`, the function calculates the communities by using fastgreedy algorithm, if `FALSE` the function does not consider communities. Otherwise, if a community object is provided, the function uses it and color the vertices accordingly

pal_community

color palette to be used to color the vertices according to the communities. If not provided, the function uses `rainbow()` palette. If `community = FALSE` the function ignores it

voronoi_radius, voronoi_alpha

parameters passed to `geom_node_voronoi()`. If both `vertex` and `community` arguments are enabled, the the communities are 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

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)

vertex_pal

color palette used to color vertices. Should be a named vector with the names corresponding to the unique elements in `vertices`. If `NULL` the functions will use pals::alphabet2 as default

vertex_size

size of the vertices in the plot

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_col_by

name of the column to be used to color the edges. Default = `ct_score`

edge_pal

color to be used to create the gradient to color the edges. If not provided, the function uses "blue" to "red"

edge_width

logical, if the edge widths should be proportional to `edge_col_by` values

edge_adj_col

value used to adjust color transparency of the edges

file_out

name of the jpeg file produced. 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 (which may contain the communities under `comm_id` attribute). Otherwise, only the igraph object is returned and the plot is saved through to `file_out`

Details

The functions uses `gs_cross_talk()` output to build a cross-talk network. Then, the network is plotted with the edges colored by a value of interest. The user may decide if to plot all the edges, color the vertices by their community, scale the dimension of the edges over a variable of interest.