# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('getGraphFromCyWindow.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork (cw)
g.cy <- getGraphFromCyWindow (cw, 'getGraphFromCyWindow.test')
print (g.cy) # 3 nodes, 3 edges
Run the code above in your browser using DataLab