setEdgeOpacityRule: setEdgeOpacityRule

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

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

Author(s)

Paul Shannon

See Also

setEdgeLineStyleRule setEdgeColorRule

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  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)

RCytoscape documentation built on Nov. 17, 2017, 10:52 a.m.