highlightPath {SBGNview} | R Documentation

## 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.

### 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.

### Usage

    highlightPath(from.node = NULL, to.node = NULL,
      directed.graph = TRUE, node.set.id.type = "CompoundName",
      glyphs.id.type = "pathwayCommons", cpd.or.gene = "compound",
      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 ID of source node.
`to.node` | A character string. The 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. ID type of input nodes.
`glyphs.id.type` | A character string. ID type of nodes in SBGN-ML file, which is used as node IDs in the SBGNview object returned by the SBGNview() function.
`cpd.or.gene` | A character string. One of "gene" or "compound". Currently highlight.node() only supports highlighting macromolecule and simple chemical nodes. This parameter is used to find the ID mapping between input node set IDs and glyph IDs.
`input.node.stroke.width` | A character string. Border stroke width of input nodes (affects both from.node and to.node)
`from.node.color` | A character string. Color of "source"/from.node
`to.node.color` | A character string. Color of "target"/to.node
`path.node.color` | String
`path.node.stroke.width` | Numeric
`n.shortest.paths.plot` | Integer. There could be more than one shortest paths between two nodes. User can choose how many of them to plot.
`shortest.paths.cols` | A character string. 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 the vector.
`path.stroke.width` | Numeric. The width of line in edges in the shortest paths.
`tip.size` | Numeric. The size of arc tips in edges of the shortest paths.

### Value

A SBGNview obj.

### Examples

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

    ## End(Not run)

[Package SBGNview version 1.1.0 Index]