Title: | Interactive visualization and manipulation of nested networks |
---|---|
Description: | RedeR is an R-based package combined with a stand-alone Java application for interactive visualization and manipulation of nested networks. Graph, node, and edge attributes can be configured using either graphical or command-line methods, following igraph syntax rules. |
Authors: | Xin Wang [ctb], Florian Markowetz [ctb], Mauro Castro [aut, cre] |
Maintainer: | Mauro Castro <[email protected]> |
License: | GPL-3 |
Version: | 3.3.0 |
Built: | 2024-12-17 06:13:30 UTC |
Source: | https://github.com/bioc/RedeR |
Add edges to an active RedeR application.
## S4 method for signature 'character' addEdges(edges, ...) ## S4 method for signature 'data.frame' addEdges(edges, ...)
## S4 method for signature 'character' addEdges(edges, ...) ## S4 method for signature 'data.frame' addEdges(edges, ...)
edges |
A vertex sequence <vector of strings> or data frame of ncol=2. |
... |
Arguments passed to internal checks (ignore). |
Add edges to an active RedeR session.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a vertex sequence edges <- c("n1", "n2", "n1", "n3", "n1", "n4", "n1", "n5") # ...or as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface and add edges startRedeR() addEdges(edges)
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a vertex sequence edges <- c("n1", "n2", "n1", "n3", "n1", "n4", "n1", "n5") # ...or as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface and add edges startRedeR() addEdges(edges)
Methods to display igraph objects in the RedeR application.
## S4 method for signature 'RedPort' addGraph( obj, g, layout = NULL, gscale = 75, zoom = 100, update.coord = TRUE, verbose = TRUE, isNested = FALSE, ... )
## S4 method for signature 'RedPort' addGraph( obj, g, layout = NULL, gscale = 75, zoom = 100, update.coord = TRUE, verbose = TRUE, isNested = FALSE, ... )
obj |
A |
g |
An |
layout |
an optional numeric matrix with two columns for |
gscale |
Expansion factor related to the app panel area <numeric> |
zoom |
A zoom scale for the app panel (range: 0.0 to 100.0) <numeric>. |
update.coord |
A logical value, whether to update |
verbose |
A logical value specifying to display detailed messages
(when |
isNested |
A logical value, whether to nest all nodes into a new container. |
... |
Additional arguments passed to the
|
Send igraph objects to RedeR.
Sysbiolab.
# Initialize RedeR and igraph library(RedeR) library(igraph) gtoy <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() ## Not run: calld(rdp) addGraph(rdp, g = gtoy, layout = layout_nicely(gtoy)) ## End(Not run)
# Initialize RedeR and igraph library(RedeR) library(igraph) gtoy <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() ## Not run: calld(rdp) addGraph(rdp, g = gtoy, layout = layout_nicely(gtoy)) ## End(Not run)
Methods to display igraph objects in the RedeR application.
addGraphToRedeR( g, layout = NULL, gscale = 75, zoom = 100, update.coord = TRUE, isNested = FALSE, unit = c("native", "point", "npc"), verbose = TRUE, ... )
addGraphToRedeR( g, layout = NULL, gscale = 75, zoom = 100, update.coord = TRUE, isNested = FALSE, unit = c("native", "point", "npc"), verbose = TRUE, ... )
g |
An |
layout |
an optional numeric matrix with two columns for |
gscale |
Expansion factor related to the app panel area <numeric> |
zoom |
A zoom scale for the app panel (range: 0.0 to 100.0) <numeric>. |
update.coord |
A logical value, whether to update |
isNested |
A logical value, whether to nest all nodes into a new container. |
unit |
A string specifying the unit for lengths, widths,
and sizes assigned to node and edge attributes. RedeR space
coordinate system is native to Java Graphics2D, which uses 'points' by
default (a point is 1/72 of an inch). Current options include 'native',
'point', and 'npc'. The 'native' option will used definition from
|
verbose |
A logical value specifying to display detailed messages
(when |
... |
Additional arguments passed to the
|
Send igraph objects to RedeR.
Sysbiolab.
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy <- graph.lattice(c(5, 5, 5)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy, layout = layout_nicely(gtoy))
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy <- graph.lattice(c(5, 5, 5)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy, layout = layout_nicely(gtoy))
Methods to display legends in the RedeR app.
addLegendToRedeR( x, type = "nodecolor", position = "default", orientation = "default", title = type, font.size = 12, stretch = 0, ... )
addLegendToRedeR( x, type = "nodecolor", position = "default", orientation = "default", title = type, font.size = 12, stretch = 0, ... )
x |
A vector with legend values (see examples). |
type |
A legend type. Options: 'nodecolor', 'edgecolor', 'nodesize', 'edgewidth', 'nodeshape', 'edgetype'. |
position |
Position of the legend in app panel. Options: 'default', 'topleft', 'topright', 'bottomleft', 'bottomright', and 'remove'. Use 'default' to place the legend on a predefined slot, or 'remove' to delete the legend type. |
orientation |
The orientation of the legend. Options: 'default', 'vertical', 'horizontal'. Use 'default' to automatically set the orientation for the legend type. |
title |
A string for legend title. |
font.size |
Font size (unit in points). |
stretch |
A scaling factor to adjust the legend box (between 0 and 1). |
... |
Arguments passed to internal checks (ignore). |
Send legend objects to RedeR app.
Sysbiolab.
# Load RedeR library(RedeR) # Start the RedeR interface startRedeR() # Adding node and edge color legends cols <- colorRampPalette(colors = c("red", "blue"))(14) names(cols) <- 1:length(cols) addLegendToRedeR(x = cols, type = "nodecolor") addLegendToRedeR(x = cols, type = "edgecolor", stretch = 0.1) # Adding node size legend nsize <- c(10, 20, 30, 40, 50) addLegendToRedeR(x = nsize, type = "nodesize") # Adding edge width legend esize <- c(1:10) addLegendToRedeR(x = esize, type = "edgewidth") # Adding node shape legend shape <- c("ELLIPSE","RECTANGLE","ROUNDED_RECTANGLE","TRIANGLE","DIAMOND") names(shape) <- shape addLegendToRedeR(x = shape, type = "nodeshape") # Adding edge linetype legend ltype <- c("SOLID", "DOTTED", "DASHED", "LONG_DASH") names(ltype) <- ltype addLegendToRedeR(x = ltype, type = "edgetype")
# Load RedeR library(RedeR) # Start the RedeR interface startRedeR() # Adding node and edge color legends cols <- colorRampPalette(colors = c("red", "blue"))(14) names(cols) <- 1:length(cols) addLegendToRedeR(x = cols, type = "nodecolor") addLegendToRedeR(x = cols, type = "edgecolor", stretch = 0.1) # Adding node size legend nsize <- c(10, 20, 30, 40, 50) addLegendToRedeR(x = nsize, type = "nodesize") # Adding edge width legend esize <- c(1:10) addLegendToRedeR(x = esize, type = "edgewidth") # Adding node shape legend shape <- c("ELLIPSE","RECTANGLE","ROUNDED_RECTANGLE","TRIANGLE","DIAMOND") names(shape) <- shape addLegendToRedeR(x = shape, type = "nodeshape") # Adding edge linetype legend ltype <- c("SOLID", "DOTTED", "DASHED", "LONG_DASH") names(ltype) <- ltype addLegendToRedeR(x = ltype, type = "edgetype")
Add nodes to an active RedeR application.
## S4 method for signature 'character' addNodes(nodes, ...)
## S4 method for signature 'character' addNodes(nodes, ...)
nodes |
A vector with node names. |
... |
Arguments passed to internal checks (ignore). |
Add nodes to an active RedeR session.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create a vector with node names nodes <- c("n1", "n2", "n3", "n4", "n5") # Start the RedeR interface and add nodes startRedeR() addNodes(nodes)
# Load RedeR and igraph library(RedeR) library(igraph) # Create a vector with node names nodes <- c("n1", "n2", "n3", "n4", "n5") # Start the RedeR interface and add nodes startRedeR() addNodes(nodes)
Method to launch RedeR application from R.
## S4 method for signature 'RedPort' calld(obj, filepath = "default", maxlag = 20, checkcalls = FALSE)
## S4 method for signature 'RedPort' calld(obj, filepath = "default", maxlag = 20, checkcalls = FALSE)
obj |
A |
filepath |
A path to the 'reder.jar' file available in the RedeR R package <string> |
maxlag |
Max acceptable lag time for the R-Java callback confirmation (default=20 s) <numeric>. |
checkcalls |
A logical value, whether to report errors from the R-to-Java calls. |
System call to start the RedeR application.
Sysbiolab.
rdp <- RedPort() calld(rdp)
rdp <- RedPort() calld(rdp)
Delete edges from an active RedeR application.
## S4 method for signature 'character' deleteEdges(edges, ...) ## S4 method for signature 'data.frame' deleteEdges(edges, ...)
## S4 method for signature 'character' deleteEdges(edges, ...) ## S4 method for signature 'data.frame' deleteEdges(edges, ...)
edges |
A vertex sequence <vector of strings> or data frame of ncol=2. |
... |
Arguments passed to internal checks (ignore). |
Remove graph objects from RedeR app.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add and delete edges addEdges(edges) deleteEdges(c("n1", "n3", "n1", "n6"))
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add and delete edges addEdges(edges) deleteEdges(c("n1", "n3", "n1", "n6"))
Delete nodes from an active RedeR application.
## S4 method for signature 'character' deleteNodes(nodes, ...)
## S4 method for signature 'character' deleteNodes(nodes, ...)
nodes |
A vector with node names. |
... |
Arguments passed to internal checks (ignore). |
Remove graph objects from RedeR app.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create a vector with node names nodes <- c("n1", "n2", "n3", "n4", "n5") # Start the RedeR interface startRedeR() # Add and delete nodes addNodes(nodes) deleteNodes(c("n1", "n3"))
# Load RedeR and igraph library(RedeR) library(igraph) # Create a vector with node names nodes <- c("n1", "n2", "n3", "n4", "n5") # Start the RedeR interface startRedeR() # Add and delete nodes addNodes(nodes) deleteNodes(c("n1", "n3"))
List of deprecated functions in RedeR V3.
gtoy.rm(x, ...) deleteSelectedEdges() att.mape() deleteSelectedNodes() getContainerComponets(x, ...) updateContainerSize(x, ...) updateGraph(x, ...) updateCoordXY(x, ...) deSelectGraph(x, ...) deSelectNodes(x, ...) deSelectEdges(x, ...) selectGraph(x, ...) getNodes(x, ...) getEdges(x, ...) cea(x, ...) mergeNodes(x, ...) setArrowDirection(x, ...) addEdgeBetweenContainers(x, ...) nesthc(x, ...) getSourceEdgeIDs(x, ...) getTargetEdgeIDs(x, ...) getEdgeIDs(x, ...) selectAllNodes(x, ...) selectAllEdges(x, ...) getNodeIDs(x, ...) addLegend.color(x, ...) addLegend.shape(x, ...) addLegend.size(x, ...)
gtoy.rm(x, ...) deleteSelectedEdges() att.mape() deleteSelectedNodes() getContainerComponets(x, ...) updateContainerSize(x, ...) updateGraph(x, ...) updateCoordXY(x, ...) deSelectGraph(x, ...) deSelectNodes(x, ...) deSelectEdges(x, ...) selectGraph(x, ...) getNodes(x, ...) getEdges(x, ...) cea(x, ...) mergeNodes(x, ...) setArrowDirection(x, ...) addEdgeBetweenContainers(x, ...) nesthc(x, ...) getSourceEdgeIDs(x, ...) getTargetEdgeIDs(x, ...) getEdgeIDs(x, ...) selectAllNodes(x, ...) selectAllEdges(x, ...) getNodeIDs(x, ...) addLegend.color(x, ...) addLegend.shape(x, ...) addLegend.size(x, ...)
x |
Deprecated arg. |
... |
Additional deprecated args. |
—
# List of deprecated functions in RedeR V3: # -gtoy.rm (no replacement) # -cea (no replacement) # -mergeNodes (set in app only) # -setArrowDirection (set via addGraph function) # -addEdgeBetweenContainers (set in app only) # -nesthc (no replacement) # -getSourceEdgeIDs (replaced by getGraph) # -getTargetEdgeIDs (replaced by getGraph) # -getEdgeIDs (replaced by getGraph) # -selectAllNodes (replaced by selectNodes) # -selectAllEdges (replaced by selectEdges) # -getNodeIDs (replaced by getGraph) # -addLegend.color (replaced by addLegend) # -addLegend.shape (replaced by addLegend) # -addLegend.size (replaced by addLegend) # -getContainerComponets (replaced by getGraph) # -updateContainerSize (set in app only) # -deleteSelectedEdges (replaced by deleteEdges) # -deleteSelectedNodes (replaced by deleteNodes)
# List of deprecated functions in RedeR V3: # -gtoy.rm (no replacement) # -cea (no replacement) # -mergeNodes (set in app only) # -setArrowDirection (set via addGraph function) # -addEdgeBetweenContainers (set in app only) # -nesthc (no replacement) # -getSourceEdgeIDs (replaced by getGraph) # -getTargetEdgeIDs (replaced by getGraph) # -getEdgeIDs (replaced by getGraph) # -selectAllNodes (replaced by selectNodes) # -selectAllEdges (replaced by selectEdges) # -getNodeIDs (replaced by getGraph) # -addLegend.color (replaced by addLegend) # -addLegend.shape (replaced by addLegend) # -addLegend.size (replaced by addLegend) # -getContainerComponets (replaced by getGraph) # -updateContainerSize (set in app only) # -deleteSelectedEdges (replaced by deleteEdges) # -deleteSelectedNodes (replaced by deleteNodes)
Close an active RedeR session.
## S4 method for signature 'RedPort' exitd(obj)
## S4 method for signature 'RedPort' exitd(obj)
obj |
A |
Exit/close the RedeR application.
Sysbiolab.
rdp <- RedPort() calld(rdp) exitd(rdp)
rdp <- RedPort() calld(rdp) exitd(rdp)
Close an active RedeR session.
exitRedeR()
exitRedeR()
Exit/close the RedeR application.
Sysbiolab.
# Load RedeR library(RedeR) # Call 'start' and 'exit' methods startRedeR() exitRedeR()
# Load RedeR library(RedeR) # Call 'start' and 'exit' methods startRedeR() exitRedeR()
Methods to wrap up RedeR graphs into igraph's R objects.
## S4 method for signature 'RedPort' getGraph( obj, status = c("all", "selected", "notselected"), attribs = c("all", "minimal"), type = c("node", "container", "all") )
## S4 method for signature 'RedPort' getGraph( obj, status = c("all", "selected", "notselected"), attribs = c("all", "minimal"), type = c("node", "container", "all") )
obj |
A |
status |
A filter (string) indicating the status of the graph elements that should be fetched from the RedeR app (default='all'). |
attribs |
A filter (string) indicating the graph attributes that should be fetched from the RedeR app (default='all'). |
type |
A filter (string) indicating the graph element types that should be fetched from the RedeR app (default='node'). |
igraph objects from RedeR.
Sysbiolab.
# Load RedeR and igraph library(RedeR) library(igraph) g <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() calld(rdp) addGraph(rdp, g, layout_nicely(g)) g <- getGraph(rdp)
# Load RedeR and igraph library(RedeR) library(igraph) g <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() calld(rdp) addGraph(rdp, g, layout_nicely(g)) g <- getGraph(rdp)
Methods to wrap up RedeR graphs into igraph's R objects.
getGraphFromRedeR( status = c("all", "selected", "notselected"), attribs = c("all", "minimal"), type = c("node", "container", "all"), unit = c("native", "point", "npc"), ... )
getGraphFromRedeR( status = c("all", "selected", "notselected"), attribs = c("all", "minimal"), type = c("node", "container", "all"), unit = c("native", "point", "npc"), ... )
status |
A filter (string) indicating the status of the graph elements that should be fetched from the RedeR app (default='all'). |
attribs |
A filter (string) indicating the graph attributes that should be fetched from the RedeR app (default='all'). |
type |
A filter (string) indicating the graph element types that should be fetched from the RedeR app (default='node'). |
unit |
A string specifying the unit for lengths, widths,
and sizes assigned to node and edge attributes. RedeR space
coordinate system is native to Java Graphics2D, which uses 'points' by
default (a point is 1/72 of an inch). Current options include 'native',
'point', and 'npc'. The 'native' option will used definition from
|
... |
Arguments passed to internal checks (ignore). |
igraph objects from RedeR.
Sysbiolab.
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy1 <- graph.lattice(c(3, 3, 3)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy1) # Get graph from RedeR gtoy2 <- getGraphFromRedeR()
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy1 <- graph.lattice(c(3, 3, 3)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy1) # Get graph from RedeR gtoy2 <- getGraphFromRedeR()
Method to assign out-edges to containers in an active RedeR session. This method transfers edges from nodes to the respective containers.
## S4 method for signature 'numeric_Or_missing' mergeOutEdges(nlevels = 2, rescale = TRUE, lb = NA, ub = NA, rdp = NA)
## S4 method for signature 'numeric_Or_missing' mergeOutEdges(nlevels = 2, rescale = TRUE, lb = NA, ub = NA, rdp = NA)
nlevels |
Number of levels (>=1) to be merged in the nested network. |
rescale |
Logical value, whether to rescale out-edge width to not overextend the container size; if 'FALSE', it will run a simple sum when combining the out-edges. |
lb |
Custom lower bound to rescale edge width between containers. |
ub |
Custom upper bound to rescale edge width between containers. |
rdp |
A |
Add/change edge assigments.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # create a fully connected graph g <- igraph::make_full_graph(5) V(g)$name <- paste0("n", 1:5) # Start the RedeR interface startRedeR() # Add 'g' to the interface addGraphToRedeR(g, layout.kamada.kawai(g)) # Nest nodes in the interface nestNodes(c("n1", "n2", "n3"), gcoord = c(30, 30), gscale = 30) nestNodes(c("n4", "n5"), gcoord = c(70, 70), gscale = 20) # Merge nodes between containers mergeOutEdges()
# Load RedeR and igraph library(RedeR) library(igraph) # create a fully connected graph g <- igraph::make_full_graph(5) V(g)$name <- paste0("n", 1:5) # Start the RedeR interface startRedeR() # Add 'g' to the interface addGraphToRedeR(g, layout.kamada.kawai(g)) # Nest nodes in the interface nestNodes(c("n1", "n2", "n3"), gcoord = c(30, 30), gscale = 30) nestNodes(c("n4", "n5"), gcoord = c(70, 70), gscale = 20) # Merge nodes between containers mergeOutEdges()
Nest nodes into containers.
## S4 method for signature 'character' nestNodes( nodes, isAssigned = TRUE, isAnchored = TRUE, gscale = 40, gcoord = c(50, 50), status = c("plain", "hide", "transparent"), theme = c("th0", "th1", "th2", "th3"), gatt = list(), parent = NULL, verbose = TRUE, rdp = NA )
## S4 method for signature 'character' nestNodes( nodes, isAssigned = TRUE, isAnchored = TRUE, gscale = 40, gcoord = c(50, 50), status = c("plain", "hide", "transparent"), theme = c("th0", "th1", "th2", "th3"), gatt = list(), parent = NULL, verbose = TRUE, rdp = NA )
nodes |
A vector with node names available in the RedeR app. |
isAssigned |
Logical value, whether to assign the container name to the nested nodes |
isAnchored |
Logical value, whether to anchor the container in dynamic layout sessions. |
gscale |
Expansion factor of the nest area related to a parent nest, or related to the app panel. |
gcoord |
A numeric vector with 'x' and 'y' coordinates for the center of nest related to the app panel or a parent container. Coordinates between 0 and 100 are set to visible areas of the app panel. |
status |
Status of the container on the screen: 'plain', 'transparent', or 'hide'. |
theme |
Some pre-defined graph attributes. Options: 'th0', 'th1', 'th2', and 'th3'. |
gatt |
A list with container attributes (see details).
|
parent |
Optional argument, a nest ID of a parent nest. It must be used with 'isAssign=TRUE'. |
verbose |
A logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE). |
rdp |
A |
The gatt
argument can be used to pass detailed attributes to
containers, for example, gatt = list(nestLabel="Nest1")
.
Options for nestShape
: "ELLIPSE", "RECTANGLE",
"ROUNDED_RECTANGLE", "TRIANGLE", and "DIAMOND"
Options for nestLineType
: "SOLID", "DOTTED",
"DASHED", "LONG_DASH".
When nestLabelCoords = c(x=0, y=0)
then the label will be
centered and placed at the top of the container.
Add/change graph objects.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Initialize RedeR and igraph library(RedeR) library(igraph) # create a graph from an edge list el <- matrix(c("n1", "n2", "n3", "n4"), ncol = 2, byrow = TRUE) g <- graph.edgelist(el) # Start the RedeR interface startRedeR() # Add 'g' to the interface addGraphToRedeR(g, layout.kamada.kawai(g)) # Nest nodes in the interface nestNodes(c("n1", "n2"), gcoord = c(30, 30)) nestNodes(c("n3", "n4"), gcoord = c(70, 70))
# Initialize RedeR and igraph library(RedeR) library(igraph) # create a graph from an edge list el <- matrix(c("n1", "n2", "n3", "n4"), ncol = 2, byrow = TRUE) g <- graph.edgelist(el) # Start the RedeR interface startRedeR() # Add 'g' to the interface addGraphToRedeR(g, layout.kamada.kawai(g)) # Nest nodes in the interface nestNodes(c("n1", "n2"), gcoord = c(30, 30)) nestNodes(c("n3", "n4"), gcoord = c(70, 70))
Test the R-to-Java interface of an active RedeR session.
## S4 method for signature 'RedPort' ping(obj)
## S4 method for signature 'RedPort' ping(obj)
obj |
A |
Ping test for RedeR app, either '1' (accessible) or '0' (not accessible)
Sysbiolab.
rdp <- RedPort('MyPort') ping(rdp) # [1] 0 calld(rdp) ping(rdp) # [1] 1
rdp <- RedPort('MyPort') ping(rdp) # [1] 0 calld(rdp) ping(rdp) # [1] 1
Test the R-to-Java interface of an active RedeR session.
pingRedeR()
pingRedeR()
Ping test for RedeR app.
Sysbiolab.
# Load RedeR library(RedeR) # Call 'start' and 'ping' methods startRedeR() pingRedeR()
# Load RedeR library(RedeR) # Call 'start' and 'ping' methods startRedeR() pingRedeR()
Preprocessed Human interactome extracted from the Human Protein Reference Database (HPRD) in April 2011 <igraph object> ('name' attribute is mapped to ENTREZ ID).
data(hs.inter)
data(hs.inter)
igraph
A pre-processed igraph object.
This package.
data(hs.inter)
data(hs.inter)
Preprocessed data from a time-course gene expression and ChIP-on-chip analysis of estrogen receptor (ER) binding sites in the MCF7 cell line (Carroll et al, 2006).
data(ER.limma)
data(ER.limma)
igraph
The 'ER.limma' dataset contains results from a differential gene expression analysis described elsewhere (Castro et al., 2012). This dataset also includes annotation of ER-binding sites. The original gene expression dataset (Carroll et al.) consists of 12 time-course Affymetrix U133Plus2.0 microarrays: 3 replicates at 0h, 3 replicates at 3h, 3 replicates at 6h and 3 replicates at 12h. The original dataset is available at the GEO database (GSE11324).
A data-frame containing pre-processed results from a 'limma' analysis listing the DE genes only. The data-frame columns list the following information: annotation (ENTREZ and Symbol), time-course fold change (logFC.t3, logFC.t6, logFC.t12), p values (p.value.t3, p.value.t6, p.value.t12), DE genes (degenes.t3, degenes.t6, degenes.t12) and kb distance of the nearest ER-binding site to the TSS (ERbdist).
A pre-processed dataset.
Carroll JS et al., Genome-wide analysis of estrogen receptor binding sites. Nat Genet. 38(11):1289-97, 2006.
Castro MA et al. RedeR: R/Bioconductor package for representing modular structures, nested networks and multiple levels of hierarchical associations. Genome Biology, 13(4):R29, 2012.
data(ER.limma)
data(ER.limma)
Constructor of the RedeR interface for remote procedure calls.
RedPort(title = "default", host = "127.0.0.1", port = 9091, checkJava = FALSE)
RedPort(title = "default", host = "127.0.0.1", port = 9091, checkJava = FALSE)
title |
A string naming the RedeR interface. |
host |
Domain name of the remote computer that is running the interface. |
port |
An integer specifying the port on which the interface should listen for incoming requests. |
checkJava |
A logical value, whether to check the Java Runtime Environment (JRE) installed on the system. |
An object of the RedPort class.
Sysbiolab.
# Initialize RedeR library(RedeR) rdp <- RedPort() # Set global options used in internal methods options(RedPort = RedPort())
# Initialize RedeR library(RedeR) rdp <- RedPort() # Set global options used in internal methods options(RedPort = RedPort())
RedPort: An S4 class for RedeR graphics
An S4 class object.
title
A string naming the XML-RPC port.
uri
The uri to the XML-RPC server.
host
Domain name of the machine that is running the XML-RPC server.
port
An integer specifying the port on which the XML-RPC server should listen.
Sysbiolab.
addGraph
, getGraph
, relax
,
calld
, @seealso resetd
, exitd
,
ping
, version
.
RedeR's hierarchical force-directed interactive layout.
## S4 method for signature 'RedPort' relax( obj, p1 = 100, p2 = 100, p3 = 100, p4 = 100, p5 = 100, p6 = 10, p7 = 10, p8 = 100, p9 = 10 )
## S4 method for signature 'RedPort' relax( obj, p1 = 100, p2 = 100, p3 = 100, p4 = 100, p5 = 100, p6 = 10, p7 = 10, p8 = 100, p9 = 10 )
obj |
A |
p1 |
Edge target length (unit in points; >= 1 ) <numeric>. |
p2 |
Edge stiffness (arbitrary unit; >= 0 ) <numeric>. |
p3 |
Node repulsion factor (arbitrary unit; >= 0 ) <numeric>. |
p4 |
Node perimeter effect (unit in points; >= 0 ) <numeric>. |
p5 |
Node speed limit (arbitrary unit; >= 0 ) <numeric>. |
p6 |
Repulsion radius, i.e., this parameter limits the repulsion factor range (unit as in 'p1'; >= 0 ) <numeric>. |
p7 |
Central pull (arbitrary unit; >= 0 ) <numeric>. |
p8 |
Nest-nest edge target length, i.e., edge target between linked containers (unit in points; >= 1 ) <numeric>. |
p9 |
Nest-node repulsion factor, i.e., repulsion among containers and out-nodes (arbitrary unit; >= 0 ) <numeric>. |
Layout a graph in the app panel.
Sysbiolab.
# Load RedeR and igraph library(RedeR) library(igraph) g <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() calld(rdp) addGraph(rdp, g, layout.random(g)) relax(rdp)
# Load RedeR and igraph library(RedeR) library(igraph) g <- graph.lattice(c(5, 5, 5)) rdp <- RedPort() calld(rdp) addGraph(rdp, g, layout.random(g)) relax(rdp)
RedeR's hierarchical force-directed interactive layout.
relaxRedeR( p1 = 100, p2 = 100, p3 = 100, p4 = 100, p5 = 100, p6 = 10, p7 = 10, p8 = 100, p9 = 10 )
relaxRedeR( p1 = 100, p2 = 100, p3 = 100, p4 = 100, p5 = 100, p6 = 10, p7 = 10, p8 = 100, p9 = 10 )
p1 |
Edge target length (unit in points; >= 1 ) <numeric>. |
p2 |
Edge stiffness (arbitrary unit; >= 0 ) <numeric>. |
p3 |
Node repulsion factor (arbitrary unit; >= 0 ) <numeric>. |
p4 |
Node perimeter effect (unit in points; >= 0 ) <numeric>. |
p5 |
Node speed limit (arbitrary unit; >= 0 ) <numeric>. |
p6 |
Repulsion radius, i.e., this parameter limits the repulsion factor range (unit as in 'p1'; >= 0 ) <numeric>. |
p7 |
Central pull (arbitrary unit; >= 0 ) <numeric>. |
p8 |
Nest-nest edge target length, i.e., edge target between linked containers (unit in points; >= 1 ) <numeric>. |
p9 |
Nest-node repulsion factor, i.e., repulsion among containers and out-nodes (arbitrary unit; >= 0 ) <numeric>. |
RedeR's interactive layout uses a force-directed algorithm described elsewhere (Brandes 2001; Fruchterman and Reingold 1991). Here we adapted the method to deal with nested networks. In force-directed graphs, each edge can be regarded as a spring - with a given target length - and can either exert a repulsive or attractive force on the connected nodes, while nodes are analogous to mutually repulsive charged particles that move according to the applied forces. In RedeR, the simulation is additionally constrained by the hierarchical structure of the network. For example, a nested node is constrained to its parent-node by opposing forces applied by the nest, which is regarded as a special node whose nested objects can reach a local equilibrium independently from other network levels. The simulation is adjusted by global options and evolves until the system reaches the equilibrium state. The default values are set to layout sparse networks with few nodes (e.g. 10-100 nodes). For large and dense networks better results can be achieved interactively by tuning one or more parameters.
Layout a graph in the app panel.
Sysbiolab.
Brandes U. Drawing graphs: methods and models. In: Lecture notes in computer science. Kaufmann M. and Wagner D. (Ed), vol. 2025. Heidelberg: Springer; 2001: 71-86.
Fruchterman TMJ, Reingold EM. Graph drawing by force-directed placement. Software: Practice and Experience 1991, 21(11):1129-1164.
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy <- graph.lattice(c(5, 5, 5)) # Start the RedeR interface startRedeR() # Send the igraph to RedeR addGraphToRedeR(g = gtoy) # Start interactive layout relaxRedeR()
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy <- graph.lattice(c(5, 5, 5)) # Start the RedeR interface startRedeR() # Send the igraph to RedeR addGraphToRedeR(g = gtoy) # Start interactive layout relaxRedeR()
Reset an active RedeR session.
## S4 method for signature 'RedPort' resetd(obj)
## S4 method for signature 'RedPort' resetd(obj)
obj |
A |
Reset plotting panel.
Sysbiolab.
rdp <- RedPort() calld(rdp) resetd(rdp)
rdp <- RedPort() calld(rdp) resetd(rdp)
Reset an active RedeR session.
resetRedeR()
resetRedeR()
Reset plotting panel.
Sysbiolab.
# Load RedeR library(RedeR) # Call 'start' and 'reset' methods startRedeR() resetRedeR()
# Load RedeR library(RedeR) # Call 'start' and 'reset' methods startRedeR() resetRedeR()
Select edges in an active RedeR application.
## S4 method for signature 'character' selectEdges(edges, ...) ## S4 method for signature 'data.frame' selectEdges(edges, ...)
## S4 method for signature 'character' selectEdges(edges, ...) ## S4 method for signature 'data.frame' selectEdges(edges, ...)
edges |
A vertex sequence <vector of strings> or data frame of ncol=2. |
... |
Arguments passed to internal checks (ignore). |
Mark edges – which can be handled by other methods.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add and select edges addEdges(edges) selectEdges(c("n1", "n3"))
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add and select edges addEdges(edges) selectEdges(c("n1", "n3"))
Select nodes in an active RedeR application.
## S4 method for signature 'character' selectNodes(nodes, anchor = FALSE, nid = NULL, ...)
## S4 method for signature 'character' selectNodes(nodes, anchor = FALSE, nid = NULL, ...)
nodes |
A string or array of strings with node names. |
anchor |
A logical value, whether to anchor nodes, which will prevent
the |
nid |
A nest ID. This will restrict searching to a specific container. |
... |
Arguments passed to internal checks (ignore). |
Mark nodes – which can be handled by other methods.
Sysbiolab.
addGraphToRedeR
, getGraphFromRedeR
.
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add edges and select nodes addEdges(edges) selectNodes(c("n1", "n3"))
# Load RedeR and igraph library(RedeR) library(igraph) # Create some edges as a data.frame edges <- data.frame( A = c("n1", "n1", "n1", "n1"), B = c("n2", "n3", "n4", "n5") ) # Start the RedeR interface startRedeR() # Add edges and select nodes addEdges(edges) selectNodes(c("n1", "n3"))
Method to launch RedeR application from R.
startRedeR(...)
startRedeR(...)
... |
Arguments passed to the |
The startRedeR()
is a wrapper function that launches the RedeR app
by calling RedPort()
and calld()
methods. Therefore, these
methods no longer needed to be called by the user from RedeR version >=3.
List of functions that uses startRedeR()
:
addGraphToRedeR Methods to display igraph objects.
getGraphFromRedeR Methods to wrap up RedeR graphs.
addLegendToRedeR Methods to display legends.
relaxRedeR Start RedeR's interactive layout.
resetRedeR Reset an active RedeR session.
exitRedeR Close an active RedeR session.
pingRedeR Test the R-to-Java interface.
addNodes Add nodes to an active RedeR application.
addEdges Add edges to an active RedeR application.
selectNodes Select nodes in an active RedeR application.
selectEdges Select edges in an active RedeR application.
deleteNodes Delete nodes from an active RedeR application.
deleteEdges Delete edges from an active RedeR application.
nestNodes Nest nodes into containers.
mergeOutEdges Assign 'out-edges' to containers.
System call to start the RedeR application.
Sysbiolab.
# Load RedeR library(RedeR) # Start the RedeR interface startRedeR()
# Load RedeR library(RedeR) # Start the RedeR interface startRedeR()
Creates a subgraph containing nodes specified from a data frame.
subg(g, dat, refcol = 1, maincomp = TRUE, connected = TRUE, transdat = TRUE)
subg(g, dat, refcol = 1, maincomp = TRUE, connected = TRUE, transdat = TRUE)
g |
An 'igraph' object. |
dat |
A data frame with node names and attributes to be mapped to 'g'. |
refcol |
The reference column (node names) in the 'dat' object. |
maincomp |
Logical value, whether to return only the main component of the subgraph. |
connected |
Logical value, whether to return only connected nodes. |
transdat |
Logical value, whether to transfer node attributes from the 'dat' object to the subgraph. |
An igraph object.
# see 'nested subgraphs' section in RedeR's vignette: # vignette("RedeR")
# see 'nested subgraphs' section in RedeR's vignette: # vignette("RedeR")
Given an 'igraph' object, 'att.addv' adds a new attribute with a fixed 'value' to all nodes or selected nodes, while 'att.adde' adds a new attribute with a fixed 'value' to all edges.
The 'att.mapv' and 'att.mape' functions map data frames to an 'igraph' object.
The 'att.setv' and 'att.sete' functions rename attributes available in the an 'igraph' object, transforming them into new attribute classes (for example, numeric values into colors or sizes).
att.addv(g, to, value, index = V(g), filter = NULL) att.adde(g, to, value, index = E(g)) att.setv( g, from = "name", to = "nodeColor", pal = 1, cols = NULL, na.col = "grey70", xlim = c(20, 100, 1), breaks = NULL, nquant = NULL, digits = 1, title = from, isrev = FALSE ) att.sete( g, from = "name", to = "edgeColor", pal = 1, cols = NULL, na.col = "grey70", xlim = c(20, 100, 1), breaks = NULL, nquant = NULL, title = from, digits = 1, isrev = FALSE ) att.mapv(g, dat, refcol = 1)
att.addv(g, to, value, index = V(g), filter = NULL) att.adde(g, to, value, index = E(g)) att.setv( g, from = "name", to = "nodeColor", pal = 1, cols = NULL, na.col = "grey70", xlim = c(20, 100, 1), breaks = NULL, nquant = NULL, digits = 1, title = from, isrev = FALSE ) att.sete( g, from = "name", to = "edgeColor", pal = 1, cols = NULL, na.col = "grey70", xlim = c(20, 100, 1), breaks = NULL, nquant = NULL, title = from, digits = 1, isrev = FALSE ) att.mapv(g, dat, refcol = 1)
g |
An 'igraph' object. |
to |
A valid RedeR attribute name (see |
value |
A single value for an edge or vertex attribute. |
index |
An optional index to set an attribute to a subset of vertices or edges. |
filter |
A named list of length = 1, used to filter which nodes will receive the attribute. The attribute 'to' will be added to nodes which have the attribute. |
from |
An attribute name available in 'g'. |
pal |
Color palette option (1 or 2); 'pal=1' will use a single color palette, while 'pal=2' will split 'breaks' at the center, generating two color palettes. The 'pal=2' option may be useful to build separated color palettes, for example, negative and positive values. |
cols |
Vector of colors (either hexadecimals or valid color names). |
na.col |
A single color for NAs. |
xlim |
A numeric vector with three boundaries: c(<lower>, <upper>, <NA>). It corresponds to boundary values to be apply to numeric attributes (e.g. nodeSize). Default: c(20, 100, 1). |
breaks |
A numeric vector of two or more breakpoints to be applied to the attribute values. |
nquant |
Number of breakpoints to split attribute values by quantiles. |
digits |
Integer indicating the number of decimal places in the legend of numerical attributes. |
title |
A legend title. |
isrev |
A logical value, whether to verse attribute values. |
dat |
A data frame with the attributes to be mapped to 'g'. |
refcol |
A reference column in the 'dat' object used to map 'dat' to 'g'. For 'att.mapv', 'refcol' is a single integer value indicating a column with node ids. For 'att.mape', 'refcol' is a vector with two integers indicating columns with edge ids. Also, for 'att.mapv', when 'refcol = 0' rownames will be used to map 'dat' to 'g'. |
Add, map, and set igraph attributes to the RedeR application.
addGraphToRedeR
, getGraphFromRedeR
library(igraph) # Generate a 'toy' graph with vertex names gtoy <- sample_pa(10, directed=FALSE) V(gtoy)$name <- paste0("V",1:vcount(gtoy)) # Create data frame with IDs compatible to vertex names df <- data.frame(ID=sample(V(gtoy)$name)) # Add two variables to 'df' for demonstration df$var_mumbers <- rnorm(nrow(df)) df$var_letters <- letters[1:nrow(df)] ### Using the 'att.set' functions to transform edge and vertex attributes # Map 'df' to vertex attributes gtoy <- att.mapv(g = gtoy, dat = df, refcol = 1) # Set a new vertex attribute, creating 'nodeLabel' from 'var_letters' gtoy <- att.setv(gtoy, from = "var_letters", to = "nodeLabel") # Set a new vertex attribute, creating 'nodeColor' from 'var_mumbers' gtoy <- att.setv(gtoy, from = "var_mumbers", to = "nodeColor", breaks = seq(-1, 1, 0.2), pal = 2 ) # Set a new vertex attribute, creating 'nodeSize' from 'var_mumbers' gtoy <- att.setv(gtoy, from = "var_mumbers", to = "nodeSize", nquant = 10, isrev = TRUE, xlim = c(5, 40, 1) ) ### Using the 'att.add' functions to add fixed values # Add a new vertex attribute, creating 'nodeFontSize' from a fixed value gtoy <- att.addv(gtoy, to = "nodeFontSize", value = 10) # ...as above, but applied only to three nodes gtoy <- att.addv(gtoy, to = "nodeFontSize", value = 100, filter = list("name" = V(gtoy)$name[1:3]) )
library(igraph) # Generate a 'toy' graph with vertex names gtoy <- sample_pa(10, directed=FALSE) V(gtoy)$name <- paste0("V",1:vcount(gtoy)) # Create data frame with IDs compatible to vertex names df <- data.frame(ID=sample(V(gtoy)$name)) # Add two variables to 'df' for demonstration df$var_mumbers <- rnorm(nrow(df)) df$var_letters <- letters[1:nrow(df)] ### Using the 'att.set' functions to transform edge and vertex attributes # Map 'df' to vertex attributes gtoy <- att.mapv(g = gtoy, dat = df, refcol = 1) # Set a new vertex attribute, creating 'nodeLabel' from 'var_letters' gtoy <- att.setv(gtoy, from = "var_letters", to = "nodeLabel") # Set a new vertex attribute, creating 'nodeColor' from 'var_mumbers' gtoy <- att.setv(gtoy, from = "var_mumbers", to = "nodeColor", breaks = seq(-1, 1, 0.2), pal = 2 ) # Set a new vertex attribute, creating 'nodeSize' from 'var_mumbers' gtoy <- att.setv(gtoy, from = "var_mumbers", to = "nodeSize", nquant = 10, isrev = TRUE, xlim = c(5, 40, 1) ) ### Using the 'att.add' functions to add fixed values # Add a new vertex attribute, creating 'nodeFontSize' from a fixed value gtoy <- att.addv(gtoy, to = "nodeFontSize", value = 10) # ...as above, but applied only to three nodes gtoy <- att.addv(gtoy, to = "nodeFontSize", value = 100, filter = list("name" = V(gtoy)$name[1:3]) )
This function updates node coordinates of an igraph object with the node coordinates from the RedeR interface.
updateLayoutFromRedeR(g, delNodes = FALSE, delEdges = FALSE)
updateLayoutFromRedeR(g, delNodes = FALSE, delEdges = FALSE)
g |
An igraph object, which will be updated with the graph layout
displayed in the RedeR interface. Note: 'g' must be the same igraph object
sent to the RedeR interface by the |
delNodes |
Option to delete nodes from 'g' when these nodes are not displayed in the RedeR interface. |
delEdges |
Option to delete edges from 'g' when these edges are not displayed in the RedeR interface. |
An updated igraph object.
Sysbiolab.
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy1 <- graph.lattice(c(3, 3, 3)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy1) # Update 'gtoy1' with changes introduced in the RedeR interface gtoy2 <- updateLayoutFromRedeR(g = gtoy1)
# Load RedeR and igraph library(RedeR) library(igraph) # Create an igraph gtoy1 <- graph.lattice(c(3, 3, 3)) # Start the RedeR interface startRedeR() # Send graph to RedeR addGraphToRedeR(g = gtoy1) # Update 'gtoy1' with changes introduced in the RedeR interface gtoy2 <- updateLayoutFromRedeR(g = gtoy1)
Returns the RedeR application version.
## S4 method for signature 'RedPort' version(obj)
## S4 method for signature 'RedPort' version(obj)
obj |
A |
Version of the running app.
Sysbiolab.
rdp <- RedPort() calld(rdp) version(rdp)
rdp <- RedPort() calld(rdp) version(rdp)