# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cw <- CytoscapeWindow ('setEdgeLineStyleDirect.test', graph=makeSimpleGraph())
displayGraph (cw)
layoutNetwork (cw, 'force-directed')
edges.of.interest <- as.character (cy2.edge.names (cw@graph))
supported.styles <- getLineStyles (cw)
# pass three edges and three styles
setEdgeLineStyleDirect (cw, edges.of.interest, supported.styles [5:7])
# pass three edges and one style
setEdgeLineStyleDirect (cw, edges.of.interest, supported.styles [8])
# now loop through all of the styles
for (style in supported.styles) {
setEdgeLineStyleDirect (cw, edges.of.interest, style)
}
# restore the default
setEdgeLineStyleDirect (cw, edges.of.interest, 'SOLID')
Run the code above in your browser using DataLab