revise.backend.runners.sp_svc_benchmark.SpSVC

class revise.backend.runners.sp_svc_benchmark.SpSVC(st_adata, sc_ref_adata, config, real_st_adata, logger)[source]

Bases: BenchmarkSVC

sp-SVC class for benchmark CFs: segmentation/bin2cell.

This class reconstructs single-cell resolution expression profiles from spatial transcriptomics data, with special handling for segmentation errors (diminishing, expanding, unchanged cells).

__init__(st_adata, sc_ref_adata, config, real_st_adata, 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, ...)

Initialize BaseSVCAnchor.

global_anchoring(*args, **kwargs)

Annotate spatial spots using the configured annotation method.

local_refinement()

Reconstruct expression profiles with segmentation-aware smoothing.

local_refinement()[source]

Reconstruct expression profiles with segmentation-aware smoothing.

  1. Evaluate segmentation errors and flag cells that need correction.

  2. Split each cell type into replace and candidate groups.

  3. Use optimal transport between the two groups to obtain smoothed expressions for the replace cells.

  4. Merge corrected and unchanged cells to form self.svc["sp_svc"].