# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
# send and display network
cw <- CytoscapeWindow ('setEdgeTargetArrowColorRule.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork (cw, 'force-directed')
# add edge arrows
arrows <- c ('CIRCLE', 'ARROW', 'DIAMOND')
edgeType.values <- c ('phosphorylates', 'synthetic lethal', 'undefined')
setEdgeTargetArrowRule (cw, 'edgeType', edgeType.values, arrows)
colors <- c ("#AA00AA", "#AAAA00", "#AA0000")
edgeType.values <- c ('phosphorylates', 'synthetic lethal', 'undefined')
# set rule
setEdgeTargetArrowColorRule (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 )
setEdgeTargetArrowColorRule(cw, 'score', control.points, colors)
Run the code above in your browser using DataLab