spatialPatterns {spatialDE} | R Documentation |
Group spatially variable genes into spatial patterns using Automatic Expression Histology, using the SpatialDE Python package.
spatialPatterns(x, de_results, ...) ## S4 method for signature 'matrix' spatialPatterns( x, de_results, coordinates, qval_thresh = 0.05, n_patterns, length, verbose = FALSE ) ## S4 method for signature 'SpatialExperiment' spatialPatterns( x, de_results, qval_thresh = 0.05, n_patterns, length, assay_type = "counts", verbose = FALSE )
x |
A numeric Alternatively, a SpatialExperiment object. |
de_results |
|
... |
For the generic, arguments to pass to specific methods. |
coordinates |
A For the SpatialExperiment method, coordinates are taken from
|
qval_thresh |
|
n_patterns |
|
length |
|
verbose |
A |
assay_type |
A |
A list
of two data.frame
s (pattern_results, patterns):
pattern_results
: data.frame
with pattern membership information for each
gene.
patterns
the posterior mean underlying expression from genes in given
spatial patterns.
Davide Corso, Milan Malfait, Lambda Moses
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.
The individual steps performed by this function: stabilize()
,
regress_out()
and spatial_patterns()
.
## Mock up a SpatialExperiment object wit 100 cells, 200 genes set.seed(42) spe <- mockSVG(size = 10, tot_genes = 200, de_genes = 20, return_SPE = TRUE) ## Run spatialDE de_results <- spatialDE(spe) spatial_patterns <- spatialPatterns(spe, de_results = de_results, qval_thresh = NULL, n_patterns = 4L, length = 1.5, verbose = FALSE ) head(spatial_patterns$pattern_results) head(spatial_patterns$patterns)