setEdgeColorRule

Share:

Description

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

Usage

1
setEdgeColorRule(obj, edge.attribute.name, control.points, colors, mode, default.color='#FFFFFF')

Arguments

obj

a CytoscapeWindowClass object.

edge.attribute.name

the edge attribute whose values will, when this rule is applied, determine the color of each edge.

control.points

a list of values, either numeric (for interpolate mode) or character strings (for 'lookup' mode).

colors

a list of colors, expressed as hexadecimal RGB, like this: '#FF0000' or '#FA8800'

mode

either 'interpolate' or 'lookup'.

default.color

a String object, expressed in hexadecimal RGB, like this: '#FF0000' or '#FA8800'

Value

None.

Author(s)

Paul Shannon

See Also

setEdgeLineStyleRule setNodeColorRule

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  cw <- new.CytoscapeWindow ('setEdgeColorRule.test', graph=makeSimpleGraph())
  edgeType.values = c ('phosphorylates', 'synthetic lethal', 'undefined')
  colors = c ('#FF0000', '#FFFF00', '#00FF00')
  setEdgeColorRule (cw, 'edgeType',  edgeType.values, colors, mode='lookup')

  score.values = c (-15, 0, 40);
  colors = c ('#00FF00', '#FFFFFF', '#FF0000')
  setEdgeColorRule (cw, 'score',  score.values, colors, mode='interpolate')
    # now swap the colors around
    # now swap the colors
  colors = c ('#FF0000', '#FFFFFF', '#00FF00')
  setEdgeColorRule (cw, 'score',  score.values, colors, mode='interpolate')

  redraw (cw)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.