Skip to main content

scsplice

PyPI Python versions License: MIT Tests Docs

Single-cell alternative-splicing analysis for the scverse ecosystem.

scsplice is the Python port of the R package splikit. It analyses splice-junction count data in single-cell RNA-seq, treating each event as a pair of inclusion (M1) and exclusion (M2) counts derived from local junction variants (LJVs). The package is AnnData-native — junctions live on the var axis, M1 and M2 sit in layers, and downstream analysis composes naturally with scanpy.

Status

v2.0.1 keeps a deliberately focused API:

  • scs.io.read_starsolo — ingest STARsolo Solo.out/SJ/ for one or more samples.
  • scs.tl.make_m2 — build the exclusion matrix from M1 + LJV grouping.
  • scs.pp.highly_variable_events — per-library binomial-deviance HVE selection.
  • scs.io.read_starsolo_gene — read raw or filtered gene counts, including STARsolo EM matrices.
  • scs.tl.pseudo_correlation — beta-binomial Cox-Snell / Nagelkerke pseudo-R² with event-wise permutation inference.
  • scs.tl.get_pseudo_correlation_result — materialize export-ready statistics and long null tables.

HVG, plotting, and silhouette utilities from the R package are intentionally omitted — scanpy, pyranges, and sklearn already cover those.

Installation

scsplice ships a C++ extension built via scikit-build-core + pybind11. Eigen3 (header-only) is required at install time; OpenMP is optional but strongly recommended for multi-threaded kernels.

From PyPI

pip install scsplice

From source

git clone https://github.com/Arshammik/scsplice
cd scsplice
pip install .

System dependencies before running pip install:

Ubuntu / Debian

sudo apt install libeigen3-dev libomp-dev

macOS (Homebrew)

brew install eigen libomp
# tell CMake where Apple Clang's OpenMP lives
export OpenMP_ROOT="$(brew --prefix libomp)"
export LDFLAGS="-L${OpenMP_ROOT}/lib"
export CPPFLAGS="-I${OpenMP_ROOT}/include"

HPC cluster (Compute Canada / Sharcnet pattern)

module load eigen/3.4.0
# any modern GCC with OpenMP (gcc/12+) on the system module path

Editable install (development)

pip install -e ".[dev]"

This installs the package, all test dependencies, the docs toolchain (mkdocs-material, mkdocstrings[python], mkdocs-jupyter), and ruff / pre-commit. C++ edits require re-running pip install -e .; pure-Python edits take effect immediately.

Quick start

import numpy as np
import scsplice as scs
import scanpy as sc

# (1) Ingest STARsolo splice-junction counts (M1) and LJV grouping
adata = scs.io.read_starsolo(
    sj_dirs=["sample1/Solo.out/SJ", "sample2/Solo.out/SJ"],
    sample_ids=["s1", "s2"],
)

# (2) Build exclusion matrix (M2) from inclusion counts + junction grouping
scs.tl.make_m2(adata, n_threads=8)

# (3) Identify highly variable events per library using binomial deviance
scs.pp.highly_variable_events(adata, min_row_sum=50, n_threads=8)

# (4) Compute pseudo-correlation with the 100-permutation default
# zdb must be events × cells and aligned to adata.var_names / adata.obs_names
zdb = np.random.default_rng(42).normal(size=(adata.n_vars, adata.n_obs))
scs.tl.pseudo_correlation(adata, zdb, seed=42, n_threads=8)
result = scs.tl.get_pseudo_correlation_result(adata)
result.statistics.to_csv("pseudo_correlation_statistics.csv", index=False)
result.null_distribution.to_csv("pseudo_correlation_null.csv", index=False)

# Optional: compose with scanpy on the splicing embedding
# (PCA / neighbors / leiden over logit(M1 / (M1 + M2)))

Gene-expression ingestion defaults to raw STARsolo counts, preferring UniqueAndMult-EM.mtx and falling back to matrix.mtx, then independently applies the internal filtered-barcode whitelist. Use matrix_source="filtered" to read the filtered matrix directly or matrix_source="auto" for the scsplice 2.0.0 source-selection behavior.

Numerical equivalence

scsplice reproduces R splikit results to a documented tolerance on a fixed reference dataset (M2 bit-exact; HVE deviance rtol=1e-10; pseudo-correlation rtol=1e-7). The cross-language regression suite, R reference fixtures, and end-to-end M1/M2 validation pipeline live on the validation branch.

Documentation

Full documentation is available at https://arshammik.github.io/scsplice/.

Topics include:

License

MIT.

Download files

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

Source Distribution

scsplice-2.0.1.tar.gz (978.5 kB view details)

