export-methods {LoomExperiment} | R Documentation

## Export LoomExperiment to LoomFile

### Description

Exports a `LoomExperiment` to a `LoomFile`. Note the `colGraph` and `rowGraph` contained within the `LoomExperimnet` object are 1-indexed in `R` and are converted to 0-indexed in the loom file.

### Usage

    ## S4 method for signature 'LoomExperiment,LoomFile,ANY'
    export(object, con,
        matrix=assayNames(object)[1], rownames_attr="rownames", colnames_attr="colnames")

### Arguments

`object` | A `LoomExperiment` object to be exported. File must have the `.loom` extension.
`con` | The connection from which data is loaded or to which data is saved. If this is a `character vector`, it is assumed to be a filename and a corresponding file connection is created and then closed after exporting the object. If a `RTLFile` derivative, the data is loaded from or saved to the underlying resource.
`matrix` | A `matrix` in which the column and rows for the Loom file will be derived. The default argument is dervied from the the first assay in the `LoomExperiment` object.
`rownames_attr` | A `character vector` indicating the name of the `rowData` attribute to represent the names `rownames` in the `LoomExperiment` object.
`colnames_attr` | A `character vector` indicating the name of the `colData` attribute to represent the names `colnames` in the `LoomExperiment` object.

### Value

An error code indiciating whether the operation was successful.

### See Also

`LoomExperiment`, `LoomFile`,

### Examples

    counts <- matrix(rpois(100, lambda = 10), ncol=10, nrow=10)
    sce <- SingleCellExperiment(assays = list(counts = counts))
    scle <- SingleCellLoomExperiment(sce)
    tempfile <- tempfile(fileext=".loom")
    export(scle, tempfile)

[Package LoomExperiment version 1.2.0 Index]