modelSearch: Classify Spatially Variable Genes to interpretable fitting...

modelSearchR Documentation

Classify Spatially Variable Genes to interpretable fitting classes

Description

Compare model fits with different models, using the SpatialDE Python package.

Usage

modelSearch(x, de_results, ...)

## S4 method for signature 'matrix'
modelSearch(x, de_results, coordinates, qval_thresh = 0.05, verbose = FALSE)

## S4 method for signature 'SpatialExperiment'
modelSearch(
  x,
  de_results,
  assay_type = "counts",
  qval_thresh = 0.05,
  verbose = FALSE
)

Arguments

x

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

Alternatively, a SpatialExperiment object.

de_results

data.frame resulting from run() or spatialDE().

...

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).

qval_thresh

numeric scalar, specifying the q-value significance threshold to filter de_results. Only rows in de_results with qval < qval_thresh will be kept. To disable, set qval_thresh = NULL.

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

data.frame of model_search results.

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 model_search().

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 with S4 integration
de_results <- spatialDE(spe)

## Run model search
model_search <- modelSearch(spe, de_results = de_results,
    qval_thresh = NULL, verbose = FALSE
)


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