sce_to_spe: Convert a SCE object to a SPE one

View source: R/sce_to_spe.R

sce_to_speR Documentation

Convert a SCE object to a SPE one

Description

This function converts a spot-level SingleCellExperiment-class (SCE) object as generated by fetch_data() to a SpatialExperiment-class (SPE) object.

Usage

sce_to_spe(sce = fetch_data("sce"), imageData = NULL)

Arguments

sce

Defaults to the output of fetch_data(type = 'sce'). This is a SingleCellExperiment object with the spot-level Visium data and information required for visualizing the histology. See fetch_data() for more details.

imageData

A DataFrame() with image data. Will be used with SpatialExperiment::imgData. If NULL, then this will be constructed for you assuming that you are working with the original data from spatialLIBD::fetch_data("sce").

Details

Note that the resulting object is a bit more complex than a regular SPE because it contains the data from the spatialLIBD project which you might otherwise have to generate for your own data.

Value

A a SpatialExperiment-class object.

Author(s)

Brenda Pardo, Leonardo Collado-Torres

Examples


if (enough_ram()) {
    ## Download the sce data
    sce <- fetch_data("sce")
    ## Transform it to a SpatialExperiment object
    spe <- sce_to_spe(sce)
}

LieberInstitute/spatialLIBD documentation built on April 21, 2024, 6:47 p.m.