summarize_node_spacing: Summarize spacing between igraph nodes given a layout

summarize_node_spacingR Documentation

Summarize spacing between igraph nodes given a layout

Description

Summarize spacing between igraph nodes given a layout

Usage

summarize_node_spacing(
  g,
  layout = NULL,
  nodes = NULL,
  node_groups = NULL,
  each_group = FALSE,
  scaled = FALSE,
  dist_type = c("nearest_node", "all_nodes"),
  verbose = FALSE,
  ...
)

Arguments

g

igraph object

layout

passed together with g to get_igraph_layout()

nodes

character with optional node names, or integer index of nodes in g to define a subset of nodes for which statistics are calculated. Useful to focus on a specific subset of nodes, for example one or two Cnet nodesets.

node_groups

list implemented to use nodesets. The intent is to define node groups, then calculate statistics of node spacing across and within node groups.

each_group

logical indicating whether to include each node group when node_groups is also supplied.

scaled

logical indicating whether to report spacing relative to the max x-axis/y-axis range, similar to the min_percent and percent_spacing argument units in other node spacing functions.

dist_type

character string indicating the type of distance to summarize:

  • "nearest_node" only uses the nearest node to each node, which is helpful when trying to ensure all nodes have a minimum distance from other nodes.

  • "all_nodes" uses all node distances from each node, which is helpful when assessing the overall spacing between nodes.

verbose

logical indicating whether to print verbose output.

...

additional arguments are passed to internal functions.

Details

This function is a simple wrapper to calculate typical distances between nodes in a given network layout. It is experimental, and intended to provide helpful information when determining an appropriate value for percent_spacing to use for example with apply_nodeset_spacing(). The optimal value depends upon the number of nodes overall, also the number of nodes in each nodeset, and the relative position of each nodeset in layout coordinates.

The node_groups argument is intended to provide summary data for each node group (for example Cnet nodesets) so that individual node groups can be adjusted accordingly.

Value

data.frame with summary information about node distances for connected nodes (only where edges connect any two nodes), and unconnected nodes (only where two nodes are not connected by an edge). When node_groups is defined, the summary also includes each individual node group.

See Also

Other jam utility functions: avg_angles(), avg_colors_by_list(), call_fn_ellipsis_deprecated(), cell_fun_bivariate(), collapse_mem_clusters(), colorRamp2D(), deconcat_df2(), display_colorRamp2D(), enrichList2geneHitList(), filter_mem_genes(), filter_mem_sets(), find_colname(), get_hull_data(), get_igraph_layout(), gsubs_remove(), handle_igraph_param_list(), isColorBlank(), make_legend_bivariate(), make_point_hull(), mem_find_overlap(), order_colors(), rank_mem_clusters(), rotate_coordinates(), subgraph_jam(), subset_mem(), xyAngle()


jmw86069/multienrichjam documentation built on Nov. 3, 2024, 10:29 p.m.