LoomGraph | R Documentation |
The LoomGraph
class extends the SelfHits
class.
The SelfHits
class represents a set of hits between a set of left node and right nodes.
Only the Hits are stored in a SelfHits object
.
The LoomGraph
class is meant to store graph information and was created to be used in conjunction with the LoomExperiment
class.
Its purpose is to store either a col_graph
or row_graph
as specified by the loom
file format.
Attributes from
and to
indicate an edge between two vertices.
The w
column indicates the weight of the corresponding edge and is optional.
LoomGraph(from, to, nnode=max(from, to), ..., weight=NULL)
## S4 method for signature 'LoomGraph'
rbind(..., deparse.level=1)
## S4 method for signature 'LoomGraph'
cbind(..., deparse.level=1)
... |
Arguments to pass to the |
from |
A numeric vector of nodes indicating one side of the graph's edge. |
to |
A numeric vector of node indicating the second side of the graph's edge. |
nnode |
An integer indicating the maximum number of nodes in the graph. |
weight |
A numeric vector indicating the weight between the prospective edges. |
deparse.level |
See '?base::cbind' for a description of this argument |
A LoomGraph object is returned from the constructor.
Daniel Van Twisk
LoomExperiment
,
LoomGraphs
,
SelfHits
## Construction
a <- c(1, 2, 3)
b <- c(3, 2, 1)
w <- c(100, 10, 1)
df <- DataFrame(a, b, w)
lg <- as(df, "LoomGraph")
# OR
lg <- LoomGraph(a, b, weight=w)
lg
## Subsetting
lg[c(1, 2)]
lg[-c(2)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.