View source: R/visualization.R
plotNetworkGraph | R Documentation |
Given the igraph
of an immune repertoire network,
generates a plot of the network graph according to the user specifications.
Deprecated. Replaced by addPlots()
.
plotNetworkGraph(
igraph,
plot_title = NULL,
plot_subtitle = NULL,
color_nodes_by = NULL,
color_scheme = "default",
color_legend = "auto",
color_title = "auto",
edge_width = 0.1,
size_nodes_by = 0.5,
node_size_limits = NULL,
size_title = "auto",
outfile = NULL,
pdf_width = 12,
pdf_height = 8
)
igraph |
An object of class |
plot_title |
A character string containing the plot title. Passed to
|
plot_subtitle |
A character string containing the plot subtitle. Passed to
|
color_nodes_by |
A vector whose length matches the number of nodes in the network.
The values are used to encode the color of each node. An argument value of
|
color_scheme |
A character string specifying the color scale used to color the nodes.
|
color_legend |
A logical scalar specifying whether to display the color legend in the plot.
The default value of |
color_title |
A character string (or |
edge_width |
A numeric scalar specifying the width of the graph edges in the plot.
Passed to the |
size_nodes_by |
A numeric scalar specifying the size of the nodes, or a numeric vector with
positive entires that encodes the size of each node (and whose length matches
the number of nodes in the network). Alternatively, an argument value of
|
size_title |
A character string (or |
node_size_limits |
A numeric vector of length 2, specifying the minimum and maximum node size.
Only applicable if |
outfile |
An optional file path for saving the plot as a pdf. If |
pdf_width |
Sets the plot width when writing to pdf. Passed to the |
pdf_height |
Sets the plot height when writing to pdf. Passed to the |
A ggraph
object.
Brian Neal (Brian.Neal@ucsf.edu)
Hai Yang, Jason Cham, Brian Neal, Zenghua Fan, Tao He and Li Zhang. (2023). NAIR: Network Analysis of Immune Repertoire. Frontiers in Immunology, vol. 14. doi: 10.3389/fimmu.2023.1181825
Network Visualization article on package website
addPlots()
set.seed(42)
toy_data <- simulateToyData()
# Generate network for data
net <- buildNet(toy_data, "CloneSeq")
# Plot network graph
net_plot <- plotNetworkGraph(
net$igraph,
color_nodes_by =
net$node_data$SampleID,
color_title = NULL,
size_nodes_by =
net$node_data$CloneCount,
size_title = "Clone Count",
node_size_limits = c(0.5, 1.5))
print(net_plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.