Learn R Programming

RCytoscape (version 1.22.0)

setEdgeOpacityRule: setEdgeOpacityRule

Description

Specify how data attributes -- for the specified named attribute -- is mapped to edge opacity.

Usage

setEdgeOpacityRule(obj, edge.attribute.name, control.points, opacities, mode)

Arguments

obj
a CytoscapeWindowClass object.
edge.attribute.name
the edge attribute whose values will, when this rule is applied, determine the opacity of each edge.
control.points
a list of values, either numeric (for interpolate mode) or character strings (for 'lookup' mode).
opacities
a list of opacity values, integers between 0 (invisible) and 255 (completely visible)
mode
either 'interpolate' or 'lookup'.

Value

None.

See Also

setEdgeLineStyleRule setEdgeColorRule

Examples

Run this code
  cw <- new.CytoscapeWindow ('setEdgeOpacityRule.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork (cw, 'jgraph-spring')

  edgeType.values <- c ("phosphorylates", "synthetic lethal", "undefined")

     # want to see edges and both arrows, to check success of opacity rule
  setEdgeTargetArrowRule (cw, 'edgeType', edgeType.values, rep ('ARROW', 3))
  setEdgeSourceArrowRule (cw, 'edgeType', edgeType.values, rep ('ARROW', 3))
  setDefaultEdgeLineWidth (cw, 5)

  redraw (cw)

    # do the lookup rule
  opacities <- c (25, 100, 255)
  setEdgeOpacityRule (cw, 'edgeType',  edgeType.values, opacities, mode='lookup')
  redraw (cw)

    # now do the interpolated version
  opacities <- c (10, 125, 255)
  control.points <- c (-12, 0, 35)
  setEdgeOpacityRule (cw, 'score',  control.points, opacities, mode='interpolate')  
  redraw (cw)

Run the code above in your browser using DataLab