Description Usage Arguments Details Value Examples
Run method to identify spatially variable genes (SVGs) using GpGp.
1 2 3 4 5 6 7 8 9 | runSVGsGpGp(
spe,
x = NULL,
fix_param_range = NULL,
n_neighbors = 15,
lr_test = TRUE,
n_threads = 1,
verbose = FALSE
)
|
spe |
|
x |
|
fix_param_range |
|
n_neighbors |
|
lr_test |
|
n_threads |
|
verbose |
|
Run method to identify spatially variable genes (SVGs) using GpGp (Guinness 2018).
This function runs GpGp separately for each gene, using parallelization for faster runtime using one core per GpGp run. The main outputs of interest are the covariance parameter estimates stored in 'covparms' in the GpGp output (for the 'exponential_isotropic' covariance function these are: variance, range, nugget). Optionally, the 'range' parameter (parameterized as 'phi' in other methods) can be fixed to a user-specified value, so that this parameter is the same for all genes. We also use the log-likelihood ('loglik' in GpGp output) to calculate likelihood ratio tests.
Note the parameterization used by GpGp: total variance = sigmasq + (tausq * sigmasq); i.e. the nugget is 'tausq * sigmasq', not 'tausq' itself as in many other methods.
Assumes the input object is a SpatialExperiment
containing an assay
named logcounts
, which has been filtered to exclude very low-expressed
genes, e.g. as prepared with preprocessSVGs
.
Returns output values stored as new columns in rowData
in the
spe
SpatialExperiment
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(SpatialExperiment)
library(STexampleData)
library(spatzli)
spe <- Visium_humanDLPFC()
spe <- preprocessSVGs(spe)
# subset 1 gene
spe_1 <- spe[1, ]
system.time({
spe_1 <- runSVGsGpGp(spe_1, verbose = TRUE)
})
# subset 100 genes and use parallelization
# spe_100 <- spe[1:100, ]
# spe_100 <- runSVGsGpGp(spe_100, n_threads = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.