# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
# send and display graph
cw <- CytoscapeWindow ('setEdgeSourceArrowColorRule.test', graph=makeSimpleGraph())
displayGraph (cw)
redraw (cw)
layoutNetwork (cw, 'force-directed')
colors <- c ("#AA00AA", "#AAAA00", "#AA0000")
edgeType.values <- c ('phosphorylates', 'synthetic lethal', 'undefined')
# add edge arrows
arrows <- c ('Arrow', 'Diamond', 'Circle')
edgeType.values <- c ('phosphorylates', 'synthetic lethal', 'undefined')
setEdgeSourceArrowRule (cw, 'edgeType', edgeType.values, arrows)
# set rule
setEdgeSourceArrowColorRule (cw, 'edgeType', edgeType.values, colors, mode='lookup')
# if not specified, the mode is interpolate
colors <- c ("#FFFFFF", "#00FF00", "#00AA00", "#FF0000", "#AA0000")
control.points <- c( -12.0, 35.0, 0.0 )
setEdgeSourceArrowColorRule (cw, 'score', control.points, colors)
Run the code above in your browser using DataLab