Learn R Programming

RCy3 (version 1.2.0)

createWindowFromSelection: createWindowFromSelection

Description

All selected nodes, their connecting edges, and associated attributes are copied into a new CytoscapeWindow, with the supplied title.

Usage

createWindowFromSelection(obj, new.windowTitle, return.graph)

Arguments

obj
a CytoscapeWindowClass object.
new.windowTitle
a String.
return.graph
an logical object.

Value

A new CytoscapeWindow object, with the graph slot populated with the new selected subgraph, if requested. If not requested, the graph slot holds an empty graph.

See Also

selectNodes

Examples

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

  cy <- CytoscapeConnection ()
  title <- 'createWindowFromSelection demo'

  cw <- CytoscapeWindow (title, makeSimpleGraph ())
  displayGraph (cw)
  layoutNetwork (cw)
  selectNodes (cw, c ('A', 'C'))
 
  new.window.title <- 'NEW WINDOW'
  c2 <- createWindowFromSelection (cw, new.window.title, TRUE)
  layoutNetwork (c2, 'force-directed')
  print (getEdgeCount(c2))  # should be 1

Run the code above in your browser using DataLab