Uploaded Source

Built Distributions

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

scsplice-2.0.1-cp312-cp312-manylinux_2_28_x86_64.whl (267.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

scsplice-2.0.1-cp312-cp312-macosx_11_0_arm64.whl (136.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

scsplice-2.0.1-cp312-cp312-macosx_10_15_x86_64.whl (142.8 kB view details)

Uploaded CPython 3.12macOS 10.15+ x86-64

scsplice-2.0.1-cp311-cp311-manylinux_2_28_x86_64.whl (265.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

scsplice-2.0.1-cp311-cp311-macosx_11_0_arm64.whl (135.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

scsplice-2.0.1-cp311-cp311-macosx_10_15_x86_64.whl (141.5 kB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

scsplice-2.0.1-cp310-cp310-manylinux_2_28_x86_64.whl (264.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

scsplice-2.0.1-cp310-cp310-macosx_11_0_arm64.whl (134.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

scsplice-2.0.1-cp310-cp310-macosx_10_15_x86_64.whl (140.4 kB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

File details

Details for the file scsplice-2.0.1.tar.gz.

File metadata

  • Download URL: scsplice-2.0.1.tar.gz
  • Upload date:
  • Size: 978.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scsplice-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0d0e0f3d504801281d4b6e1b28ac729771d08d9f68031676d6a9e22068eea78b
MD5 62d7b4d9327057ff72522b995fcbfcd3
BLAKE2b-256 819970cd2abdb4a39f0a0dd2b29af8496ae622b769b288ad83f9468f959eb614

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1.tar.gz:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 99f306105eb983d1ff2a94b5d1218f8e96def4c907529e49d4697c5e9dd3a08a
MD5 53c751554440974e9d4b1f4b340459f9
BLAKE2b-256 7ebcce77d6c45abd65505425e6cc3cb8195511112f0a6054e9e5329f46a214a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 795c93e92c9c09ac787ebab9267705149239a0a014e962bc3a496d055acbd2a5
MD5 dec188213b3f1de7a8fb6fbfef6f0f3c
BLAKE2b-256 dea573dc7bc056cd73032a1ab7ad0fa3845352a7e0bcebce906c92796820c558

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp312-cp312-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 46d7e146a325bad0182e24d3439b58d1def852f0608463ea500b9ead6b0d7c7d
MD5 789c2f6d882211309ad62c513724dbfb
BLAKE2b-256 2ee2c70fa592f53a0ac0ef67b8db255ec5f80e26bf5b44653fc682242e495db9

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp312-cp312-macosx_10_15_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fa9425689b2a561176a697e9fc2681fbda188dbef11adf838097c0574582f418
MD5 e3439c1ff6d74fcf839ba744596c2726
BLAKE2b-256 ad719d734cd555fdf735ef31a50faf27c44c87c281289ce33c324cb952ca4775

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dadf78eb2f1485a9a2864840ca35b9a76eb5e06a0af451a8cc9ebb61a8d7fa00
MD5 9b1a6b4fa0511da69bcf7c8f8b921981
BLAKE2b-256 e05e9e10b31722b9acfb4d43cefd941f17d8d0bfa0be39fb18854d2201852c4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ba7d20381279a982274889bb5e57b62b1b8e34dc365206eb6c68cc3bc548148d
MD5 e06a212f2ed089638b7d0e86e41c6e09
BLAKE2b-256 588c10c71705a2789a8430e28d52702c8e970e6b608cd447a54dcac21c4f8ff5

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp311-cp311-macosx_10_15_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea62744df2b2ff5a7e0f6da1bb988896c19254e8469097f8dd2924b2c5af8402
MD5 90fec995569cfd0f372a38903d6ce38d
BLAKE2b-256 40d3846feda54de0ded5683e05f7d3fb05b666cdb071632a58c757ef1ba1a45b

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 594ae338cf23fefbf6cb1963b91170ab4da519a2623cb585545bb8db64c2f01b
MD5 43aabcc6be806ea6578fbea15d08c751
BLAKE2b-256 030af5d87b66d006b9acc3cb19fea5946dfc7abe5b216c947692736b493948bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scsplice-2.0.1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for scsplice-2.0.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2818ec3e3a1ae7df3e7835ba133ebaf06c37a31e45d1f365f42c0029b45fe5ad
MD5 c8e617dae8dd47da66241f4c5422fd5b
BLAKE2b-256 95cc9e54cc4ccee6b3d84417d515ac2598d9711f0200976af9bbdab57c1547c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for scsplice-2.0.1-cp310-cp310-macosx_10_15_x86_64.whl:

Publisher: wheels.yml on Arshammik/scsplice

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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