Skip to main content

Spatial isoform statistical modeling (SPLISOSM)

Project description

SPLISOSM — Spatial Isoform Statistical Modeling

PyPI version License: BSD-3-Clause Docs PyPI Downloads

SPLISOSM (SPatiaL ISOform Statistical Modeling, pronounced spliceosome) is a Python package for analyzing RNA-processing patterns in spatial transcriptomics (ST) data. It uses multivariate, kernel-based association tests to detect:

  1. Spatial variability (SV) of isoform usage, isoform expression, or gene expression across spatial locations; and
  2. Differential isoform usage (DU) against spatial covariates such as region annotations or RNA-binding-protein (RBP) expression, optionally conditioned on spatial autocorrelation.

overview

Built on the Hilbert–Schmidt Independence Criterion (HSIC), the tests are multivariate — each gene is summarized by a single p-value aggregated across all of its isoforms — and well-calibrated without permutation sampling.

Supported platforms & feature types

SPLISOSM is platform-agnostic. Confirmed-compatible data types include:

Data type Example platforms Feature
Long-read ST 10x Visium / Visium HD + ONT Full-length transcript isoform
Short-read 3′ ST 10x Visium / Visium HD (fresh-frozen), Slide-seqV2 TREND peak (alt. polyadenylation)
Short-read targeted ST 10x Visium (CytAssist) / Visium HD FFPE, Flex Exon/junction probe usage
In situ targeted ST 10x Xenium Prime 5K, 10x Atera Codeword (exon/junction probe)

SPLISOSM does not perform isoform quantification itself. See the Feature Quantification guide for per-platform preprocessing recipes and loaders in splisosm.io.

Choosing a model class

SPLISOSM exposes three entry-point classes with a shared setup_data → test_* → get_formatted_test_results lifecycle:

Class Best for Input SV DU
SplisosmNP Any geometry (irregular spots, single cells, segmented) AnnData
SplisosmFFT Regular grids (Visium HD, Xenium binned) — fastest SpatialData
SplisosmGLMM Parametric effect sizes via multinomial GLM/GLMM AnnData ⚠️ *

*SplisosmGLMM is calibrated for DU testing only; its SV test is conservative.

Decision tree:

Is your data on a REGULAR GRID (Visium HD, Xenium binned, etc.)?
├── YES →  SplisosmFFT  (fastest; requires SpatialData input)
└── NO  →  Interested in parametric effect sizes?
          ├── YES →  SplisosmGLMM  (GLM/GLMM; DU only)
          └── NO  →  SplisosmNP    (recommended default)

Installation

# stable release from PyPI
pip install splisosm

# or latest from GitHub
pip install git+https://github.com/JiayuSuPKU/SPLISOSM.git#egg=splisosm

Optional extras:

# SpatialData input support for SplisosmFFT, plus gpytorch/FINUFFT GP backends for DU
pip install "splisosm[sdata,gp]"

Quick start

from splisosm import SplisosmNP

model = SplisosmNP()
model.setup_data(
    adata,                         # AnnData of shape (n_spots, n_isoforms)
    spatial_key="spatial",         # adata.obsm key for coordinates
    layer="counts",                # raw isoform counts
    group_iso_by="gene_symbol",    # adata.var column grouping isoforms → gene
)

# Spatial variability of isoform usage (SVP genes)
model.test_spatial_variability(method="hsic-ir")
df_sv = model.get_formatted_test_results("sv", with_gene_summary=True)

# Differential usage vs. a covariate matrix (e.g. RBP expression), conditioned on space
model.setup_data(
    adata, spatial_key="spatial", layer="counts", group_iso_by="gene_symbol",
    design_mtx=covariates, covariate_names=cov_names,
    skip_spatial_kernel=True,      # DU-only: no CAR kernel needed
)
model.test_differential_usage(method="hsic-gp")
df_du = model.get_formatted_test_results("du")

SPLISOSM works with non-spatial / single-cell data too: pass adj_key pointing to an adata.obsp[...] neighborhood graph (e.g. "connectivities" from scanpy.pp.neighbors) in place of spatial_key.

For gene-level spatial variability as a drop-in for SPARK-X or Moran's I:

from splisosm.utils import run_hsic_gc
res = run_hsic_gc(gene_counts, coordinates)     # or run_hsic_gc(adata=adata, spatial_key="spatial")

See the Quick Start for the full-defaults reference and Statistical Methods for the underlying HSIC framework, CAR kernel, cumulant null approximations, GP backends, and the GLMM parametric alternative.

Documentation & tutorials

Change log

See the changelog for detailed release notes.

Reporting issues

Please file bugs and feature requests on the GitHub Issues page.

References

SplisosmNP and SplisosmGLMM are described in

Su, Jiayu, et al. “Mapping isoforms and regulatory mechanisms from spatial transcriptomics data with SPLISOSM.” Nature Biotechnology (2026): 1–12.

link to paper

The FFT-based acceleration of SplisosmFFT is described in

Su, Jiayu, et al. "On the consistent and scalable detection of spatial patterns." arXiv preprint arXiv:2602.02825 (2026).

link to preprint

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

splisosm-1.2.0.tar.gz (28.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

splisosm-1.2.0-py3-none-any.whl (188.1 kB view details)

Uploaded Python 3

File details

Details for the file splisosm-1.2.0.tar.gz.

File metadata

  • Download URL: splisosm-1.2.0.tar.gz
  • Upload date:
  • Size: 28.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for splisosm-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6b6b8a98b9c4b45c41efc7e9f88d5631e7c821790b6640546873785c0ab3cf5e
MD5 4175e782c4c6d346a758048dea5c5117
BLAKE2b-256 d9d67cec7dc7b16249d61e6d3bc60a52d7ae57d7b4e4b4500dd45d7274aa7dbe

See more details on using hashes here.

File details

Details for the file splisosm-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: splisosm-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 188.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for splisosm-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b5ce4f0162011de61f3c5b009e05cfd81302522c687a6047097df255a445d9f
MD5 985b00d71c8d183fa43a477cfd478312
BLAKE2b-256 16aa7421121b5a4fc6a1e7dbe9f93a80e4471f9a9df4d71fa296a517c9d951d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page