plotNetworkGraph {NAIR} | R Documentation |
Plot the Graph of an Immune Repertoire Network
Description
Given the igraph
of an immune repertoire network,
generates a plot of the network graph according to the user specifications.
Deprecated. Replaced by addPlots()
.
Usage
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
)
Arguments
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 |
Value
A ggraph
object.
Author(s)
Brian Neal (Brian.Neal@ucsf.edu)
References
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
See Also
Examples
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)