This function generates a similarity network (SN) for a given embeddings. Specifically, the function computes K-nearest neighbor (KNN) graphs based on the provided embedding.
Arguments
- emb
A matrix contains the embedding, with rows correspond to principal components (PCs) or features, and columns correspond to spatial neighborhoods.
- npcs
An integer specifying the number of principal components or features for the analysis. Default is 20.
- k
An integer specifying the number of nearest neighbors to consider when constructing the KNN graph. Default is 50.
