Skip to content

epistasis-v2

epistasis-v2 is a high-performance Python library for fitting epistatic interactions in genotype-phenotype maps (GPMs). It provides linear and nonlinear regression models, Bayesian sampling, and simulation utilities, all backed by Rust-accelerated kernels and a Walsh-Hadamard fast path that delivers up to 6,000x speedup over the previous generation at full interaction order.

Fitted epistatic coefficients colored by interaction order Fitted epistatic coefficients colored by interaction order

  • Quick Start


    Install the library and fit your first epistasis model in minutes.

    Quick Start

  • Installation


    Requirements, pip install, and build from source with Rust.

    Installation

  • Core Concepts


    Understand genotype-phenotype maps, epistasis, and design matrices.

    Core Concepts

  • Models


    Linear, regularized, nonlinear, and classifier epistasis models.

    Models

  • Simulation


    Generate synthetic GPMs with known epistatic coefficients.

    Simulation

  • Cross-Validation


    Evaluate model performance with k-fold and holdout validation.

    Cross-Validation

  • Bayesian Sampling


    Quantify parameter uncertainty with MCMC ensemble sampling.

    Bayesian Sampling

  • API Reference


    Complete reference for stats, fast paths, and exceptions.

    API Reference

Why epistasis-v2?

  1. Install

    pip install epistasis-v2
    
  2. Load your data

    Wrap your genotypes and phenotypes in a GenotypePhenotypeMap from gpmap-v2.

  3. Fit a model

    Choose a model (EpistasisLinearRegression, EpistasisLasso, or EpistasisNonlinearRegression), attach your GPM, and call .fit().

  4. Inspect coefficients

    Read fitted epistatic coefficients and standard errors from model.epistasis.values and model.epistasis.stdeviations.

Note

epistasis-v2 is currently in alpha: the public API may still change between minor versions. The ported modules, the Rust kernels, the FWHT fast path, the sparse Lasso/ElasticNet design-matrix path, the power/spline/monotonic nonlinear variants, and the full classifier set (logistic, LDA, QDA, Gaussian process, Gaussian mixture) are all shipped.