ScGeo
Geometry-aware analysis of single-cell representations
Published study: Liu Y-C, Yoshida K (2026). Bioinformatics Advances, 6(1), vbag266. Read the paper.
Quick start | API reference | Reproducibility | Companion workflows
1. What ScGeo is
ScGeo is an installable Python library for quantifying perturbation-associated geometry in low-dimensional single-cell representations. It organizes robust state displacement, biological-sample uncertainty, representation stability, local geometry, dynamics agreement, abundance, and distributional change as separate evidence layers.
Start with the framework overview, then follow the quick start.
2. What ScGeo is not
ScGeo is not a batch-correction or integration algorithm, and it does not make cells into biological replicates. It does not make UMAP a quantitative coordinate system, turn agreement among nested PCA dimensions into independent confirmation, or convert descriptive geometry into causal evidence. ScGeo uses standard geometric and statistical primitives; its contribution is the auditable framework that connects those primitives across evidence layers.
3. Core analysis layers
| Layer | Main question | Typical output |
|---|---|---|
| Robust shift | How far and in what direction did a state move? | displacement, normalized effect, direction stability |
| Sample uncertainty | Is the shift stable across biological samples? | sample bootstrap interval and coverage |
| Representation stability | Does the conclusion persist across prespecified representations? | consensus status and sensitivity diagnostics |
| Local geometry | Are neighborhoods and local shapes preserved? | overlap, Jaccard, and distortion metrics |
| Dynamics agreement | Does displacement align with an available dynamics estimate? | aligned, discordant, neutral, or unavailable evidence |
| Abundance and distribution | Did composition or within-state shape also change? | separate proportions and distribution distances |
See Analysis layers for estimands and interpretation.
4. Installation
Use a fresh environment (Python 3.12 recommended). Install the development package directly from GitHub; no manual clone or Git installation is needed:
python -m pip install "scgeo @ https://github.com/liuifrec/scgeo/archive/refs/heads/main.zip"
For a conda-managed environment with Scanpy and an IPython kernel:
conda env create -f https://raw.githubusercontent.com/liuifrec/scgeo/main/environment-user.yml
conda activate scgeo
The conda environment installs ScGeo with pip after installing its scientific
stack from conda-forge. This is not yet an advertised conda install scgeo
channel release. A bare pip install scgeo requires a verified PyPI release;
the commands above deliberately identify this repository instead.
The default package includes geometry and plotting dependencies. Optional
scanpy, scvelo, census, and notebook extras install workflow-specific
packages. See Installation for examples, developer
installs, smoke checks, and local native conda builds.
The frozen package checkpoint used for the major-revision evidence package is
9a0ed16.
Use its recorded environment to reproduce the paper; a current development
installation does not replace that environment.
5. Minimal sample-aware example
The biological sample identifier belongs in adata.obs; it should identify an
independently sampled unit rather than a cell, condition, or artificial
partition.
import scgeo as sg
sg.tl.robust_shift(
adata,
rep="X_pca",
condition_key="condition",
group0="control",
group1="treated",
by="cell_type",
sample_key="donor",
n_boot=500,
)
sg.tl.representation_stability(
adata,
reps=["X_pca", "X_scvi"],
node_key="cell_type",
condition_key="condition",
group0="control",
group1="treated",
sample_key="donor",
)
report = sg.get.state_report(adata, node_key="cell_type")
sg.pl.state_evidence_panel(report)
Required fields and expected outputs are listed in Quick start.
6. How to interpret results
Read effect size, uncertainty, representation stability, local geometry, and
coverage together. stable_effect, stable_neutral,
representation_unstable, and insufficient_coverage describe evidence under
the stored rules; they are not interchangeable with population-level causal
claims. Bootstrap magnitude intervals summarize resampling uncertainty around a
nonnegative norm and are not automatically null-hypothesis tests.
See Result interpretation for status-specific language and warnings.
7. Representation robustness
Representations must be prespecified as primary or sensitivity views. Related PCA20, PCA30, and PCA50 views share a basis and should not be counted as three independent confirmations. UMAP should ordinarily remain display-only. Condition mixing is a descriptive diagnostic when condition is biological, not an integration objective. See Analysis layers.
8. Synthetic validation
The scgeo.bench module provides controlled simulations for effect magnitude,
abundance, distributional shape, local distortion, representation stability,
uncertainty, and geometry–dynamics agreement. Calibration and held-out seeds are
kept separate, and frozen thresholds are not automatically tuned by the suite.
The balanced_replicate_heterogeneity scenario uses random sample offsets that
are zero-centered within condition and is intended to test uncertainty without a
systematic condition shift. The separate batch_condition_confounding scenario
applies a systematic sample/batch offset correlated with condition and is
non-identifiable without additional design information.
Synthetic results validate behavior under their stated perturbations and failure modes; they do not establish biological truth. The frozen protocol is documented in BENCHMARK_PROTOCOL.md.
9. Public validation
Public-data workflows live in the companion repository. They cover the public pancreatic-development workflow; GSE249479, a public human HSPC inflammatory xenograft dataset with no recoverable biological-replicate identity; and GSE211713, a public mouse-lung radiation dataset with 20 independent mouse libraries. The GSE211713 analysis is replicate-aware and cross-sectional, not longitudinal. Their inference scopes are not interchangeable. See Companion notebooks.
10. Reproducibility and companion repository
The library code is maintained here. Source notebooks, execution wrappers,
figure assembly, evidence ledgers, and ignored large artifacts are maintained
in scgeo-notebooks. Source
notebooks are kept output-free; executed review copies are generated locally.
See Reproducibility and the generated API reference.
11. Limitations
- Geometry depends on the chosen representation and its coverage.
- Biological-sample inference requires genuine independent sample identifiers.
- Abundance, displacement, and distributional change answer different questions.
- Dynamics agreement depends on the assumptions of the supplied dynamics model.
- Weak reference support is an unsupported-state warning, not general out-of-distribution detection.
- Public validations cannot establish causality beyond their experimental design.
12. Citation
If you use ScGeo, please cite the published paper:
Liu Y-C, Yoshida K. ScGeo reveals non-canonical trajectories beyond RNA velocity in radiation-induced hematopoietic recovery. Bioinformatics Advances. 2026;6(1):vbag266. doi:10.1093/bioadv/vbag266.
@article{Liu2026ScGeo,
author = {Liu, Yu-Chen and Yoshida, Kengo},
title = {{ScGeo} reveals non-canonical trajectories beyond {RNA} velocity in radiation-induced hematopoietic recovery},
journal = {Bioinformatics Advances},
year = {2026},
volume = {6},
number = {1},
pages = {vbag266},
doi = {10.1093/bioadv/vbag266},
url = {https://doi.org/10.1093/bioadv/vbag266}
}
Machine-readable citation metadata is provided in CITATION.cff.
For reproducibility, also report the exact package commit or tag, analysis configuration, and environment. The article DOI identifies the paper, not a separately archived software release. See Reproducibility for the documented frozen analysis checkpoint and provenance requirements.
Metadata
Release files for scgeo 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 | Provenance | Actions |
|---|---|---|---|---|
| scgeo-0.1.0.tar.gz | 225.5 kB | With provenance | Details for scgeo-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scgeo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for scgeo-0.1.0-py3-none-any.whl |
Total release size: 400.0 kB
Release files / scgeo-0.1.0.tar.gz
| Download URL | scgeo-0.1.0.tar.gz |
|---|---|
| Size | 225.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87928f91cd5ecbe06347e5ea9f290602030e0af2a7f7a3fd831daaf488cea175
|
|
BLAKE2b-256 checksum How to use checksums |
ec7d821411c600b725d506a15b80c88e9bb70e633fbcda1c45d260c8f0a970a4
|
| 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 Oct 15, 2026.
Transparency logRelease files / scgeo-0.1.0-py3-none-any.whl
| Download URL | scgeo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 174.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16c85ba42c66fe75404966daedd4b7595369f7221017167ce29e4cfdca5d45e3
|
|
BLAKE2b-256 checksum How to use checksums |
2188a1a9a73eada384bbc1c7e00d8dde3831cb6076b80f8016c7d941bbf66081
|
| 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 Oct 15, 2026.
Transparency logSecurity for scgeo 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for scgeo-0.1.0.tar.gz
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 Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.