LoomGraph {LoomExperiment} | R Documentation

## LoomGraph class

### 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

    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

    ## 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)]

[Package LoomExperiment version 1.2.0 Index]