Convert MultiEnrichment incidence matrix to Cnet plot

memIM2cnet(
  memIM,
  categoryShape = c("pie", "coloredrectangle", "circle", "ellipse"),
  geneShape = c("pie", "coloredrectangle", "circle", "ellipse"),
  categoryColor = "#E5C494",
  geneColor = "#B3B3B3",
  categoryLabelColor = "darkblue",
  geneLabelColor = "grey25",
  categorySize = 6,
  geneSize = 3,
  categoryCex = 0.8,
  geneCex = 0.5,
  frame_darkFactor = NULL,
  geneIM = NULL,
  geneIMcolors = NULL,
  geneIMdirection = NULL,
  enrichIM = NULL,
  enrichIMcolors = NULL,
  enrichIMdirection = NULL,
  coloredrect_nrow = 1,
  coloredrect_ncol = NULL,
  coloredrect_byrow = TRUE,
  colorV = NULL,
  direction_col = colorjam::col_div_xf(1.2),
  hide_solo_pie = TRUE,
  remove_blanks = TRUE,
  spread_labels = FALSE,
  repulse = 3.5,
  verbose = FALSE,
  ...
)

mem2cnet(
  memIM,
  categoryShape = c("pie", "coloredrectangle", "circle", "ellipse"),
  geneShape = c("pie", "coloredrectangle", "circle", "ellipse"),
  categoryColor = "#E5C494",
  geneColor = "#B3B3B3",
  categoryLabelColor = "darkblue",
  geneLabelColor = "grey25",
  categorySize = 6,
  geneSize = 3,
  categoryCex = 0.8,
  geneCex = 0.5,
  frame_darkFactor = NULL,
  geneIM = NULL,
  geneIMcolors = NULL,
  geneIMdirection = NULL,
  enrichIM = NULL,
  enrichIMcolors = NULL,
  enrichIMdirection = NULL,
  coloredrect_nrow = 1,
  coloredrect_ncol = NULL,
  coloredrect_byrow = TRUE,
  colorV = NULL,
  direction_col = colorjam::col_div_xf(1.2),
  hide_solo_pie = TRUE,
  remove_blanks = TRUE,
  spread_labels = FALSE,
  repulse = 3.5,
  verbose = FALSE,
  ...
)

Arguments

memIM

numeric matrix, or mem output in list format. When mem format is supplied, relevant arguments which are empty will use corresponding data from mem, for example geneIM, geneIMcolors, enrichIM, enrichIMcolors.

categoryShape, geneShape

character string indicating the preferred default node shape. In general, pie shapes with one segment are converted to circle for simplicity during plot functions, although when using jam_igraph() to plot, it will treat single-segment pie nodes as circle anyway, and vectorizes pie node plotting to make the overall rendering time substantially faster.

categoryColor, geneColor

character R color for default node colors, used when geneIMcolors,enrichIMcolors is not supplied, respectively.

categoryLabelColor, geneLabelColor

character R color used as default node label color.

categorySize, geneSize

numeric default node size.

categoryCex, geneCex

numeric adjustment to default node label font size.

frame_darkFactor

numeric passed to jamba::makeColorDarker() so the frame color is slightly darker than the node fill color.

geneIM, geneIMcolors, geneIMdirection, enrichIM, enrichIMcolors, enrichIMdirection

matrix objects typically associated with mem output from multiEnrichMap(), however they are optional so this function can be applied broadly to any incidence matrix.

  • geneIMcolors is used to define gene (row) node colors

  • enrichIMcolors is used to define set (column) node colors

  • geneIMdirection,enrichIMdirection is used to define optional border colors defined by the direction, where -1 is down, 0 is no change, and +1 is up. Use direction_col to define a custom color function.

coloredrect_nrow, coloredrect_ncol, coloredrect_byrow

arguments used when geneShape="coloredrectangle", to define layout and placement of colors across columns in geneIMcolors. By default, one row of colors is used.

colorV

character optional vector of R colors, named by enrichment names that appear in colnames(enrichIM) when supplied. When defined, these colors override those defined in enrichIMcolors.

remove_blanks

logical indicating whether to remove blank subsections from each node, by calling removeIgraphBlanks().

spread_labels

logical indicating whether to call spread_igraph_labels() to orient labels radially away from incoming edges.

verbose

logical indicating whether to print verbose output.

...

additional arguments are passed to downstream functions:

Value

igraph object with Concept network data, containing pathways connected to genes. Each node has attribute "nodeType"

of either "Set" or "Gene".

Details

This function takes list output from multiEnrichMap() and uses three elements to create a Cnet plot:

  1. "memIM" gene-pathway incidence matrix

  2. "geneIM" the gene incidence matrix

  3. "enrichIM" the pathway enrichment matrix