graphBPH-class: Class "graphBPH"

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

Description

A bipartite representation of a hypergraph. The purpose of this class is to support visualization of the hypergraph; it is not intended for analysis or manipulation of the hypergraph.

Objects from the Class

Objects can be created by calls of the form new("graphBPH", graph, edgeNodePattern, ...). There is also a convenience function graphBPH().

A graphBPH object consists of a graphNEL object, which must obey some strict rules:

The edgeNodePattern is a regular expression that is used to define the set of edge-nodes.

Slots

graph:

Object of class graphNEL. This graph must obey the constraints described above.

edgeNodePattern:

Object of class character. The regular expression used to define edge-nodes.

nodes:

Object of class character. Records which nodes in the graph are normal nodes.

edgeNodes:

Object of class character. Records which nodes in the graph are edge-nodes.

edgeNodeIO:

Object of class list. Records information about which edges enter and exit each edge-node.

Methods

plot

signature(x = "graphBPH", y = "ANY"): draw a representation of the hypergraph where edges between normal nodes in the graph pass through an intermediate edge-node in a nice smooth curve.

graphLayout

signature(graph = "graphBPH", layoutType = "missing"): convert the graphBPH object to a RagraphBPH object (using a default layout method).

graphLayout

signature(graph = "graphBPH", layoutType = "character"): convert the graphBPH object to a RagraphBPH object (using the specified layout method).

Author(s)

Paul Murrell

References

Gansner, E.R. and and North, S.C. (1999) An open graph visualization system and its applications to software engineering, Software - Practice and Experience, 30:1203–1233.

Gentleman, R. and Whalen, E. and Huber, W. and Falcon, S. graph: A package to handle graph data structures.

Gentry, J. and Long, L. and Gentleman, R. and Falcon, S. and Hahne, F. and Sarkar, D. and Hansen, K. Rgraphviz: Provides plotting capabilities for R graph objects.

See Also

agopen, graphLayout and graphNEL RagraphBPH

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
nodes <- c(LETTERS[1:5], paste("R", 1:3, sep=""))
testgnel <- new("graphNEL",
                nodes=nodes,
                edgeL=list(
                  A=list(edges=c("R1", "R2")),
                  B=list(edges="R2"),
                  C=list(),
                  D=list(edges="R3"),
                  E=list(),
                  R1=list(edges="B"),
                  R2=list(edges=c("C", "D")),
                  R3=list(edges="E")),
                edgemode="directed")
testbph <- graphBPH(testgnel, "^R")
plot(testbph)

# A Hypergraph equivalent
require(hypergraph)
dh1 <- DirectedHyperedge("A", "B", "R1")
dh2 <- DirectedHyperedge(c("A", "B"), c("C", "D"), "R2")
dh3 <- DirectedHyperedge("D", "E", "R3")
hg <- Hypergraph(LETTERS[1:5], list(dh1, dh2, dh3))
plot(graphBPH(hg))                 

Example output

Loading required package: hypergraph
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min


Attaching package: 'hypergraph'

The following objects are masked from 'package:utils':

    head, tail

hyperdraw documentation built on Nov. 8, 2020, 11:11 p.m.