Plot the networks stored in an experiment object
Source:R/analysis_plotting_functions.R
plot_joined_networks.Rd
Plot the networks stored in an experiment object
Usage
plot_joined_networks(
e,
correlation_list_names = c("male_agg", "female_non"),
title = NULL,
channels = "cfos",
absolute_weight = TRUE,
edge_colors = c(male_agg_pos = "#06537f", male_agg_neg = "#526c7a", female_non_pos =
"#C70039", female_non_neg = "#71585f"),
edge_color_labels = c(male_agg_pos = "Positive male", male_agg_neg = "Negative male",
female_non_pos = "Positive female", female_non_neg = "Negative female"),
height = 15,
width = 15,
region_legend = TRUE,
degree_scale_limit = c(1, 10),
correlation_edge_width_limit = c(0.8, 1),
image_ext = ".png",
print_plot = FALSE,
graph_theme = NULL,
transparent_edge_group1 = TRUE,
transparent_edge_group2 = FALSE,
label_size = 5,
label_offset = 0.15,
edge_thickness_range = c(1, 5),
node_size_range = c(1, 8),
anatomical.colors = NULL,
save_plot = TRUE
)
Arguments
- e
experiment object
- correlation_list_names
(str vec) character vector of the two correlation lists used to include in a joined network, e.g.,
correlation_list_names = c("male_agg", "female_non")
- title
(str, default = NULL) Title of network plot
- channels
(str, default = c("cfos", "eyfp", "colabel"))
- absolute_weight
(bool, default = TRUE) Whether to plot absolute weights. If TRUE, the edge_colors and edge_colors_label should not contain values for positive and negative correlations.
- edge_colors
(vec) vector of hexidecimal codes as strings. Assign a group name to the vector element. e.g. c(male_agg_pos = "#06537f", male_agg_neg = "#526c7a", female_non_pos = "#C70039", female_non_neg = "#71585f")
- edge_color_labels
(vec) vector of edge labels as strings. e.g. c(male_agg_pos = "Positive male", male_agg_neg = "Negative male", female_non_pos = "Positive female", female_non_neg = "Negative female")
- height
Height of the plot in inches.
- width
width of the plot in inches.
- region_legend
(default = TRUE) Boolean determining whether or not to show the region legend categorizing subregions into their largest parent region. Only works well if the Allen ontology is used for the dataset.
- degree_scale_limit
(vec, default = c(1,10)) Scale limit for degree size
- correlation_edge_width_limit
(default = c(0.8, 1)) Range for the width size of the edges.
- image_ext
(default = ".png") image extension to the plot as.
- print_plot
(bool, default = FALSE) Whether to print the plot as an output. the experiment object output folder.
- graph_theme
(default = NULL) Add a
ggraph::theme_graph()
to the network graph. If NULL, the default is taken.- transparent_edge_group1
(bool) logical to render edges transparent
- transparent_edge_group2
(bool) logical to render edges transparent
- label_size
(default = 5) Default font size for network region labels.
- label_offset
(default = 0.15) Distance of label from nodes.
- edge_thickness_range
(default = c(1,5))
- node_size_range
(default = c(1, 8))
- anatomical.colors
(NuLL or vec, default = NULL) Colors for the parent region as a named vector of hexadecimal regions. Can also be a hexadecimal color code written as a string.
- save_plot
(bool, default = TRUE) Save into the figures subdirectory of the the experiment object output folder.
Value
p_list A list the same length as the number of channels, with each element containing a plot handle for that channel.
Examples
if (FALSE) {
p_list <- plot_joined_networks(anesthesia, correlation_list_names = c("male_agg", "female_non"),
channels = "cfos", edge_colors = c(male_agg = "#06537f", female_non = "#C70039"),
edge_color_labels = c(male_agg = "Male aggressor", female_non = "Female non-aggressor"),
degree_scale_limit = c(1,45), correlation_edge_width_limit = c(0.8, 1.0),
height = 30, width = 30, label_size = 13, label_offset = 0.08, image_ext = ".png")
}