# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('setNodeShapeRule.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork (cw, 'force-directed')
shapes <- c("TRIANGLE", "ROUND_RECTANGLE", "ELLIPSE")
molecule.types <- c("kinase", "transcription factor", "glycoprotein")
setNodeShapeRule (cw, node.attribute.name='type', molecule.types, shapes)
Run the code above in your browser using DataLab