scsplice 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. scsplice-2.0.0/.github/workflows/docs.yml +68 -0
  2. scsplice-2.0.0/.github/workflows/test.yml +51 -0
  3. scsplice-2.0.0/.github/workflows/wheels.yml +85 -0
  4. scsplice-2.0.0/.gitignore +63 -0
  5. scsplice-2.0.0/CHANGELOG.md +49 -0
  6. scsplice-2.0.0/CMakeLists.txt +53 -0
  7. scsplice-2.0.0/LICENSE +21 -0
  8. scsplice-2.0.0/NOTICE +18 -0
  9. scsplice-2.0.0/PKG-INFO +182 -0
  10. scsplice-2.0.0/README.md +117 -0
  11. scsplice-2.0.0/docs/assets/favicon-96x96.png +0 -0
  12. scsplice-2.0.0/docs/assets/favicon.ico +0 -0
  13. scsplice-2.0.0/docs/assets/favicon.svg +3 -0
  14. scsplice-2.0.0/docs/assets/logo.png +0 -0
  15. scsplice-2.0.0/docs/contributing.md +88 -0
  16. scsplice-2.0.0/docs/explanation/data-model.md +100 -0
  17. scsplice-2.0.0/docs/explanation/io-readers-and-data-layouts.md +513 -0
  18. scsplice-2.0.0/docs/getting-started.md +219 -0
  19. scsplice-2.0.0/docs/how-to/multi-modal-pipeline.md +165 -0
  20. scsplice-2.0.0/docs/how-to/multi-sample-ingestion.md +88 -0
  21. scsplice-2.0.0/docs/how-to/read-spatial-data-with-tissue-positions.md +146 -0
  22. scsplice-2.0.0/docs/how-to/recompute-m2-after-subsetting.md +54 -0
  23. scsplice-2.0.0/docs/index.md +69 -0
  24. scsplice-2.0.0/docs/reference/index.md +14 -0
  25. scsplice-2.0.0/docs/reference/io.md +24 -0
  26. scsplice-2.0.0/docs/reference/pp.md +12 -0
  27. scsplice-2.0.0/docs/reference/tl.md +12 -0
  28. scsplice-2.0.0/docs/release-notes.md +91 -0
  29. scsplice-2.0.0/docs/stylesheets/extra.css +364 -0
  30. scsplice-2.0.0/docs/tutorials/index.md +23 -0
  31. scsplice-2.0.0/docs/tutorials/quickstart.ipynb +205 -0
  32. scsplice-2.0.0/mkdocs.yml +136 -0
  33. scsplice-2.0.0/pyproject.toml +124 -0
  34. scsplice-2.0.0/src/_scsplice_cpp/CMakeLists.txt +48 -0
  35. scsplice-2.0.0/src/_scsplice_cpp/bindings.cpp +47 -0
  36. scsplice-2.0.0/src/_scsplice_cpp/deviance.cpp +150 -0
  37. scsplice-2.0.0/src/_scsplice_cpp/deviance.hpp +30 -0
  38. scsplice-2.0.0/src/_scsplice_cpp/make_m2.cpp +224 -0
  39. scsplice-2.0.0/src/_scsplice_cpp/make_m2.hpp +27 -0
  40. scsplice-2.0.0/src/_scsplice_cpp/pseudo_r2.cpp +299 -0
  41. scsplice-2.0.0/src/_scsplice_cpp/pseudo_r2.hpp +41 -0
  42. scsplice-2.0.0/src/scsplice/__init__.py +23 -0
  43. scsplice-2.0.0/src/scsplice/_core/__init__.py +1 -0
  44. scsplice-2.0.0/src/scsplice/_core/_split.py +66 -0
  45. scsplice-2.0.0/src/scsplice/_core/_validators.py +190 -0
  46. scsplice-2.0.0/src/scsplice/_settings.py +41 -0
  47. scsplice-2.0.0/src/scsplice/io/__init__.py +7 -0
  48. scsplice-2.0.0/src/scsplice/io/_starsolo.py +793 -0
  49. scsplice-2.0.0/src/scsplice/io/_starsolo_gene.py +552 -0
  50. scsplice-2.0.0/src/scsplice/io/_starsolo_velocyto.py +517 -0
  51. scsplice-2.0.0/src/scsplice/io/_whitelist.py +246 -0
  52. scsplice-2.0.0/src/scsplice/pl/__init__.py +3 -0
  53. scsplice-2.0.0/src/scsplice/pp/__init__.py +5 -0
  54. scsplice-2.0.0/src/scsplice/pp/_hve.py +176 -0
  55. scsplice-2.0.0/src/scsplice/py.typed +0 -0
  56. scsplice-2.0.0/src/scsplice/tl/__init__.py +6 -0
  57. scsplice-2.0.0/src/scsplice/tl/_make_m2.py +141 -0
  58. scsplice-2.0.0/src/scsplice/tl/_pseudo_correlation.py +160 -0
  59. scsplice-2.0.0/tests/conftest.py +117 -0
  60. scsplice-2.0.0/tests/data/.gitkeep +0 -0
  61. scsplice-2.0.0/tests/test_highly_variable_events.py +203 -0
  62. scsplice-2.0.0/tests/test_make_m2.py +137 -0
  63. scsplice-2.0.0/tests/test_pseudo_correlation.py +195 -0
  64. scsplice-2.0.0/tests/test_read_starsolo.py +483 -0
  65. scsplice-2.0.0/tests/test_read_starsolo_gene.py +438 -0
  66. scsplice-2.0.0/tests/test_read_starsolo_velocyto.py +357 -0
  67. scsplice-2.0.0/tests/test_settings.py +31 -0
  68. scsplice-2.0.0/tests/test_smoke.py +17 -0
  69. scsplice-2.0.0/tests/test_split.py +71 -0
  70. scsplice-2.0.0/tests/test_uns_compat_shim.py +203 -0
  71. scsplice-2.0.0/tests/test_validators.py +129 -0
