Learn R Programming

CAESAR.Suite (version 0.1.0)

cellembedding_seurat: Perform CAESAR embedding of Cells Using FAST with Spatial Weights

Description

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.

Usage

cellembedding_seurat(
  seu,
  adjm,
  assay = NULL,
  slot = "data",
  nfeatures = 2000,
  q = 50,
  reduction.name = "caesar",
  var.features = NULL,
  ...
)

Value

The modified Seurat object with the co-embedding results (cell and gene embeddings) stored in the specified dimensional reduction slot.

Arguments

seu

A Seurat object. The Seurat object should contain gene expression data and be preprocessed with variable features identified.

adjm

A spatial adjacency matrix representing the relationships between cells or spots in spatial transcriptomic data.

assay

A character string specifying which assay to use from the Seurat object. If NULL, the function will use the default assay.

slot

The data slot to use for feature extraction (e.g., "data", "counts"). Default is "data".

nfeatures

The number of features to select for analysis. Default is 2000.

q

An integer specifying the number of dimensions for the reduced embeddings. Default is 50.

reduction.name

A character string specifying the name for the dimensional reduction. Default is "caesar".

var.features

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`.

See Also

FAST_run for the main FAST dimensionality reduction algorithm.

Examples

Run this code
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