SPARK | R Documentation |
SPARK is an efficient method to identify spatially-variable genes.
SPARK(abs.expr, spots, size.factor, gene.name = NULL)
abs.expr |
A numeric vector p of length n that denotes the absolute gene expression levels. Each entry is an integer that denotes the gene count at spot i. |
spots |
An n-by-2 numeric matrix T to represent the geospatial profile, where each row indicates the spot location in the grid. |
size.factor |
A numeric vector s of length n to compute the relative gene expression levels. Each entry denotes the size factor of sample i that captures all nuisance effects. |
gene.name |
A character string that specifies the name of the gene
passed. To be used when storing the results. The default value is |
This method directly models count data generated from various spatial resolved transcriptomic techniques through generalized spatial linear models. It relies on penalized quasi-likelihood algorithm for scalable computation and recently developed statistical formulas for hypothesis testing, providing effective control of type I errors and yielding high statistical power.
See https://xzhoulab.github.io/SPARK/ for more information.
SPARK
returns an object of class "SPARK
".
The function base::print()
i.e., print.SPARK()
can be used to
print a summary of the results.
An object of class "SPARK
" is a list containing the following components:
call |
the function call in which all of the specified arguments are specified by their full names. |
model |
the name of statistical model or technique. |
gene.name |
the name of gene evaluated. |
summary |
a summary table that contains the p-values for the different tests. |
measures |
the combined p-value. |
time |
the execution time of the function. |
Sun, S., Zhu, J. & Zhou, X. Statistical analysis of spatial expression patterns for spatially resolved transcriptomic studies. Nat Methods 17, 193–200 (2020). https://doi.org/10.1038/s41592-019-0701-7.
get.size.factor()
for obtaining the size factors;
print.SPARK()
for printing a summary of results to console.
library(boost) ## load sample dataset data(mob) ## estimate the size factor and extract one sample gene s <- get.size.factor(mob, estimation.method = "TSS") g <- mob[, "Apoe"] ## run the statistical test res <- SPARK(g, mob.spots, s, gene.name = "Apoe") print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.