cellembedding_matrix | R Documentation |
This function computes low-dimensional cell embeddings from a gene-by-cell matrix. The method initializes cell embeddings using approximate PCA and refines them through a linear factor model nested a intrinsical conditional autoregressive model.
cellembedding_matrix(X, adjm, q = 50, reduction.name = "caesar", ...)
X |
A gene-by-cell matrix (e.g., the 'data' slot from a Seurat object) that serves as the input data for dimensional reduction. |
adjm |
A spatial adjacency matrix representing the relationships between cells or spots in spatial transcriptomic data. |
q |
An integer specifying the number of dimensions to reduce to. Default is 50. |
reduction.name |
A character string specifying the name of the dimensional reduction method. Default is 'caesar'. |
... |
Additional parameters passed to 'ProFAST::FAST_run'. |
A matrix containing the computed cell embeddings. The number of rows corresponds to the number of cells, and the number of columns corresponds to the specified number of dimensions ('q').
FAST_run
for the main FAST dimensionality reduction algorithm.
data(toydata)
seu <- toydata$seu
pos <- toydata$pos
adjm <- ProFAST::AddAdj(as.matrix(pos), radius.upper = 200)
X <- Seurat::GetAssayData(object = seu, slot = "data", assay = "RNA")
cellembedding <- cellembedding_matrix(
X = X,
adjm = adjm
)
print(cellembedding[1:3, 1:3])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.