initialize | R Documentation |
copy
copy
flip
terminal
new()
Set up the constructor GNODE index - snode.id graph
gNode$new(snode.id = NULL, graph)
snode.id
signed node id
graph
gGraph associated with this sNode
mark()
Marks the nodes pointed at by this gNode by adding metadata in the gGraph they came from. Metadata names can be arbitrary, such as "lwd = 7" or "highlight = TRUE". gGraph nodes have metadata specified appended to them
gNode$mark(...)
...
metadata names = data to store in metadata columns
...
name = value pairs of scalar or vector (length edges in graph) arguments “'
“' gg$nodes[1:5]$mark(col = "purple") gg$nodes$mark(changed = FALSE)
rep()
Creates "bubbles" in the graph by replicating the nodes in the argument. Node replication replicates edges going in and out of all replicated nodes. If an edge connects a pair of replicated nodes that edge will be replicated across all pairs of those replciated nodes. Walk replication will create "longer bubbles" with fewer edges getting replicated i.e. it will only replicate intra-walk edges within each walk replicate (but not between separate walk replicates).
New graph keeps track of the parent node and edge ids in the original graph using node metadata parent.node.id and edge metadata parent.edge.id i.e. the replicated nodes will be connected to the sources of the original nodes and if replicated nodes connect to each other, then there will exist an edge connecting all of their instances to each other.
gNode$rep(times)
times
scalar or vector of length self$length specifying how many times to replicate each of the nodes.
nodes
= gNode object must point to a node in the graph, can also be an index of a node (but not a metadata expression), can also be a gWalk object
Returns a pointer to the new nodes
swap()
Swap nodes with granges, grl, or Gwalks. Provided replacement vector must be the same length as the inputted nodes, resulting in each node being "swapped" by the provided interval, node, grl (representing a walk), or gWalk. The replacement will inherit left and right edges for the removed node. If the replacement is a walk, then the left side of the first node in the walk will inherit the edges that were previously to the left of the node being replaced, and right side of the last node of the walk will inherit the edges that were previously to the right of the node being replaced.
Note: these replacement obey the orientation of the arguments. So if the node to be replaced is flipped (- orientation with respect to the reference, then it's "left" is to the right on the reference. Similarly for walks whose first interval is flipped with respect to the reference, the left edges will be attached to the right of the node on the reference.)
gNode$swap(replacement)
replacement
GRanges, GRangesList, or gWalk object whose length is the length(nodes)
gGraph (also modified in place) with nodes annotated with parent.node.id, parent.rep
subset()
Allows subseting of the Node object using bracket notation
gNode$subset(i)
i
integer or logical index
subset of nodes indexed by i
eval()
Evaluates expression over edge metadata for all nodes in self with a keyby node.id returning a self$length vector
gNode$eval(x, right = TRUE, all = FALSE)
x
expression over edge metadata value for "cluster"
clusters()
Marks nodes in graph with metadata field $cluster based on one of several algorithms, selected by mode.
Unlike the gGraph version of this function, this usage enables computation of clusters based on a subset of nodes in the graph (i.e. ignoring certain nodes) while still marking the original graph (and leaving the excluded graph with an NA) value for "cluster"
gNode$clusters(mode = "weak")
weak
character scalar that can take one of the following possible values - "weak" or "strong" specifying weakly or strongly connected components, walktrap specifying cluster_walktrap community detection
weak
character scalar that can take one of the following possible values - "weak" or "strong" specifying weakly or strongly connected components, walktrap specifying cluster_walktrap community detection
ego()
returns all nodes with k degrees of separation (i.e. "order") from these
gNode$ego(order = 0, mindist = 0)
order
integer edge distance from these (seed) nodes to return
mindist
minimum distance from these (seed) nodes
gNode object comprising nodes within the ego of this node
print()
Prints out the gNode Object. Prints the length and the GRanges of the nodes.
gNode$print()
loose.degree()
gNode$loose.degree(orientation)
orientation
(character) one of 'left' or 'right'
number of loose ends with given orientation
clone()
The objects of this class are cloneable with this method.
gNode$clone(deep = FALSE)
deep
Whether to make a deep clone.
Joe DeRose
Marcin Imielinski
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.