spatialDE: Find spatially variable genes with *SpatialDE*

spatialDER Documentation

Find spatially variable genes with SpatialDE

Description

Identify genes that significantly depend on spatial coordinates with the SpatialDE Python package.

Usage

spatialDE(x, ...)

## S4 method for signature 'matrix'
spatialDE(x, coordinates, verbose = FALSE)

## S4 method for signature 'SpatialExperiment'
spatialDE(x, assay_type = "counts", verbose = FALSE)

Arguments

x

A numeric matrix of counts where genes are rows and cells are columns.

Alternatively, a SpatialExperiment object.

...

For the generic, arguments to pass to specific methods.

coordinates

A data.frame with sample coordinates. Each row is a sample, the columns with coordinates should be named 'x' and 'y'.

For the SpatialExperiment method, coordinates are taken from spatialCoords(x).

verbose

A logical controlling the display of a progress bar from the Python package.

assay_type

A character string specifying the assay from x to use as input. Defaults to "counts".

Value

A data.frame with DE results where each row is a gene and columns contain relevant statistics.

The most important columns are:

  • g: the name of the gene

  • pval: the p-value for spatial differential expression

  • qval: the q-value, indicating significance after correcting for multiple testing

  • l: A parameter indicating the distance scale a gene changes expression over

Author(s)

Davide Corso, Milan Malfait, Lambda Moses

References

Svensson, V., Teichmann, S. & Stegle, O. SpatialDE: identification of spatially variable genes. Nat Methods 15, 343–346 (2018). https://doi.org/10.1038/nmeth.4636

SpatialDE 1.1.3: the version of the Python package used under the hood.

See Also

The individual steps performed by this function: stabilize(), regress_out() and run().

For further analysis of the DE results: model_search() and spatial_patterns().

Examples

## Mock up a SpatialExperiment object wit 400 cells and 3 genes
set.seed(42)
spe <- mockSVG(size = 20, tot_genes = 3, de_genes = 1, return_SPE = TRUE)

## Run spatialDE
de_results <- spatialDE(spe)

head(de_results)


sales-lab/spatialDE documentation built on Feb. 12, 2024, 2:47 p.m.