handle_igraph_param_list: Handle igraph attribute parameter list

handle_igraph_param_listR Documentation

Handle igraph attribute parameter list

Description

Handle igraph attribute parameter list, internal function for jam_igraph()

Usage

handle_igraph_param_list(
  x,
  attr,
  factor_l,
  i_values = NULL,
  attr_type = c("node", "vertex", "edge"),
  verbose = FALSE,
  ...
)

Arguments

x

igraph object

attr

character name of the attribute to update in x.

factor_l

list or numeric vector or function:

  • list of numeric vectors where names(factor_l) correspond to attribute names, and the names of numeric vectors are attribute values The attribute names and attribute values are used to match relevant entities of type attr_type. For matching entities, attribute values are used as defined by attribute name attr, and are multiplied by the matching numeric value in factor_l.

  • numeric vector which is directly multiplied by i_values to produce an adjusted output vector i_values.

  • function which is used to modify i_values by calling factor_l(i_values) to produce adjusted output i_values.

i_values

vector of attribute values that represent the current attribute values in x for the attribute attr.

attr_type

character string indicating the type of entity being adjusted in x:

  • "node" or "vertex" refers to igraph::vertex_attr()

  • "edge" refers to igraph::edge_attr()

...

additional arguments are ignored.

Details

This mechanism is intended to help update igraph attributes in bulk operations by the attribute values associated with nodes or edges. Most commonly, the argument factor_l is multiplied by numeric attributes to scale attribute values, for example label font size, or node size.

For example:

handle_igraph_param_list(x,
   attr="size",
   factor_l=list(nodeType=c(Gene=1, Set=2)),
   i_values=rep(1, igraph::vcount(x)),
   attr_type="node")

This function call will match node attribute nodeType, the size of nodes with attribute value nodeType="Set" are multiplied size * 2, nodeType="Gene" are multiplied size * 1.

Value

vector of attribute values representing attr.

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_igraph_layout(), gsubs(), isColorBlank(), make_legend_bivariate(), make_point_hull(), mem_find_overlap(), order_colors(), rank_mem_clusters(), rotate_coordinates(), subgraph_jam(), subset_mem(), summarize_node_spacing(), xyAngle()


jmw86069/multienrichjam documentation built on Feb. 7, 2024, 12:58 a.m.