# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('getSelectedEdgeCount.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork(cw, 'force-directed')
redraw (cw)
clearSelection (cw)
getSelectedEdgeCount (cw)
# [1] 0
# in Cytoscape, interactively select an edge, or programmatically
selectEdges (cw, "A (phosphorylates) B")
getSelectedEdgeCount (cw)
# [1] 1
Run the code above in your browser using DataLab