Learn R Programming

RCy3 (version 1.2.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

setNodeBorderColorRule (detailed example) setEdgeColorRule setNodeShapeRule setEdgeLineStyleRule setNodeColorRule

Examples

Run this code
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  cw <- CytoscapeWindow ('setEdgeOpacityRule.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork (cw, 'force-directed')

  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)

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

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

Run the code above in your browser using DataLab