binSpect: Binary Spatial Extraction of Genes

View source: R/BinSpect.R

binSpectR Documentation

Binary Spatial Extraction of Genes

Description

BinSpect is a fast computational method that identifies spatially variable genes using the binarized expression levels.

Usage

binSpect(bin.expr, neighbor.info, do.fisher.test = FALSE, gene.name = NULL)

Arguments

bin.expr

A numeric vector p of length n that denotes the dichotomised gene expression levels. Each entry is one if the gene is highly expressed at spot i and zero otherwise.

neighbor.info

An n-by-K numeric matrix A that denotes the long format of the adjacency matrix. Each entry denotes the neighbor for spot i.

do.fisher.test

A logical value that indicates if the Fisher test should be used. The default value is FALSE to use a normal approximation test.

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 uses a graph-based approach to compute the probability of encountering two physically neighboring cells being both highly-expressed (=1). It is based on the provided neighborhood information, which can be interpreted as a graph structure. Based on the dichotomised gene expression levels, an edge in the "graph" connecting two cells is classified as 1-0, 1-1, 0-1, or 0-0. A contingency table that counts all the classified edges for the entire neighborhood network is created. A p-value is then reported based on the hypergeometric distribution test.

See http://spatialgiotto.rc.fas.harvard.edu/giotto_spatial_genes.html for more information.

Value

binSpect returns an object of class "binSpect". The function base::print() i.e., print.binSpect(), can be used to print a summary of the results.

An object of class "binSpect" 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 contingency table of low-expressed and highly-expressed interactions.

measures

the estimated odds ratio and corresponding p-value.

time

the execution time of the function.

References

Dries, R., Zhu, Q., Dong, R. et al. Giotto: a toolbox for integrative analysis and visualization of spatial expression data. Genome Biol 22, 78 (2021). https://doi.org/10.1186/s13059-021-02286-2

See Also

binarize.st() for dichotomising the expression levels; get.neighbors() for getting the neighborhood information.

Examples

library(boost)

## load sample dataset
data(mob)

## extract a sample gene, dichotomise expression levels, and get spatial network
g <- binarize.st(mob, "Apoe", cluster.method = "GMC")
A <- get.neighbors(mob.spots, 4, method = "distance")

## run the statistical test
res <- binSpect(g, A, do.fisher.test = FALSE, gene.name = "Apoe")
print(res)

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