LoomExperiment {LoomExperiment} | R Documentation

## LoomExperiment, RangedLoomExperiment, and SingleCellLoomExperiment classes

### Description

The LoomExperiment family of classes is used as a bridge between Bioconductor's "Experiment" classes and the Linnarson Lab's http://linnarssonlab.org/loompy/index.html. The family of LoomExperiment classes all inherit from the class LoomExperiment as well as their respectively named parent classes. The LoomExperiment class inheirts from `SummarizedExperiment`.

### Usage

    ## Constructor

    LoomExperiment(..., colGraphs = LoomGraphs(), rowGraphs = LoomGraphs())
    RangedLoomExperiment(..., colGraphs = LoomGraphs(), rowGraphs = LoomGraphs())
    SingleCellLoomExperiment(..., colGraphs = LoomGraphs(), rowGraphs = LoomGraphs())

    ## Accessors

    ## S4 method for signature 'LoomExperiment'
    colGraphs(x, ...)
    ## S4 replacement method for signature 'LoomExperiment'
    colGraphs(x, ...) <- value
    ## S4 method for signature 'LoomExperiment'
    rowGraphs(x, ...)
    ## S4 replacement method for signature 'LoomExperiment'
    rowGraphs(x, ...) <- value

    ## Subsetting

    ## S4 method for signature 'LoomExperiment'
    x[i, j, ..., drop=TRUE]

    ## Binding

    ## S4 method for signature 'LoomExperiment'
    rbind(..., deparse.level=1)
    ## S4 method for signature 'LoomExperiment'
    cbind(..., deparse.level=1)

### Arguments

`x` | A LoomExperiment object
`colGraphs,rowGraphs` | LoomGraphs to be placed in either the colGraphs or rowGraphs slot respectively
`value` | For `colGraphs<-` and `rowGraphs<-`, `value` will be the replacement to the slot. For `dropHits<-`, indices to replace selected indices with.
`...` | For constructors, `...` will be passed on to the respective Experiment constructor.
`i,j` | For subsetting, indices specifying elements to subset LoomGraph by. For dropHits, numeric indicating the node number
`drop` | For matrices and arrays. If 'TRUE' the result is coerced to the lowest posible dimesnion. This only woeks for extracting elements, not for the replacement.
`deparse.level` | See '?base::cbind' for a description of this argument.

### Details

The LoomExperiment class is a virtual class meant to to act as an interface for other `"_LoomExperiment"` classes. It contains two slots:

`colGraphs`:

  A LoomGraphs object containing `col_graph` data as specified by the loom format.

`rowGraphs`:

  A LoomGraphs object containing `row_graph` data as specified by the loom format.

The intended use of this class is as an interface that allows various slots and operations necessary for subsequent `"_LoomExperiment"` classes to be defined.

The `colGraphs` and `rowGraphs` slot stores a `LoomGraphs` object that stores a graph of edges between vertices and possibly associated weights. These slots may be `NULL`.

### Value

An object of class `LoomExperiment`

### Author(s)

Daniel Van Twisk

### See Also

`SummarizedExperiment`, `RangedSummarizedExperiment`, `SingleCellExperiment`

### Examples

    ## Construction
    counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10)
    sce <- SingleCellExperiment(assays = list(counts = counts))
    scle <- SingleCellLoomExperiment(sce)
    # OR
    scle <- SingleCellLoomExperiment(assays = list(counts = counts))
    # OR
    scle <- as(sce, "SingleCellLoomExperiment")
    scle

    ## Get and replace rowGraphs and colGraphs
    colGraphs(scle)
    rowGraphs(scle)

    a <- c(1, 2, 3)
    b <- c(3, 2, 1)
    w <- c(100, 10, 1)
    lg <- LoomGraph(a, b, weight=w)
    lgs <- LoomGraphs(lg, lg)
    names(lgs) <- c('lg1', 'lg2')
    lgs

    colGraphs(scle) <- lgs
    rowGraphs(scle) <- lgs

    colGraphs(scle)
    rowGraphs(scle)
    colGraphs(scle)[[1]]
    rowGraphs(scle)[[1]]

    ## Subsetting
    scle2 <- scle[c(1, 3), 1:2]
    colGraphs(scle2)[[1]]
    rowGraphs(scle2)[[1]]

[Package LoomExperiment version 1.8.0 Index]