High-performance Python library for fitting high-order epistatic interactions in genotype-phenotype maps.
Project description
epistasis-v2
High-performance Python library for fitting high-order epistatic interactions in genotype-phenotype maps. A clean-break rewrite of harmslab/epistasis.
Status: alpha. Phase 1 port complete; Phase 2 Rust kernel and Phase 3 FWHT / sparse paths still to come.
What changed from v1
- Rust hot-path kernels via PyO3 (
epistasis._core) instead of a shipped Cython.cblob. uv+maturinbuild.pyproject.tomlonly; nosetup.py.- Python 3.10 through 3.13. Older interpreters dropped.
- Type hints on the public API;
mypy --strictin CI. - Composition over
@use_sklearnMRO injection. Concrete models hold an sklearn estimator as an attribute and forward calls explicitly, which unlocks modern sklearn (>=1.2) that broke the v1 trick whennormalize=was removed. - Walsh-Hadamard fast-path for Hadamard-encoded OLS fits (Phase 3, not yet landed).
- Sparse design matrix path for Lasso / ElasticNet at high order (Phase 3).
- Coordinated rewrite of the gpmap dependency as gpmap-v2. Consumes
binary_packed(uint8 2D) andencoding_tablewithsite_indexinstead of the deprecatedgenotype_index. - No backward compatibility with v1. Pin the v1 package if you need that behavior.
Repository layout
epistasis-v2/
├── pyproject.toml uv + maturin build, ruff + mypy + pytest config
├── Cargo.toml Rust workspace
├── python/epistasis/ Python source (installed as `epistasis`)
├── crates/epistasis-core/ Rust crate, exposed as `epistasis._core`
├── tests/ pytest suite
├── benches/ pytest-benchmark + criterion (Phase 2+)
├── docs/ Sphinx docs (Phase 5)
├── .github/workflows/ CI (lint, test, matrix) + release (semantic-release, maturin wheels, PyPI OIDC)
├── CHANGELOG.md generated by python-semantic-release
└── CONTRIBUTING.md commit conventions, dev workflow
Installation (dev)
Requires Python >= 3.10 and a Rust toolchain. gpmap-v2 is pulled from PyPI.
uv sync
uv run maturin develop --release
uv run pytest
For lint and type-check:
uv run ruff check .
uv run ruff format --check .
uv run mypy python/epistasis
Current progress
Phase 0 (scaffold) and Phase 1 (port) complete.
Ported modules:
epistasis.mapping(sites, coefficients,EpistasisMap)epistasis.matrix(encoded vectors, design matrix, NumPy backend)epistasis.exceptions(EpistasisError,XMatrixError,FittingError)epistasis.utils(genotypes_to_X)epistasis.models.base(AbstractEpistasisModel,EpistasisBaseModel)epistasis.models.linear(EpistasisLinearRegressionwith analytic coefficient standard errors,EpistasisRidge,EpistasisLasso,EpistasisElasticNet)epistasis.models.nonlinear(EpistasisNonlinearRegression,FunctionMinimizer;powerandsplinevariants deferred)epistasis.models.classifiers(EpistasisLogisticRegression; LDA, QDA, Gaussian Process, and GMM deferred)epistasis.simulate(simulate_linear_gpm,simulate_random_linear_gpm)epistasis.stats(Pearson, R^2, RMSD, SS residuals, AIC,split_gpm)epistasis.validate(k_fold,holdout)epistasis.sampling.bayesian(BayesianSamplervia emcee 3)
Pending:
- Rust kernels for
build_model_matrix,encode_vectors, FWHT fast path (Phase 2) - Sparse design matrix path for Lasso / ElasticNet (Phase 3)
power.pyandspline.pynonlinear variants- Remaining classifier implementations if demand surfaces
- ReadTheDocs build
Contributing
See CONTRIBUTING.md. Commits follow Conventional Commits; releases and the changelog are automated by python-semantic-release.
License
Unlicense (public domain). See UNLICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file epistasis_v2-1.0.0.tar.gz.
File metadata
- Download URL: epistasis_v2-1.0.0.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25fa4926109199722f128e59267a02ffa97847883f253a00aaed73e32e598f94
|
|
| MD5 |
d589b2a846cbdb3e0468c6de40df4f75
|
|
| BLAKE2b-256 |
ba589df4fea881338b38073e2e346904c2bb7f69ac75fe15a634ff4c9cfb0d58
|
Provenance
The following attestation bundles were made for epistasis_v2-1.0.0.tar.gz:
Publisher:
release.yml on lperezmo/epistasis-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epistasis_v2-1.0.0.tar.gz -
Subject digest:
25fa4926109199722f128e59267a02ffa97847883f253a00aaed73e32e598f94 - Sigstore transparency entry: 1340953183
- Sigstore integration time:
-
Permalink:
lperezmo/epistasis-v2@662b613102296b80e87a6d6af148ff6acc67eceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lperezmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@662b613102296b80e87a6d6af148ff6acc67eceb -
Trigger Event:
push
-
Statement type:
File details
Details for the file epistasis_v2-1.0.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: epistasis_v2-1.0.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 121.1 kB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
830dbceffefda48e41f23ecca79b4f1b7904f3cf5b6ef3fefbbb174390d0e93b
|
|
| MD5 |
3e0e4cd9d7ba9b1e66ddd9f09471dcb7
|
|
| BLAKE2b-256 |
e50cd13f0627f755dc90b7c3a6a49f1252e592d1c1c83fd7daf614500ef51a58
|
Provenance
The following attestation bundles were made for epistasis_v2-1.0.0-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on lperezmo/epistasis-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epistasis_v2-1.0.0-cp310-abi3-win_amd64.whl -
Subject digest:
830dbceffefda48e41f23ecca79b4f1b7904f3cf5b6ef3fefbbb174390d0e93b - Sigstore transparency entry: 1340953297
- Sigstore integration time:
-
Permalink:
lperezmo/epistasis-v2@662b613102296b80e87a6d6af148ff6acc67eceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lperezmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@662b613102296b80e87a6d6af148ff6acc67eceb -
Trigger Event:
push
-
Statement type:
File details
Details for the file epistasis_v2-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: epistasis_v2-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 237.5 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bed444f1b8888f753c42aedbc921259b0c6e396c40e94cb575417e6f7a17c75b
|
|
| MD5 |
32f2b6efbb641479b503aef89d1fbd04
|
|
| BLAKE2b-256 |
f54d3fbd831ed7bb3dc20dd4201d8361d1aeddedb551d3730bf2c380cdb3cd9c
|
Provenance
The following attestation bundles were made for epistasis_v2-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on lperezmo/epistasis-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epistasis_v2-1.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
bed444f1b8888f753c42aedbc921259b0c6e396c40e94cb575417e6f7a17c75b - Sigstore transparency entry: 1340953323
- Sigstore integration time:
-
Permalink:
lperezmo/epistasis-v2@662b613102296b80e87a6d6af148ff6acc67eceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lperezmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@662b613102296b80e87a6d6af148ff6acc67eceb -
Trigger Event:
push
-
Statement type:
File details
Details for the file epistasis_v2-1.0.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: epistasis_v2-1.0.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 219.0 kB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1608c80c1bf0a4ce55617d60eb89b80196d0ee77d77afa9765033a41ca024170
|
|
| MD5 |
02d8524229dee80eacd6d425d4ff9cee
|
|
| BLAKE2b-256 |
37c8a2e9e6854af37a43f0a64fe862a818798f77e4855806bea7da3059af865e
|
Provenance
The following attestation bundles were made for epistasis_v2-1.0.0-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on lperezmo/epistasis-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epistasis_v2-1.0.0-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
1608c80c1bf0a4ce55617d60eb89b80196d0ee77d77afa9765033a41ca024170 - Sigstore transparency entry: 1340953223
- Sigstore integration time:
-
Permalink:
lperezmo/epistasis-v2@662b613102296b80e87a6d6af148ff6acc67eceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lperezmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@662b613102296b80e87a6d6af148ff6acc67eceb -
Trigger Event:
push
-
Statement type:
File details
Details for the file epistasis_v2-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: epistasis_v2-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 224.9 kB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf28eb0859b8150822951c38546e0387dfe76c9b2b43b6c87760f5aa2bcef519
|
|
| MD5 |
8156a5ce886a357554c180f888de6210
|
|
| BLAKE2b-256 |
9e0de57d9f816fb5c3d26ee13a4394d2075abc80a3aaa7ed3711a40c6e32364a
|
Provenance
The following attestation bundles were made for epistasis_v2-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on lperezmo/epistasis-v2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epistasis_v2-1.0.0-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
cf28eb0859b8150822951c38546e0387dfe76c9b2b43b6c87760f5aa2bcef519 - Sigstore transparency entry: 1340953268
- Sigstore integration time:
-
Permalink:
lperezmo/epistasis-v2@662b613102296b80e87a6d6af148ff6acc67eceb -
Branch / Tag:
refs/heads/main - Owner: https://github.com/lperezmo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@662b613102296b80e87a6d6af148ff6acc67eceb -
Trigger Event:
push
-
Statement type: