createWindowFromSelection: createWindowFromSelection

Description Usage Arguments Value Author(s) See Also Examples

Description

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

Usage

1
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.

Author(s)

Paul Shannon

See Also

selectNodes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  cy <- CytoscapeConnection ()
  title <- 'createWindowFromSelection demo'

  cw <-  new.CytoscapeWindow (title, makeSimpleGraph ())
  displayGraph (cw)
  redraw (cw)
  layoutNetwork(cw)
  selectNodes (cw, c ('A', 'C'))
 
  new.window.title <- 'NEW WINDOW'
  if (new.window.title %in% as.character (getWindowList (cy)))
    deleteWindow (cy, new.window.title)

  c2 <- createWindowFromSelection (cw, new.window.title, TRUE)
  redraw (c2)
  layoutNetwork(c2)

  clearSelection (c2)
  selectNodes (c2, 'C')
  print (getSelectedNodeCount (c2))  # should be 1

RCytoscape documentation built on Nov. 17, 2017, 10:52 a.m.