revise.backend.runners.sp_svc_application.SpSVC
- class revise.backend.runners.sp_svc_application.SpSVC(st_adata, sc_ref_adata, config, logger)[source]
Bases:
ApplicationSVCsp-SVC class for application usage.
This class reconstructs single-cell resolution expression profiles from spatial transcriptomics data using optimal transport-based graph aggregation for each cell type.
- __init__(st_adata, sc_ref_adata, config, logger)[source]
Initialize BaseSVCAnchor.
- Parameters:
st_adata – Spatial transcriptomics AnnData object
sc_ref_adata – Single-cell reference AnnData object
config – Configuration object containing method parameters
real_st_adata – Ground truth spatial data (for benchmarking, can be None)
logger – Logger instance for logging
Methods
__init__(st_adata, sc_ref_adata, config, logger)Initialize BaseSVCAnchor.
global_anchoring(*args, **kwargs)Annotate spatial spots using the configured annotation method.
Reconstruct single-cell resolution expression profiles.
- local_refinement()[source]
Reconstruct single-cell resolution expression profiles.
This method performs the following steps: 1. Trims spatial data by removing low-expression genes 2. For each cell type, constructs an adjacency graph 3. Uses optimal transport to find neighbor relationships 4. Aggregates neighbor expressions using graph-based smoothing 5. Optionally generates UMAP plots for visualization
The reconstructed data is stored in self.svc[“sp_svc”].
- _umap_plot(adata, prefix)[source]
Generate UMAP visualization plots.
- Parameters:
adata – AnnData object to plot
prefix – Prefix string for output file names
This method performs preprocessing (filtering, normalization, PCA), computes clustering at multiple resolutions, and generates UMAP and spatial scatter plots saved to the result directory.