Predict Perturbation Attractor States
PredictAttractors.RdPerforms unsupervised discovery of terminal attractor states (sinks) within a simulated perturbation vector field. Mathematically, this function calculates the stationary distribution of the directed Markov transition matrix by finding the dominant left eigenvector. Cells with the highest stationary probabilities represent deep phenotypic basins where the perturbation trajectory naturally pools .
Usage
PredictAttractors(
seurat_obj,
perturbation_name,
graph,
output_name = "attractor_score",
quantile_threshold = 0.98,
return_seurat = TRUE
)Arguments
- seurat_obj
A Seurat object containing the required graphs.
- perturbation_name
Character. The base name of the simulated perturbation. The function expects to find a transition probability graph named
paste0(perturbation_name, '_tp')inseurat_obj@graphs.- graph
Character. The name of the K-Nearest Neighbors (KNN) graph stored in
seurat_obj@graphs(e.g., "RNA_nn") used to mask the transition probabilities.- output_name
Character. The column name used to store the resulting attractor scores in
seurat_obj@meta.data. Default is"attractor_score".- quantile_threshold
Numeric. The percentile threshold used to explicitly define which cells belong to the terminal sink state. Default is
0.98(top 2%).- return_seurat
Logical. If
TRUE, returns the updated Seurat object. IfFALSE, returns a list containing the numeric attractor scores and a character vector of the identified sink cells. Default isTRUE.