Description Usage Arguments Details Value Examples
Clustering to identify major cell types as input for nnSVG
1 2 3 4 5 | clusterSVG(
spe,
assay_name = c("binomial_deviance_residuals", "logcounts"),
filter_mito = TRUE
)
|
spe |
|
assay_name |
|
filter_mito |
|
Convenience function to perform clustering to identify major cell types as
input for nnSVG. Cluster labels representing major cell types generated by
this function can be provided to nnSVG
as a matrix of covariates to
include them within the statistical model. nnSVG
will then identify
spatially variable genes (SVGs) after taking variation due to major cell
types into account.
Alternatively, cell types can be identified using manually guided analyses or
a different clustering algorithm, or nnSVG
can also be run without
taking cell types into account (x = NULL
).
The most appropriate type of analysis (i.e. whether or not to take into account variation due to cell types) will depend on the biological context of your dataset.
Returns a SpatialExperiment
object with cluster labels stored
in a column in colData
, which can then be extracted and provided to
nnSVG
as a matrix of covariates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(SpatialExperiment)
library(STexampleData)
spe <- Visium_humanDLPFC()
# subset genes for faster runtime in this example
set.seed(123)
spe <- spe[sample(seq_len(1000)), ]
# set seed for reproducibility
set.seed(123)
spe <- preprocessSVG(spe)
# set seed for reproducibility
set.seed(123)
spe <- clusterSVG(spe)
# show results
colData(spe)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.