Color edges by nodegroups
Usage
color_edges_by_nodegroups(
g,
nodegroups = NULL,
nodegroup_colors = NULL,
edge_alpha = NULL,
Crange = NULL,
Lrange = NULL,
darkFactor = 1,
sFactor = 1,
naColor = "grey",
verbose = FALSE,
...
)Arguments
- g
igraphobject that contains vertex node attribute"color"as seen withigraph::vertex_attr(g, "color").- nodegroups
listorcommunitiesobject that references nodes ingand assigns one or more to nodegroups. Default NULL callsget_cnet_nodeset(), passing '...' for customization.- nodegroup_colors
characteror default NULL which assigns categorical colors bycolorjam::rainbowJam().- edge_alpha
numericof default NULL uses 1, with opacity where 0 is transparent, 1 is completely solid.- Crange, Lrange
numericranges passed tocolorjam::rainbowJam()to restrict the chroma and luminance of categorical colors. Default NULL uses the defaults incolorjam::rainbowJam().- darkFactor, sFactor
numericdefault 1 each, used to darken and saturate colors, respectively. When either contain values other than 1, it callsjamba::makeColorDarker().- naColor
charactercolor, default 'grey', used for edges that for any reason were not assigned to a nodegroup, to prevent them from becoming NA.- verbose
logicalindicating whether to print verbose output.- ...
additional arguments are passed to
colorjam::blend_colors().
Value
igraph object with edge color attribute updated to
represent the result of blending node colors, seen by
igraph::edge_attr(g)$color.
Details
This function is analogous to color_nodes_by_nodegroups(), and
in fact uses the same nodegroup color strategy. However,
by default 'Set' nodes are not colored, and therefore edges
are only colored using the nodegroup.
Using filter_set_only=FALSE, which is passed to get_cnet_nodeset(),
will assign 'Set' nodes to their own nodegroups, giving them
colors. At that point, edges will blend colors for the 'Set'
and 'Gene' nodes.
See also
Other jam igraph utilities:
color_edges_by_nodes(),
color_nodes_by_nodegroups(),
get_cnet_nodeset(),
jam_igraph(),
launch_shinycat(),
subgraph_jam()
Examples
cnet1 <- make_cnet_test()
igraph::vertex_attr(cnet1, "shape") <- "circle";
cnet2 <- color_nodes_by_nodegroups(cnet1)
cnet3 <- color_edges_by_nodegroups(cnet2)
jam_igraph(cnet3)
cnet2b <- color_nodes_by_nodegroups(cnet1, filter_set_only=FALSE)
cnet3b <- color_edges_by_nodegroups(cnet2b, filter_set_only=FALSE)
jam_igraph(cnet3b)