setEdgeColorRule: setEdgeColorRule

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

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

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 in this format: "#RRGGBB"

vizmap.style.name

visual style name, defaults to the style 'default'.

Value

None.

Author(s)

Tanja Muetze, Georgi Kolishovski, Paul Shannon

See Also

setNodeShapeRule (detailed example) setEdgeLineStyleRule

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  ## Not run: 
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  cw <- CytoscapeWindow ('setEdgeColorRule.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork (cw, 'force-directed')
  
  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
  colors = c ('#FF0000', '#FFFFFF', '#00FF00')
  setEdgeColorRule (cw, 'score',  score.values, colors, mode='interpolate')

  # redraw (cw) --> not required anymore

## End(Not run)

tmuetze/Bioconductor_RCy3_the_new_RCytoscape documentation built on May 31, 2019, 4:39 p.m.