Learn R Programming

RCy3 (version 1.2.0)

saveNetwork: saveNetwork

Description

Write a network of the specified type to the specified file, at the specified scaling factor. Note:the file is written to the file system of the computer upon which R is running, not Cytoscape -- in those cases where they are different. It is saved to the working directory.

Usage

saveNetwork(obj, file.name, format='cys')

Arguments

obj
a CytoscapeWindowClass object.
file.name
a char object.
format
a char object. 'cys' is the only type currently supported

Value

None.

See Also

saveImage

Examples

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

  cw <- CytoscapeWindow ('saveNetwork.test', graph=makeSimpleGraph())
  displayGraph (cw)
  layoutNetwork (cw, 'force-directed')
  redraw (cw)
  filename <- paste (getwd (), 'saveNetworkTest', sep='/')
  saveNetwork (cw, filename) # overwrites files with the same name
  # check if the file exists
  file.exists (paste0(filename, '.cys'))

Run the code above in your browser using DataLab