makeSimpleGraph: makeSimpleGraph

Description Usage Value Author(s) Examples

View source: R/RCytoscape.R

Description

A 3-node, 3-edge graph, with some biological trappings, useful for demonstrations.

Usage

1

Value

Returns a 3-node, 3-edge graph, with some attributes on the nodes and edges.

Author(s)

Paul Shannon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
g = makeSimpleGraph ()

## The function is currently defined as
function () 
{
    g = new("graphNEL", edgemode = "directed")
    nodeDataDefaults(g, attr = "type") = "undefined"
    attr(nodeDataDefaults(g, attr = "type"), "class") = "STRING"
    nodeDataDefaults(g, attr = "lfc") = 1
    attr(nodeDataDefaults(g, attr = "lfc"), "class") = "DOUBLE"
    nodeDataDefaults(g, attr = "label") = "default node label"
    attr(nodeDataDefaults(g, attr = "label"), "class") = "STRING"
    nodeDataDefaults(g, attr = "count") = "0"
    attr(nodeDataDefaults(g, attr = "count"), "class") = "INTEGER"
    edgeDataDefaults(g, attr = "edgeType") = "undefined"
    attr(edgeDataDefaults(g, attr = "edgeType"), "class") = "STRING"
    edgeDataDefaults(g, attr = "score") = 0
    attr(edgeDataDefaults(g, attr = "score"), "class") = "DOUBLE"
    edgeDataDefaults(g, attr = "misc") = ""
    attr(edgeDataDefaults(g, attr = "misc"), "class") = "STRING"
    g = graph::addNode("A", g)
    g = graph::addNode("B", g)
    g = graph::addNode("C", g)
    nodeData(g, "A", "type") = "kinase"
    nodeData(g, "B", "type") = "transcription factor"
    nodeData(g, "C", "type") = "glycoprotein"
    nodeData(g, "A", "lfc") = "-3.0"
    nodeData(g, "B", "lfc") = "0.0"
    nodeData(g, "C", "lfc") = "3.0"
    nodeData(g, "A", "count") = "2"
    nodeData(g, "B", "count") = "30"
    nodeData(g, "C", "count") = "100"
    nodeData(g, "A", "label") = "Gene A"
    nodeData(g, "B", "label") = "Gene B"
    nodeData(g, "C", "label") = "Gene C"
    g = graph::addEdge("A", "B", g)
    g = graph::addEdge("B", "C", g)
    g = graph::addEdge("C", "A", g)
    edgeData(g, "A", "B", "edgeType") = "phosphorylates"
    edgeData(g, "B", "C", "edgeType") = "synthetic lethal"
    edgeData(g, "A", "B", "score") = 35
    edgeData(g, "B", "C", "score") = -12
    return(g)
  }

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