SpatialExperiment: The SpatialExperiment class

Description Usage Arguments Value Author(s) Examples

View source: R/AllClasses.R

Description

The SpatialExperiment class is designed to represent 10x Visium spatial Gene Expression data. It inherits from the SingleCellExperiment class and is used in the same manner. In addition, the class supports the integration with 10x Visium spatial coordinates and its scale factors.

Usage

1

Arguments

...

arguments to be passed to the SingleCellExperiment constructor to fill the slots of the base class.

spatialCoords

the spatial coordinates

Value

none

Author(s)

Dario Righelli

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## building random seqFISH data coordinates
fishCoordinates <- data.frame(Cell_ID=paste0("cell",c(1:30)),
                Irrelevant=100,
                x=sample(c(-4000:4000), size=30, replace=TRUE),
                y=sample(c(-4000:4000), size=30, replace=TRUE))
## building random seqFISH cell labels
fishCellLabels <- data.frame(Cell_ID=paste0("cell",c(1:30)),
                             class="neuron",
                             classID=sample(c(0:5), size=30, replace=TRUE))
## building random seqFISH count matrix
fishCounts <- matrix(sample(0:100, size=(30*30), replace=TRUE),
                     nrow=30, ncol=30,
                     dimnames=list(paste0("gene",c(1:30)),
                                   paste0("cell",c(1:30))))
## creating SpatialExperiment object
se <- SpatialExperiment(rowData=rownames(fishCounts),
                        colData=fishCellLabels,
                        assays=SimpleList(counts=as.matrix(fishCounts)),
                        spatialCoords=fishCoordinates)

SpatialExperiment documentation built on Nov. 8, 2020, 7:35 p.m.