A previous release had provenance metadata, but this release does not. View details.
SIGMA (sigma-omics)
SIGMA resolves pathological metabolic transitions with interface-aware spectral graph learning.
SIGMA takes a spatial metabolomics intensity matrix and tissue coordinates as its primary inputs. Pathological annotations, transferred labels, or weak spatial anchors guide interface inference. Its spectral graph model separates low-frequency tissue organization from interface-associated metabolic signals.
Matched spatial transcriptomic data can optionally provide auxiliary molecular information and support downstream biological validation and interpretation. SIGMA returns an inferred pathological interface, signed-distance coordinates, interface-associated metabolic programs, ranked metabolites, influence ranges, and directional anisotropy.
Install
After the first PyPI release:
pip install sigma-omics
The distribution name is sigma-omics; the Python import remains
sigma_spatial.
Install from source
pip install -e .
Quick start
import scanpy as sc
from sigma_spatial import run_sigma
adata = sc.read_h5ad("sample.h5ad")
result = run_sigma(
adata,
anchor_key="sigma_anchor", # 1=tumor, 0=non-tumor, NaN=unknown
representation_key="X_harmony", # validated auxiliary representation
random_state=0,
)
# Main outputs
result.obs[["sigma_region_probability", "sigma_boundary", "sigma_d_signed"]]
For an unfamiliar input, inspect the declared modality before choosing a workflow:
from sigma_spatial import inspect_input
assessment = inspect_input(adata) # uses var['feature_type']: SM, ST, or both
assessment.print_report()
SM-only data are routed to the explicitly anchored weak-anchor workflow; joint SM+ST data use SM as the target and an ST representation for auxiliary alignment. ST-only data may be used for interface/signature validation, but SIGMA does not label ST-only outputs as metabolic programs.
Reproduce a reference dataset
Reference data releases contain the core AnnData, frozen feature ranking, and frozen program assignment table. These are all required because re-clustering a ranking is not guaranteed to preserve manuscript cluster identities.
import scanpy as sc
from sigma_spatial import run_reference_analysis
adata = sc.read_h5ad("HBC515_SIGMA_core.h5ad")
report = run_reference_analysis(
adata,
dataset="HBC515",
ranking_path="BC515_lambda_ranking.csv",
assignments_path="BC515_metabolic_program_assignments.csv",
output_dir="results/HBC515_reference",
)
The preset fixes the manuscript matrix source, program, distance windows, and
random seed. A frozen representative table can additionally be supplied with
representatives_path= when a manuscript panel used a curated final display
set.
Generate the downstream result set
For a new user, the recommended entry point is the combined workflow:
import sigma_spatial as sigma
sigma.assess_input(adata).print_report()
result = sigma.run_analysis(
adata,
output_dir="results/sample_01",
prefix="sample_01",
workflow="auto",
evidence={"same_section_pathology": True},
report_level="standard",
program_selection="auto",
random_state=0,
)
print(result.workflow)
print(result.downstream.leading_program)
For scientific safety, workflow="auto" reads existing provenance or requires
explicit evidence. It does not infer the annotation source from whichever
workflow gives the strongest result. Supported evidence flags are
same_section_pathology, matched_st, adjacent_section_pathology, and
region_defined.
report_level controls plotting without changing numerical analysis:
none: tables and provenance only;standard: program patterns, profiles, lollipop, and representative metabolites;complete: standard report plus influence-range and anisotropy panels;manuscript: publication-layout report with the complete diagnostics.
After SIGMA has produced a signed-distance field, one call discovers the metabolic programs and writes the standard figures and tables:
from sigma_spatial import run_downstream_analysis
report = run_downstream_analysis(
result,
"results/sample_01",
prefix="sample_01",
selection_mode="lambda_profile",
workflow="direct_pathology", # one of the four evidence workflows
signature_scores=None, # optional matched-ST score arrays
)
print(report.leading_program)
print(report.representatives[["mz", "cluster"]])
The report includes spatial program maps, signed-distance profiles, two-sided near-versus-far interface statistics, five representative metabolite maps, and directional anisotropy. When independent ST signature scores are provided, it additionally creates the program-signature heatmap and ST interface-enrichment plot. The downstream call does not refit the SIGMA model.
Every downstream run also writes a program-selection table and diagnostic plot. The default selection is workflow-aware: direct, multi-omics-inferred and transferred-pathology analyses preserve their validated near-versus-far rule, whereas named disease-region analyses use a two-stage boundary-localized rule. The latter first requires positive near-versus-far enrichment with controlled FDR and then selects the eligible program with the strongest median feature-level interface support. ST signatures are validation-only and never participate in program selection.
The command-line interface generates the same standard report:
sigma-omics report sample.h5ad results/sample \
--workflow auto \
--region-defined \
--report-level manuscript \
--seed 0
workflow is selected once from direct_pathology, multiomics_inferred,
transferred_pathology, or region_defined_disease. Each workflow has one
fixed lambda-profile preset shared by its samples; users do not tune thresholds
separately for every section. For sparse signed-distance grids, SIGMA can
deterministically reduce the number of bins and records both the requested and
effective bin counts. The exact preset is saved beside every result.
For exact reproduction of a frozen manuscript analysis, set
selection_mode="reference" and pass its frozen final ranking table. If the
manuscript program was selected using dataset-specific biological criteria,
also pass leading_program=<frozen cluster>; otherwise the leading program is
selected automatically from the two-sided near-versus-far analysis. The JSON
summary records both the automatic result and any explicit reference override.
Reproduce the manuscript figure set
The Python wheel contains the versioned orchestration and frozen program manifest. Large AnnData objects, histology images and other reference inputs remain in the SIGMA reference-data project rather than the PyPI wheel. Once the complete project and reference data are available, reproduce Figures 2–8 and their associated supplementary outputs with:
sigma-omics write-manuscript-manifest manuscript-v1.json
sigma-omics reproduce-manuscript /path/to/SIGMA-Code-Clean
To rebuild only selected figures:
sigma-omics reproduce-manuscript /path/to/SIGMA-Code-Clean \
--figures Fig3 Fig8
The manuscript manifest freezes seed 0 and the validated leading programs, including Cd1 P3, Cd2 P2 and Cd3 P1. Reproduction mode does not re-select a different manuscript program when cluster identifiers are already frozen.
For SM-only data, use the separately validated HCC-derived entry point:
from sigma_spatial import run_sigma_weak_anchor
result = run_sigma_weak_anchor(
adata,
anchor_key="sigma_anchor",
already_log=True,
random_state=0,
)
This path preserves the executed HCC P1/P4 loss without introducing an RNA
target. See docs/input_format.md and docs/output_schema.md.
Scope
The package contains reusable SIGMA computation and standardized downstream
reporting. Manuscript-specific simulation, benchmarking, GO enrichment, and
sample-specific interpretation remain under examples/ or the analysis
repository.
Metadata
Release files for sigma-omics 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sigma_omics-0.3.0.tar.gz | 454.4 kB | Without provenance | Details for sigma_omics-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sigma_omics-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for sigma_omics-0.3.0-py3-none-any.whl |
Total release size: 526.3 kB
Release files / sigma_omics-0.3.0.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | sigma_omics-0.3.0.tar.gz |
|---|---|
| Size | 454.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e39ff9eac17a20b40bb1bc5e7cfb30fbc1364ffb18e24f5d40497bc6310887da
|
|
BLAKE2b-256 checksum How to use checksums |
06415dff75a079439d212120bd8dbebf7d01a0a0f6cda8d3d46e4a7177536ede
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Release files / sigma_omics-0.3.0-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | sigma_omics-0.3.0-py3-none-any.whl |
|---|---|
| Size | 71.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f710c18458efa43c9389c9bc6d303b93a5880430c04f40c14421bc1b70442e8c
|
|
BLAKE2b-256 checksum How to use checksums |
7346f670b8d7413f0d77d93147038015e15138be86dba42461b450078c3e16dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Security for sigma-omics 0.3.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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 0.2.1 2 files With provenance
- Added 0.3.0 2 files Without provenance
A 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.