LoomGraph-class: LoomGraph class

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
2
3
4
5
6
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

...

Arguments to pass to the SelfHits constructor.

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

Value

A LoomGraph object is returned from the constructor.

Author(s)

Daniel Van Twisk

See Also

LoomExperiment, LoomGraphs, SelfHits

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)]

LoomExperiment documentation built on Nov. 8, 2020, 5:41 p.m.