annotatedIGraph: Class '"annotatedIGraph"'

Description Objects from the Class Slots Methods Author(s) See Also Examples

Description

This class encapsulates the igraph class from the igraph package providing a data.frame of annotation for the nodes that can be accessed and modified in a manner consistent with the rest of the package.

Objects from the Class

Objects can be created by calls of the form new("annotatedIGraph", graph, annotation).

Slots

graph:

Object of class "igraph"

annotation:

Object of class "data.frame" with one row per node indicating the annotation for the graph. For instance in a PPI graph each node would be mapped to a protein as well as a gene ID. Also contained in this object would be graph-specific metadata which would be used in downstream functions for edge/node drawing characteristics.

Methods

annotation

signature(obj = "annotatedIGraph"): Retrieve the annotation data.frame

annotation<-

signature(obj = "annotatedIGraph"): Replace the annotation data.frame

getGraph

signature(obj = "annotatedIGraph"): Retrieve the igraph object

saveGraph

signature(obj = "annotatedIGraph"): Save an annotatedIGraph object to disk

Author(s)

Daniel Bottomly

See Also

priorDbParams, loadGraph, igraph, get.protein.protein.graph

Examples

1
2
3
4
5
6
7
8
stopifnot(require(igraph))
set.seed(123)
sim.graph <- erdos.renyi.game(n=10, p.or.m=.5, type="gnp", directed=FALSE, loops=FALSE)
sim.dta <- data.frame(node.name=paste("node", 1:10, sep="_"), colors=sample(colors(), 10))

annot.graph <- new("annotatedIGraph", graph=sim.graph, annotation=sim.dta)
## Not run: plot(getGraph(annot.graph))
head(annotation(annot.graph))

dbottomly/HitWalker documentation built on May 15, 2019, 1:22 a.m.