SPARK: Spatially Resolved Transcriptomic Analysis

View source: R/SPARK.R

SPARKR Documentation

Spatially Resolved Transcriptomic Analysis

Description

SPARK is an efficient method to identify spatially-variable genes.

Usage

SPARK(abs.expr, spots, size.factor, gene.name = NULL)

Arguments

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 NULL to keep the gene expression levels unnamed.

Details

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.

Value

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.

References

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.

See Also

get.size.factor() for obtaining the size factors; print.SPARK() for printing a summary of results to console.

Examples

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)

estfernan/boost documentation built on June 24, 2022, 12:20 a.m.