makeRandomGraph: makeRandomGraph

Description Usage Arguments Value Author(s) Examples

Description

Create a random undirected graphNEL, useful for testing.Two default edge attributes are added, for demonstration purposes.

Usage

1
makeRandomGraph(node.count=12, seed=123)

Arguments

node.count

the number of nodes you wish to see in the graph

seed

an integer which, when supplied, allows reproducibility

Value

Returns (by default) a 12-node, rather dense undirected graph, with some attributes on the nodes and edges.

Author(s)

Tanja Muetze, Georgi Kolishovski, Paul Shannon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  ## Not run: 
  # first, delete existing windows to save memory:
  deleteAllWindows(CytoscapeConnection())

  g = makeRandomGraph (node.count=12, seed=123)

  ## The function is currently defined as
  function (node.count = 12, seed = 123) 
  {
      set.seed(seed)
      node.names = as.character(1:node.count)
      g = randomGraph(node.names, M <- 1:2, p = 0.6)
      attr(edgeDataDefaults(g, attr = "weight"), "class") = "DOUBLE"
      edgeDataDefaults(g, "pmid") = "9988778899"
      attr(edgeDataDefaults(g, attr = "pmid"), "class") = "STRING"
      return(g)
  }

## End(Not run)

tmuetze/Bioconductor_RCy3_the_new_RCytoscape documentation built on May 31, 2019, 4:39 p.m.