binSpect | R Documentation |
BinSpect is a fast computational method that identifies spatially variable genes using the binarized expression levels.
binSpect(bin.expr, neighbor.info, do.fisher.test = FALSE, gene.name = NULL)
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 |
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 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.
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. |
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
binarize.st()
for dichotomising the expression levels;
get.neighbors()
for getting the neighborhood information.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.