Plot a permutation difference network e experiment object
Source:R/analysis_plotting_functions.R
plot_perm_diff_network.Rd
Plot a permutation difference network e experiment object
Usage
plot_perm_diff_network(
e,
permutation_group,
channel = "cfos",
layout = "stress",
seed = 30,
degree_scale_limit = c(1, 15),
node_size_range = c(3, 15),
edge_color_pos = "#04C3C3",
edge_color_neg = "#BF1F1F",
anatomical.colors = c(Isocortex = "#70ff71", OLF = "#75aadb", HPF = "#7ed04b", CTXsp =
"#8ada87", CNU = "#98d6f9", TH = "#ff7080", HY = "#e64438", MB = "#ff64ff", HB =
"#ff9b88"),
pos_edge_legend_label = "",
neg_edge_legend_label = "",
correlation_edge_width_limit = c(0, 2),
edge_thickness_range = c(0, 6),
node_text_size = 12,
graph_theme = NULL,
mark_hull = TRUE,
save_plot = TRUE,
height = 15,
width = 15,
image_ext = ".png"
)
Arguments
- e
experiment object
- permutation_group
(str) Supply names of the specific analyses found under
e$permutation_p_matrix %>% names()
- channel
(str, default = "cfos")
- layout
(str, default = "stress") equivalent to the ggraph
layout
parameter.- seed
random seed for replication
- degree_scale_limit
(vec, default = c(1,15)) Scale limit for degree size
- node_size_range
(default = c(1,8)) Node size range.
- edge_color_pos
(str, default = "#04C3C3") Color of the edges representing positive correlation differences
- edge_color_neg
(str, default = "#BF1F1F") Color of the edges representing negative correlation differences
- anatomical.colors
(vec, default = c(Isocortex = "#70ff71", OLF = "#75aadb", HPF = "#7ed04b", CTXsp = "#8ada87", CNU = "#98d6f9", TH = "#ff7080", HY = "#e64438", MB = "#ff64ff", HB = "#ff9b88")) Colors for the parent region as a named vector of hexadecimal regions.
- pos_edge_legend_label
(str, default = "") Legend label for positive difference edges, e.g. "Iso > Ctrl"
- neg_edge_legend_label
(str, default = "") Legend label for negative difference edges, e.g. "Iso < Ctrl"
- correlation_edge_width_limit
(default = c(0, 2)) Range of correlation differences in the network.
- edge_thickness_range
(default = c(0,6)) Range for the width size of the edges.
- node_text_size
(default = 12) Font size for node text.
- graph_theme
(default = NULL) Add a
ggraph::theme_graph()
to the network graph. If NULL, the default is taken.- mark_hull
(bool, default = TRUE) Plot detected communities using a convex hull polygon.
- save_plot
(bool, default = TRUE) Save into the figures subdirectory of the the experiment object output folder.
- height
Height of the plot in inches.
- width
width of the plot in inches.
- image_ext
(default = ".png")
Examples
if (FALSE) {
p <- plot_perm_diff_network(anesthesia,
permutation_group = "Control_vs_Isoflurane",
channel = "cfos",
pos_edge_legend_label = "Iso > Ctrl",
neg_edge_legend_label = "Iso < Ctrl",
layout = "fr",
mark_hull=TRUE,
node_text_size = 14,
seed = 15,
width = 20,
height = 20,
graph_theme = graph_theme,
anatomical.colors = anatomical.colors,
image_ext = ".png")
}