This function computes cell embedding using the CAESAR framework with FAST for dimensionality reduction and spatial adjacency weights. It integrates variable feature selection and spatial adjacency information to generate low-dimensional representations for cells.
cellembedding_seurat(
seu,
adjm,
assay = NULL,
slot = "data",
nfeatures = 2000,
q = 50,
reduction.name = "caesar",
var.features = NULL,
...
)
The modified Seurat object with the co-embedding results (cell and gene embeddings) stored in the specified dimensional reduction slot.
A Seurat object. The Seurat object should contain gene expression data and be preprocessed with variable features identified.
A spatial adjacency matrix representing the relationships between cells or spots in spatial transcriptomic data.
A character string specifying which assay to use from the Seurat object. If NULL, the function will use the default assay.
The data slot to use for feature extraction (e.g., "data", "counts"). Default is "data".
The number of features to select for analysis. Default is 2000.
An integer specifying the number of dimensions for the reduced embeddings. Default is 50.
A character string specifying the name for the dimensional reduction. Default is "caesar".
A vector of variable features (genes) to use for the embedding. If NULL, the function will use variable features stored in the Seurat object.
Additional arguments passed to `FAST_run`.
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)
seu <- cellembedding_seurat(
seu = seu,
adjm = adjm
)
print(seu)
Run the code above in your browser using DataLab