This function checks that the spe object has the appropriate structure.
For more details please check the vignette documentation.
A
SpatialExperiment-class
object. See fetch_data() for how to download some example objects or
read10xVisiumWrapper() to read in spaceranger --count output files and
build your own spe object.
A character() vector of variable names expected to
be present in colData(spe).
A character(1) specifying the type of spatial transcriptomics
data stored in spe. Supported options are:
"Visium"(Default) Expects pxl_col_in_fullres and
pxl_row_in_fullres as columns of spatialCoords(spe). Enables
image handling via the spatialData slot.
"Xenium"Expects x_centroid and y_centroid as columns
of spatialCoords(spe).
The input object if all checks are passed.
Other Check input functions:
check_modeling_results(),
check_sce(),
check_sce_layer()
if (enough_ram()) {
## Obtain the necessary data
if (!exists("spe")) spe <- fetch_data("spe")
## Check the object
check_spe(spe)
}
#> 2026-09-28 14:53:10.666643 loading file /github/home/.cache/R/BiocFileCache/e2d3506994e_Human_DLPFC_Visium_processedData_sce_scran_spatialLIBD.Rdata%3Fdl%3D1
#> class: SpatialExperiment
#> dim: 33538 47681
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(33538): ENSG00000243485 ENSG00000237613 ... ENSG00000277475
#> ENSG00000268674
#> rowData names(9): source type ... gene_search is_top_hvg
#> colnames(47681): AAACAACGAATAGTTC-1 AAACAAGTATCTCCCA-1 ...
#> TTGTTTCCATACAACT-1 TTGTTTGTGTAAATTC-1
#> colData names(69): sample_id Cluster ... array_row array_col
#> reducedDimNames(6): PCA TSNE_perplexity50 ... TSNE_perplexity80
#> UMAP_neighbors15
#> mainExpName: NULL
#> altExpNames(0):
#> spatialCoords names(2) : pxl_col_in_fullres pxl_row_in_fullres
#> imgData names(4): sample_id image_id data scaleFactor