REVISE
REVISE (REconstruction via Vision-integrated Spatial Estimation) reconstructs Spatially-inferred Virtual Cells (SVCs) from spatial transcriptomics data and a matched single-cell RNA-seq reference. Spatial or morphology-derived priors can be used when available.
Quick start
REVISE supports Python 3.10 and 3.11. A clean environment is recommended.
Create an environment with uv or conda
With uv:
uv venv --python 3.11
source .venv/bin/activate
Or with conda:
conda create -n revise python=3.11 -y
conda activate revise
Install REVISE:
pip install revise-svc
Choose the application template that matches the ST data:
| ST data | Template | REVISE route |
|---|---|---|
| Xenium T-cell data | configs/application/Xenium_T.yaml |
sc-SVC |
| Xenium fibroblast data | configs/application/Xenium_Fib.yaml |
sc-SVC |
| Xenium mono/macro data | configs/application/Xenium_Mono.yaml |
sc-SVC |
| Visium HD bins or pseudo-cells | configs/application/VisiumHD.yaml |
sp-SVC |
| Visium or another multi-cell spot assay | configs/application/Visium.yaml |
sc-SVC-sr |
These files are present in a source checkout. With a package-only installation,
copy the selected file from the packaged revise.application/templates
resource into your project with Python's standard importlib.resources, edit
the copy, and pass its local path to --config (see the
installation guide). A bare official template
name first uses configs/application/<name>.yaml in the launch directory and
then falls back to the packaged resource.
Edit the selected YAML before running it. The fields you normally change are
paths.root_dir, the exact ST/reference paths, optional reference
filter_column/filter_value, preprocessing thresholds, annotation columns,
and output.dir/output.name. The three Xenium files describe the same Xenium
assay with different reconstruction targets: T, Fibroblast, or
Mono_Macro. Confirm that the selected label exists in the full reference
obs column. Visium HD and Visium expose only local_refinement.strength.
Visium's 0.0 still runs LR; it only disables assignment-posterior
strengthening of the LR cost. The official Xenium templates filter the shared
reference with Patient == P2CRC; the key names are generic and may describe a
different reference cohort field in a custom YAML.
From a source checkout, run the YAML directly:
python reconstruct.py --config configs/application/VisiumHD.yaml
After installation, the installed command revise-reconstruct is the
equivalent entry name:
revise-reconstruct --config configs/application/VisiumHD.yaml
The three routes publish:
output/sp_SVC_case/P1CRC/sp_SVC.h5ad
output/visium_mouse_brain_revise/REVISEVisiumMouseBrain_sc-SVC-sr.h5ad
Standard sc-SVC publishes its two reconstruction carriers separately:
output/P2CRC_Xenium/T/spatial.h5ad
output/P2CRC_Xenium/T/expr.h5ad
The associated provenance.json keeps the application YAML identity under
application_config (source_path, source_sha256, root and resolved paths,
effective request/hash, and action). Top-level engine_defaults_hash,
authority_hash, algorithm_config_hash, and effective_config_hash identify
the package engine authority and resolved run. reconstruct.py
is the canonical Application implementation, and the installed
revise-reconstruct command points to its same main() implementation.
What does each template reconstruct?
| Your ST data | Typical platform and input rows | Route | What REVISE reconstructs |
|---|---|---|---|
| hST-like high-resolution sequencing data | Visium HD; each row is a bin or pseudo-cell | sp-SVC |
Reference-annotated expression with spatial refinement for the retained high-resolution units |
| iST imaging-based data | iST-like segmented-cell inputs, such as Xenium, CosMx, or MERFISH | sc-SVC |
Segmented-cell positions combined with reference-informed cell-state refinement and gene completion |
| sST spot-based data | Visium; each row is a multi-cell spot | sc-SVC-sr |
Reference-informed virtual-cell expression and cell-type composition within each spot |
sc-SVC-sr does not by itself infer true sub-spot cell positions. When the ST
H5AD contains segmentation-derived cell centers, REVISE uses them. Virtual
cells without a supplied center remain at their source spot center.
Application YAML inputs and AnnData requirements
Set inputs.st.path and inputs.reference.path explicitly. paths.root_dir: . means the launch current
working directory, not the application YAML directory; otherwise it must be an
existing absolute directory. Input and output values are relative children of
that root and cannot escape it with ... Package code in
revise.config.authority owns engine defaults and routing.
- Both inputs must have non-empty
X, uniqueobs_names, uniquevar_names, and at least one shared gene. - The ST input must contain finite two-dimensional coordinates in
obsm["spatial"]. - Every route requires
global_anchoring.broad_columnin referenceobs. Only standardsc-SVCaccepts and requireslocal_refinement.subtype_column.sc-SVC-srcomposition and expression allocation use the broad assignment. - A reference
filter_columnandfilter_valuemust be provided together or both omitted. When present, filtering runs before the spatial and reference count/gene preprocessing steps. - For sST inputs with segmentation-derived centers, the optional
uns["revise_cell_locations"]table uses uniquecell_idvalues as its index and containsspot_name,x, andy. Its cell IDs must agree withuns["all_cells_in_spot"];x/ymust use the same coordinate system and scale asobsm["spatial"]. Missing centers fall back to the spot center. The optional score matrix can be provided with the exactinputs.pm_on_cell.path. Its axes must exactly equal the active virtual-cell IDs and normalized cell types; values must be finite and within[0, 1]. REVISE reorders exact axes but does not clip or normalize PM. Without that field, coordinates are retained while cell types are assigned to the existing rows by a seeded random permutation of each spot's inferred quota.
SpatialData and algorithm controls
ST format accepts h5ad, spatialdata, or auto; the reference remains
H5AD. SpatialData table and spatial-element selections live under
inputs.st.spatialdata.table and inputs.st.spatialdata.element. REVISE does
not expose a coordinate-conversion promise through this entry point.
execution.seed and algorithm.ot_method are optional. The latter controls
both GA and LR; omitting it keeps the selected engine profile authoritative.
Standard sc-SVC defaults to TACCO and requires the tacco extra; REVISE never
changes solvers automatically. Unknown or route-inapplicable application
fields are errors; the engine YAML and generic key/value overrides are not
public application controls.
Source installation, optional capabilities, and development setup
To install the current repository source:
git clone https://github.com/wuys13/REVISE.git
cd REVISE
pip install .
The base package contains reconstruction, the POT implementation, clustering, and the core scientific stack. Install additional capabilities only when needed:
| Capability | Installation | Purpose |
|---|---|---|
| Standard sc-SVC default solver | pip install "revise-svc[tacco]" |
Installs TACCO 0.5.0, required by the default standard sc-SVC route |
| Pathway analysis | pip install "revise-svc[pathway]" |
Dependencies used by pathway analysis notebooks |
| Cell-cell interaction analysis | pip install "revise-svc[cci]" |
Dependencies used by CCI notebooks; databases and reference resources are prepared separately |
| Trajectory analysis | pip install "revise-svc[trajectory]" |
Dependencies used by trajectory analysis notebooks |
| SpatialData input | pip install "revise-svc[spatialdata]" |
SpatialData/Zarr input support |
For optional groups from a source checkout, replace revise-svc with .. For
development:
pip install -e ".[dev]"
Installation does not download research data or external analysis databases.
Detailed documentation: https://revise-svc.readthedocs.io/en/latest/
What REVISE Covers
Sim2Real-ST benchmarks six confounding factors across spatial transcriptomics platform types:
- Spatially heterogeneous factors: image segmentation artifacts and bin-to-cell assignment errors.
- Spatially homogeneous factors: spot size, batch effect, gene panel limitation, and gene dropout.
Confounding factors that limit current spatial transcriptomics technologies
REVISE reconstructs three complementary SVC types:
sp-SVC: spatial refinement for high-resolution spatial transcriptomics.sc-SVC: molecular completion and cell-state refinement for imaging-based spatial transcriptomics.sc-SVC-sr: spot-level super-resolution reconstruction.
Overview of the REVISE framework
Application output names are declared in YAML. sp-SVC and sc-SVC-sr publish:
<output-dir>/<output-name>.h5ad
If output.name is omitted, a single-output route uses svc.h5ad.
sc-SVC publishes <output-name>_spatial.h5ad and
<output-name>_expr.h5ad; without output.name it uses spatial.h5ad and
expr.h5ad. The run's
provenance.json records each result role together with the resolved route,
configuration, inputs, stages, and artifacts.
Reproduce
Paper datasets and reproduced results are available from
https://zenodo.org/records/17705737. The repository keeps benchmark launchers
and curated notebooks under reproduce/; see
reproduce/README.md for the entry-point map.
Run the Sim2Real-ST benchmarks
From a source checkout, run one confounding family:
python reproduce/benchmark_main.py \
--config configs/benchmark/segmentation.yaml \
--data-root raw_data/Sim2Real-ST \
--sample-name P2CRC/cut_part1 \
--dataset-task segmentation \
--evaluate true \
--output-root output/benchmark
Supported values are segmentation, bin2cell, batch_effect, spot_size,
gene_panel, and gene_dropout. Run the bounded multi-family launcher with:
bash reproduce/benchmark_main.sh
The analysis notebooks are under reproduce/benchmark/.
Open the application and downstream-analysis notebooks
Biological insights enabled by SVC reconstruction
Application reconstruction and downstream-analysis notebooks are under
reproduce/case/. Some require the optional pathway,
cci, or trajectory installation groups and their corresponding external
reference resources.
Reproduction scope and validation status
The notebooks preserve the paper workflows, but their presence does not mean that the current source checkout has rerun every real-data analysis. Real-data end-to-end validation remains a separate release step. Installation does not download the paper datasets, reproduced results, or external analysis databases.
Python API
Run the reconstruction pipeline from Python
from reconstruct import run_application
spatial_svc = run_application("configs/application/VisiumHD.yaml")
spatial, expression = run_application("configs/application/Xenium_T.yaml")
# sp-SVC and sc-SVC-sr return one AnnData; sc-SVC returns this fixed pair.
Application callers provide one YAML. REVISEPipeline.run() remains the
engine-level interface used by Benchmark and advanced integrations; it is not
the Application configuration API. Benchmark execution continues to use the
separate cf selector for its confounding family.
Repository Layout
Show the top-level repository structure
revise/: installable reconstruction and analysis package.reproduce/: benchmark launchers and benchmark/application notebooks.docs/: detailed user and method documentation.logo/,png/: public project and scientific figures.tests/: behavioral, scientific-contract, packaging, and CLI tests..github/: continuous integration.constraints/: tested Python 3.10/3.11 dependency constraints.
License
REVISE is released under the MIT License. Third-party datasets and notebook resources may have separate terms.
Metadata
Release files for revise-svc 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| revise_svc-0.1.0.tar.gz | 155.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| revise_svc-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 343.4 kB
Release files / revise_svc-0.1.0.tar.gz
| Download URL | revise_svc-0.1.0.tar.gz |
|---|---|
| Size | 155.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82a67ed87a35540564d51d5eaedadc672c2cb550a99816e7f7ec8d115d463148
|
|
BLAKE2b-256 checksum How to use checksums |
5476fb957a2e6aaee538347397fb5a75d405cf6b01181da45731ccc7974e8d98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / revise_svc-0.1.0-py3-none-any.whl
| Download URL | revise_svc-0.1.0-py3-none-any.whl |
|---|---|
| Size | 187.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed6fab0339ad35d2eff3d18c1b3b638af67a124d22df3626066aeee842e0e705
|
|
BLAKE2b-256 checksum How to use checksums |
e382697dfd7a9bc6471ac7cee54314feb0b30a7e4193d147585946f89768d253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency log