Learn R Programming

RCy3 (version 1.2.0)

saveLayout: saveLayout

Description

Save the current layout (that is, node positions) to the specified file.

Usage

saveLayout(obj, filename, timestamp.in.filename=FALSE)

Arguments

obj
a CytoscapeWindowClass object.
filename
a string.
timestamp.in.filename
logical.

Value

Nothing.

See Also

restoreLayout

Examples

Run this code
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  cw <- CytoscapeWindow ('saveLayout.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork(cw, 'force-directed')
  saveLayout (cw, 'layout.RData')
  layoutNetwork(cw, 'fruchterman-rheingold')
  restoreLayout (cw, 'layout.RData')
  # you might need to adjust the zoom
  saveLayout (cw, 'layout2', timestamp.in.filename=TRUE)

Run the code above in your browser using DataLab