highlightPath: Highlight shortest path between two nodes

View source: R/highlight.utilities.R

highlightPathR Documentation

Highlight shortest path between two nodes

Description

Given two nodes, find the shortest path between them and highlight the path. Other molecules/nodes and edges involved in reactions in the path are also highlighted. This function should be used as the second argument to function. Run help("+.SBGNview") for more information.

Usage

highlightPath(
  from.node = NULL,
  to.node = NULL,
  directed.graph = TRUE,
  node.set.id.type = "compound.name",
  glyphs.id.type = "pathwayCommons",
  mol.type = "cpd",
  input.node.stroke.width = 10,
  from.node.color = "red",
  to.node.color = "blue",
  path.node.color = "black",
  path.node.stroke.width = 10,
  n.shortest.paths.plot = 1,
  shortest.paths.cols = c("purple"),
  path.stroke.width = 2,
  tip.size = 4
)

Arguments

from.node

A character string. The molecule ID of source node.

to.node

A character string. The molecule ID of target node.

directed.graph

Logical. If treat the SBGN map as a directed graph. If treat it as directed graph, the direction of an arc is determined by the <arc> XML element in the input SBGN-ML file: from 'source' node to 'target' node.

node.set.id.type

A character string. Default: "compound.name". ID type of input nodes.

glyphs.id.type

A character string. Default: "pathwayCommons". ID type of nodes in SBGN-ML file.

mol.type

A character string. One of 'gene' or 'cpd' (default).

input.node.stroke.width

Integer. Default: 10. Border stroke width of input nodes (affects both from.node and to.node)

from.node.color

A character string. Default: "red". Border color of 'source'/from.node

to.node.color

A character string. Default: "blue". Border color of 'target'/to.node

path.node.color

A character string. Default: "black". Border color of nodes in the path.

path.node.stroke.width

Integer. Default: 10. Adjust stroke width of path between nodes.

n.shortest.paths.plot

Integer. Default: 1. There could be more than one shortest paths between two nodes. User can choose how many of them to plot.

shortest.paths.cols

A vector of character string. Default: c("purple"). The colors of arcs in different shortest paths. The length of this vector (number of colors) should be the value of n.shortest.paths.plot. If one arc is in multiple shortest paths, its color will be set to the color that appears later in this vector.

path.stroke.width

Integer. Default: 2. The width of line in edges in the shortest paths.

tip.size

Integer. Default: 4. The size of arc tip in edges of the shortest paths.

Value

A SBGNview obj

Examples

## Not run: 
obj.new <- SBGNview.obj + highlightPath(from.node = c('tyrosine'), 
                                        to.node = c('dopamine'),
                                        from.node.color = 'red',
                                        to.node.color = 'blue')

## End(Not run)

datapplab/SBGNview documentation built on June 20, 2022, 9:55 p.m.