get.neighbors | R Documentation |
Obtain a long format of the adjacency matrix, specifically, for the geospatial profile of the spatial transcriptomics (ST) data.
get.neighbors(spots, n.neighbors, method = c("distance", "KNN"))
spots |
An n-by-2 numeric matrix T to represent the geospatial profile, where each row indicates the spot location in the grid. |
n.neighbors |
An integer value that denotes the number of neighbors or connectivity. See "Details" for more information. |
method |
An optional character string that specifies the method to obtain the neighboring spots. The default is "distance" to set a cutoff value. |
Generally, for 10X and ST data, the number of neighbors are 6 and 4, respectively. These values represent how the spots are arranged in a lattice. For example, 6 and 4 indicate a hexagonal and square tiling, respectively.
The neighboring spots are obtained by two possible methods, where the neighbors are obtained via a (1) distance threshold, which sets a cutoff value, or the (2) k-nearest neighbors algorithm, which chooses the closest neighbors in distance. Additionally, for method (1), a spot might not have a full connectivity.
See Jiang et al. (2021) for an introduction to the lattice grid system.
A numeric matrix that denotes the long format of the adjacency matrix. Each entry denotes the neighbor for spot i. If a spot does not have full connectivity, then the latest entry or entries are zero.
Jiang, X., Li, Q., & Xiao, G. (2021). Bayesian Modeling of Spatial Transcriptomics Data via a Modified Ising Model. arXiv preprint arXiv:2104.13957.
st.plot()
for plotting the expression levels and, hence, the lattice grid.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.