@@ -0,0 +1,68 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ concurrency:
12
+ group: docs
13
+ cancel-in-progress: false
14
+
15
+ permissions:
16
+ contents: write
17
+
18
+ jobs:
19
+ build:
20
+ name: Build docs
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0 # full history required by mike
26
+
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: "3.12"
30
+ cache: pip
31
+
32
+ - name: Install Eigen3
33
+ run: sudo apt-get update && sudo apt-get install -y libeigen3-dev
34
+
35
+ - name: Install package and docs dependencies
36
+ run: pip install -e ".[docs]"
37
+
38
+ - name: Build docs (strict)
39
+ run: mkdocs build --strict
40
+
41
+ deploy:
42
+ name: Deploy to GitHub Pages
43
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
44
+ needs: build
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ fetch-depth: 0
50
+
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.12"
54
+ cache: pip
55
+
56
+ - name: Install Eigen3
57
+ run: sudo apt-get update && sudo apt-get install -y libeigen3-dev
58
+
59
+ - name: Install package and docs dependencies
60
+ run: pip install -e ".[docs]"
61
+
62
+ - name: Configure git identity for mike
63
+ run: |
64
+ git config user.name "github-actions[bot]"
65
+ git config user.email "github-actions[bot]@users.noreply.github.com"
66
+
67
+ - name: Deploy docs
68
+ run: mkdocs gh-deploy --force
@@ -0,0 +1,51 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ name: ${{ matrix.os }} / py${{ matrix.python-version }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, macos-latest]
17
+ python-version: ["3.10", "3.11", "3.12"]
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ uses: actions/setup-python@v5
24
+ with:
25
+ python-version: ${{ matrix.python-version }}
26
+
27
+ - name: Install Eigen (Linux)
28
+ if: runner.os == 'Linux'
29
+ run: sudo apt-get update && sudo apt-get install -y libeigen3-dev
30
+
31
+ - name: Install Eigen + libomp (macOS)
32
+ if: runner.os == 'macOS'
33
+ run: brew install eigen libomp
34
+
35
+ - name: Set OpenMP env (macOS)
36
+ if: runner.os == 'macOS'
37
+ run: |
38
+ LIBOMP_PREFIX="$(brew --prefix libomp)"
39
+ {
40
+ echo "OpenMP_ROOT=${LIBOMP_PREFIX}"
41
+ echo "LDFLAGS=-L${LIBOMP_PREFIX}/lib"
42
+ echo "CPPFLAGS=-I${LIBOMP_PREFIX}/include"
43
+ } >> "$GITHUB_ENV"
44
+
45
+ - name: Install package + test deps
46
+ run: |
47
+ python -m pip install --upgrade pip
48
+ python -m pip install ".[test]"
49
+
50
+ - name: Run tests
51
+ run: pytest -v --maxfail=1
@@ -0,0 +1,85 @@
1
+ name: wheels
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build_wheels:
10
+ name: Wheels on ${{ matrix.os }}
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, macos-latest]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: "3.12"
24
+
25
+ - name: Build wheels
26
+ uses: pypa/cibuildwheel@v2.21
27
+ env:
28
+ # manylinux_2_28 (RHEL/AlmaLinux 8) -> enable EPEL for eigen3-devel.
29
+ # Stock manylinux2014 does NOT ship EPEL by default and the prior
30
+ # `yum install eigen3-devel || dnf install eigen3-devel` failed on
31
+ # both. manylinux_2_28 is selected in pyproject.toml.
32
+ CIBW_BEFORE_ALL_LINUX: "dnf install -y epel-release && dnf install -y eigen3-devel"
33
+ # macOS: install eigen only. libomp is intentionally NOT installed
34
+ # because we disable OpenMP on macOS (SCSPLICE_DISABLE_OPENMP=ON in
35
+ # pyproject.toml [tool.cibuildwheel.macos]) — libomp discovery
36
+ # across x86_64/arm64 under cibuildwheel is too fragile and per-row
37
+ # writes are bit-identical to MT anyway.
38
+ CIBW_BEFORE_ALL_MACOS: "brew install eigen"
39
+
40
+ - uses: actions/upload-artifact@v4
41
+ with:
42
+ name: wheels-${{ matrix.os }}
43
+ path: ./wheelhouse/*.whl
44
+
45
+ build_sdist:
46
+ name: Source distribution
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - uses: actions/setup-python@v5
51
+ with:
52
+ python-version: "3.12"
53
+ - run: |
54
+ python -m pip install --upgrade pip build
55
+ python -m build --sdist
56
+ - uses: actions/upload-artifact@v4
57
+ with:
58
+ name: sdist
59
+ path: dist/*.tar.gz
60
+
61
+ publish:
62
+ # Upload to PyPI on version tags (v1.0.0, etc.)
63
+ # Requires that the PyPI project has a Trusted Publisher configured
64
+ # for this GitHub repository (https://docs.pypi.org/trusted-publishers/).
65
+ # No API tokens are stored in secrets.
66
+ name: Publish to PyPI
67
+ needs: [build_wheels, build_sdist]
68
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
69
+ runs-on: ubuntu-latest
70
+ permissions:
71
+ id-token: write
72
+
73
+ steps:
74
+ - uses: actions/download-artifact@v4
75
+ with:
76
+ path: dist
77
+ pattern: "wheels-*"
78
+ merge-multiple: true
79
+
80
+ - uses: actions/download-artifact@v4
81
+ with:
82
+ name: sdist
83
+ path: dist
84
+
85
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,63 @@
1
+ # Build artifacts
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ src/splikit/_version.py
6
+ *.so
7
+ *.dylib
8
+ *.pyd
9
+ *.o
10
+ *.a
11
+
12
+ # CMake
13
+ CMakeFiles/
14
+ CMakeCache.txt
15
+ CTestTestfile.cmake
16
+ cmake_install.cmake
17
+ _deps/
18
+ .cmake/
19
+
20
+ # Python
21
+ __pycache__/
22
+ *.py[cod]
23
+ *$py.class
24
+ .python-version
25
+ .venv/
26
+ venv/
27
+
28
+ # Test / coverage
29
+ .pytest_cache/
30
+ .coverage
31
+ .coverage.*
32
+ htmlcov/
33
+ coverage.xml
34
+ .tox/
35
+
36
+ # Type checkers
37
+ .mypy_cache/
38
+ .pyright/
39
+ .ruff_cache/
40
+
41
+ # IDE
42
+ .vscode/
43
+ .idea/
44
+ *.swp
45
+ *.swo
46
+
47
+ # OS
48
+ .DS_Store
49
+ Thumbs.db
50
+
51
+ # Docs
52
+ site/
53
+ docs/_build/
54
+ docs/api/
55
+ .cache/
56
+
57
+ tests/data/*.large.h5
58
+
59
+ # Notebooks
60
+ .ipynb_checkpoints/
61
+
62
+ # AI files
63
+ CLAUDE.md
@@ -0,0 +1,49 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.0.0] - 2026-05-11
9
+
10
+ ### Breaking Changes
11
+
12
+ - PyPI distribution renamed `splikit-py` → `scsplice`. Install with `pip install scsplice`.
13
+ - Python import alias changes: `import scsplice as scs` (was `import splikit as splk`).
14
+ - `uns["splikit"]` schema key renamed to `uns["scsplice"]`. A one-release compat shim reads the legacy key with a `FutureWarning` and migrates it automatically; will be removed in 3.0.
15
+ - `SPLIKIT_REAL_DATA_DIR` env var renamed to `SCSPLICE_REAL_DATA_DIR`. Old name accepted with `FutureWarning` for one release.
16
+ - C++ extension module renamed `_splikit_cpp` → `_scsplice_cpp`.
17
+
18
+ ### Added
19
+
20
+ - Compat shim in `scsplice._core._validators` (`get_scsplice_ns` / `setdefault_scsplice_ns`) for graceful migration of v1.0 AnnData objects carrying `uns["splikit"]`.
21
+ - `SCSPLICE_REAL_DATA_DIR` env var support in `tests/conftest.py` with fallback to `SPLIKIT_REAL_DATA_DIR` + `FutureWarning`.
22
+
23
+ [2.0.0]: https://github.com/Arshammik/scsplice/compare/v1.0.0...v2.0.0
24
+
25
+ ## [1.0.0] - 2026-05-11
26
+
27
+ ### Added
28
+
29
+ - `splk.io.read_starsolo` — Ingest STARsolo `Solo.out/SJ/` for one or more samples into a single AnnData with M1 (inclusion counts) in `layers["M1"]` and LJV grouping in `var["group_id"]`. Supports spatial data via optional `tissue_positions=` parameter.
30
+ - `splk.io.read_starsolo_gene` — Ingest `Solo.out/Gene/` gene-expression counts into a standard cell × gene AnnData with counts in `X`. Drop-in for `scanpy.pp.normalize_total` and `scvi-tools`. Supports `tissue_positions=` and populates `obsm["spatial"]` for Visium samples.
31
+ - `splk.io.read_starsolo_velocyto` — Ingest `Solo.out/Velocyto/` spliced/unspliced/ambiguous layers into an AnnData compatible with `scvelo`. Handles both modern (split-file) and legacy (stacked `matrix.mtx`) STARsolo wire formats.
32
+ - `scs.tl.make_m2` — Build the exclusion matrix M2 from M1 and LJV grouping via C++ kernel with optional OpenMP parallelism. Output is bit-exact with R splikit.
33
+ - `splk.tl.pseudo_correlation` — Per-event signed pseudo-R² (Cox-Snell or Nagelkerke) against an external predictor matrix via iteratively reweighted least squares (IRLS).
34
+ - `splk.pp.highly_variable_events` — Select highly variable splicing events per library using binomial-deviance scoring.
35
+ - `scsplice.settings` — Global settings object for configurable behavior (verbosity, I/O defaults).
36
+ - MkDocs Material documentation site with tutorials, how-to guides, API reference, and conceptual explanations.
37
+
38
+ ### Known Limitations
39
+
40
+ - `splk.pl` (plotting) is a v1.1 placeholder. Use `scanpy.pl`, `scvelo.pl`, and `squidpy` for downstream visualization.
41
+ - HVG (highly variable genes) and silhouette metrics are intentionally not ported — compose with `scanpy.pp.highly_variable_genes` and `sklearn.metrics.silhouette_score` instead.
42
+ - GTF annotation and gene-level plotting are out of scope; use `pyranges` for GTF operations.
43
+ - R-equivalence validation suite (cross-language regression tests, R fixtures, tolerance bands) lives on the [`validation` branch](https://github.com/Arshammik/scsplice/tree/validation), not main.
44
+
45
+ ### Internal Notes
46
+
47
+ This is the inaugural v1.0 PyPI release. The package has been tested for numerical equivalence with R splikit on a fixed reference dataset (M2 bit-exact; HVE deviance rtol=1e-10; pseudo-correlation rtol=1e-7). Production usage at scale is encouraged; please report bugs and feature requests on GitHub.
48
+
49
+ [1.0.0]: https://github.com/Arshammik/scsplice/releases/tag/v1.0.0
@@ -0,0 +1,53 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+
3
+ project(scsplice_cpp LANGUAGES CXX)
4
+
5
+ set(CMAKE_CXX_STANDARD 17)
6
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
+ set(CMAKE_CXX_EXTENSIONS OFF)
8
+
9
+ if(NOT CMAKE_BUILD_TYPE)
10
+ set(CMAKE_BUILD_TYPE Release)
11
+ endif()
12
+
13
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
14
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
15
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
16
+
17
+ # Optional build switch: skip OpenMP entirely (useful on macOS where libomp
18
+ # discovery from cibuildwheel is fragile — see wheels.yml).
19
+ option(SCSPLICE_DISABLE_OPENMP "Disable OpenMP even when CMake can find it" OFF)
20
+
21
+ # Find Python (Development.Module is the right component for pybind11_add_module)
22
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
23
+
24
+ # Make `cmake -S . -B build` work outside scikit-build-core by pointing
25
+ # pybind11's CMake config at the build-environment site-packages install.
26
+ # scikit-build-core sets pybind11_DIR itself, so a non-empty hint here is
27
+ # only used when invoking CMake directly.
28
+ if(NOT DEFINED pybind11_DIR OR pybind11_DIR STREQUAL "")
29
+ execute_process(
30
+ COMMAND ${Python_EXECUTABLE} -c "import pybind11; print(pybind11.get_cmake_dir())"
31
+ OUTPUT_VARIABLE _pybind11_cmake_dir
32
+ OUTPUT_STRIP_TRAILING_WHITESPACE
33
+ RESULT_VARIABLE _pybind11_lookup_result
34
+ )
35
+ if(_pybind11_lookup_result EQUAL 0 AND _pybind11_cmake_dir)
36
+ set(pybind11_DIR "${_pybind11_cmake_dir}" CACHE PATH "pybind11 CMake config dir")
37
+ message(STATUS "Discovered pybind11_DIR from Python: ${pybind11_DIR}")
38
+ endif()
39
+ endif()
40
+
41
+ # pybind11 from the Python site-packages of the build environment (scikit-build-core
42
+ # installs it at build time via [build-system].requires)
43
+ find_package(pybind11 CONFIG REQUIRED)
44
+
45
+ # Eigen3 (header-only); fail loudly if not found
46
+ find_package(Eigen3 NO_MODULE REQUIRED)
47
+
48
+ # OpenMP (optional); kernels degrade gracefully when absent.
49
+ if(NOT SCSPLICE_DISABLE_OPENMP)
50
+ find_package(OpenMP)
51
+ endif()
52
+
53
+ add_subdirectory(src/_scsplice_cpp)
scsplice-2.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Arsham Mikaeili Namini and the Computational and Statistical Genomics Laboratory, McGill University
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
scsplice-2.0.0/NOTICE ADDED
@@ -0,0 +1,18 @@
1
+ NOTICE
2
+
3
+ This software contains code ported from the R package splikit
4
+ (https://github.com/csglab/splikit), maintained by the Computational
5
+ and Statistical Genomics Laboratory, McGill University.
6
+
7
+ Ported components (from splikit/src/):
8
+ - make_m2_cpp.cpp → src/_scsplice_cpp/make_m2.cpp
9
+ - calcDeviances.cpp → src/_scsplice_cpp/deviance.cpp
10
+ - cpp_pseudoR2.cpp → src/_scsplice_cpp/pseudo_r2.cpp
11
+
12
+ The R splikit package is licensed under the MIT License.
13
+ For details, see https://github.com/csglab/splikit/blob/main/LICENSE.
14
+
15
+ Original R splikit authors:
16
+ CSG Laboratory (Computational and Statistical Genomics)
17
+ Department of Human Genetics
18
+ McGill University
@@ -0,0 +1,182 @@
1
+ Metadata-Version: 2.1
2
+ Name: scsplice
3
+ Version: 2.0.0
4
+ Summary: Single-cell alternative-splicing analysis on AnnData (Python port of R splikit)
5
+ Keywords: single-cell,splicing,scverse,anndata,scrna-seq
6
+ Author-Email: Arsham Mikaeili Namini <arsham.mikaeilinamini@mail.mcgill.ca>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 Arsham Mikaeili Namini and the Computational and Statistical Genomics Laboratory, McGill University
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Classifier: Development Status :: 4 - Beta
30
+ Classifier: Intended Audience :: Science/Research
31
+ Classifier: License :: OSI Approved :: MIT License
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: C++
37
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
38
+ Project-URL: Documentation, https://arshammik.github.io/scsplice/
39
+ Project-URL: Homepage, https://github.com/Arshammik/scsplice
40
+ Project-URL: Issues, https://github.com/Arshammik/scsplice/issues
41
+ Project-URL: Changelog, https://github.com/Arshammik/scsplice/blob/main/CHANGELOG.md
42
+ Project-URL: Source, https://github.com/Arshammik/scsplice
43
+ Requires-Python: >=3.10
44
+ Requires-Dist: anndata>=0.10
45
+ Requires-Dist: numpy>=2.0
46
+ Requires-Dist: scipy>=1.13
47
+ Requires-Dist: pandas>=2.2
48
+ Requires-Dist: h5py>=3.10
49
+ Provides-Extra: test
50
+ Requires-Dist: pytest>=8.0; extra == "test"
51
+ Requires-Dist: pytest-cov; extra == "test"
52
+ Requires-Dist: pytest-xdist; extra == "test"
53
+ Provides-Extra: docs
54
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
55
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
56
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
57
+ Requires-Dist: mkdocs-jupyter>=0.25; extra == "docs"
58
+ Requires-Dist: pymdown-extensions>=10.7; extra == "docs"
59
+ Requires-Dist: mike>=2.1; extra == "docs"
60
+ Provides-Extra: dev
61
+ Requires-Dist: scsplice[docs,test]; extra == "dev"
62
+ Requires-Dist: ruff; extra == "dev"
63
+ Requires-Dist: pre-commit; extra == "dev"
64
+ Description-Content-Type: text/markdown
65
+
66
+ # scsplice
67
+
68
+ Single-cell alternative-splicing analysis for the [scverse](https://scverse.org) ecosystem.
69
+
70
+ `scsplice` is the Python port of the R package [splikit](https://github.com/csglab/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`.
71
+
72
+ ## Status
73
+
74
+ v1.0. v1.0 scope is intentionally narrow:
75
+
76
+ - `scs.io.read_starsolo` — ingest STARsolo `Solo.out/SJ/` for one or more samples.
77
+ - `scs.tl.make_m2` — build the exclusion matrix from M1 + LJV grouping.
78
+ - `scs.pp.highly_variable_events` — per-library binomial-deviance HVE selection.
79
+ - `scs.tl.pseudo_correlation` — beta-binomial Cox-Snell / Nagelkerke pseudo-R² against an external matrix.
80
+
81
+ HVG, plotting, and silhouette utilities from the R package are intentionally omitted — `scanpy`, `pyranges`, and `sklearn` already cover those.
82
+
83
+ ## Installation
84
+
85
+ `scsplice` ships a C++ extension built via `scikit-build-core` + `pybind11`.
86
+ Eigen3 (header-only) is required at install time; OpenMP is optional but
87
+ strongly recommended for multi-threaded kernels.
88
+
89
+ ### From PyPI (once v2.0 is published)
90
+
91
+ ```bash
92
+ pip install scsplice
93
+ ```
94
+
95
+ ### From source
96
+
97
+ ```bash
98
+ git clone https://github.com/Arshammik/scsplice
99
+ cd scsplice
100
+ pip install .
101
+ ```
102
+
103
+ System dependencies before running `pip install`:
104
+
105
+ **Ubuntu / Debian**
106
+
107
+ ```bash
108
+ sudo apt install libeigen3-dev libomp-dev
109
+ ```
110
+
111
+ **macOS** (Homebrew)
112
+
113
+ ```bash
114
+ brew install eigen libomp
115
+ # tell CMake where Apple Clang's OpenMP lives
116
+ export OpenMP_ROOT="$(brew --prefix libomp)"
117
+ export LDFLAGS="-L${OpenMP_ROOT}/lib"
118
+ export CPPFLAGS="-I${OpenMP_ROOT}/include"
119
+ ```
120
+
121
+ **HPC cluster (Compute Canada / Sharcnet pattern)**
122
+
123
+ ```bash
124
+ module load eigen/3.4.0
125
+ # any modern GCC with OpenMP (gcc/12+) on the system module path
126
+ ```
127
+
128
+ ### Editable install (development)
129
+
130
+ ```bash
131
+ pip install -e ".[dev]"
132
+ ```
133
+
134
+ This installs the package, all test dependencies, the docs toolchain
135
+ (`mkdocs-material`, `mkdocstrings[python]`, `mkdocs-jupyter`), and `ruff` /
136
+ `pre-commit`. C++ edits require re-running `pip install -e .`; pure-Python
137
+ edits take effect immediately.
138
+
139
+ ## Quick start
140
+
141
+ ```python
142
+ import scsplice as scs
143
+ import scanpy as sc
144
+
145
+ # (1) Ingest STARsolo splice-junction counts (M1) and LJV grouping
146
+ adata = scs.io.read_starsolo(
147
+ sj_dirs=["sample1/Solo.out/SJ", "sample2/Solo.out/SJ"],
148
+ sample_ids=["s1", "s2"],
149
+ )
150
+
151
+ # (2) Build exclusion matrix (M2) from inclusion counts + junction grouping
152
+ scs.tl.make_m2(adata, n_threads=8)
153
+
154
+ # (3) Identify highly variable events per library using binomial deviance
155
+ scs.pp.highly_variable_events(adata, min_row_sum=50, n_threads=8)
156
+
157
+ # Optional: compose with scanpy on the splicing embedding
158
+ # (PCA / neighbors / leiden over logit(M1 / (M1 + M2)))
159
+ ```
160
+
161
+ ## Numerical equivalence
162
+
163
+ `scsplice` reproduces R `splikit` results to a documented tolerance on a
164
+ fixed reference dataset (M2 bit-exact; HVE deviance `rtol=1e-10`;
165
+ pseudo-correlation `rtol=1e-7`). The cross-language regression suite,
166
+ R reference fixtures, and end-to-end M1/M2 validation pipeline live on the
167
+ [`validation` branch](https://github.com/Arshammik/scsplice/tree/validation).
168
+
169
+ ## Documentation
170
+
171
+ Full documentation is available at https://arshammik.github.io/scsplice/.
172
+
173
+ Topics include:
174
+ - [Getting Started](https://arshammik.github.io/scsplice/getting-started/) — installation and first workflow
175
+ - [Tutorials](https://arshammik.github.io/scsplice/tutorials/) — step-by-step notebooks
176
+ - [How-to Guides](https://arshammik.github.io/scsplice/how-to-guides/) — recipes for common tasks
177
+ - [Reference](https://arshammik.github.io/scsplice/reference/) — complete API documentation
178
+ - [Explanation](https://arshammik.github.io/scsplice/explanation/) — conceptual background and design
179
+
180
+ ## License
181
+
182
+ MIT.