Skip to main content

Epistasis

Join the chat at https://gitter.im/harmslab/epistasis Binder Documentation Status Tests DOI

Python API for estimating statistical, high-order epistasis in genotype-phenotype maps.

All models follow a Scikit-learn interface and thus seamlessly plug in to the PyData ecosystem. For more information about the type of models included in this package, read our docs. You can also read more about the theory behind these models in our paper.

Finally, if you'd like to test out this package without any installing, try these Jupyter notebooks here (thank you Binder!).

Examples

The Epistasis package works best in combinations with GPMap, an API for managing genotype-phenotype map data. Construct a GenotypePhenotypeMap object and pass it directly to an epistasis model.

# Import a model and the plotting module
from gpmap import GenotypePhenotypeMap
from epistasis.models import EpistasisLinearRegression
from epistasis.pyplot import plot_coefs

# Genotype-phenotype map data.
wildtype = "AAA"
genotypes = ["ATT", "AAT", "ATA", "TAA", "ATT", "TAT", "TTA", "TTT"]
phenotypes = [0.1, 0.2, 0.4, 0.3, 0.3, 0.6, 0.8, 1.0]

# Create genotype-phenotype map object.
gpm = GenotypePhenotypeMap(wildtype=wildtype,
                           genotypes=genotypes,
                           phenotypes=phenotypes)

# Initialize an epistasis model.
model = EpistasisLinearRegression(order=3)

# Add the genotype phenotype map.
model.add_gpm(gpm)

# Fit model to given genotype-phenotype map.
model.fit()

# Plot coefficients (powered by matplotlib).
plot_coefs(model, figsize=(3,5))

More examples can be found in these binder notebooks.

Installation

Epistasis works in Python 3+ (we do not guarantee it will work in Python 2.)

To install the most recent release on PyPi:

pip install epistasis

To install from source, clone this repo and run:

pip install -e .

Documentation

Documentation and API reference can be viewed here.

Dependencies

  • gpmap: Module for constructing powerful genotype-phenotype map python data-structures.
  • Scikit-learn: Simple to use machine-learning algorithms
  • Numpy: Python's array manipulation packaged
  • Scipy: Efficient scientific array manipulations and fitting.
  • lmfit: Non-linear least-squares minimization and curve fitting in Python.

Optional dependencies

Development

We welcome pull requests! If you find a bug, we'd love to have you fix it. If there is a feature you'd like to add, feel free to submit a pull request with a description of the addition. We also ask that you write the appropriate unit-tests for the new feature and add documentation to our Sphinx docs.

To run the tests on this package, make sure you have pytest installed and run from the base directory:

pytest

Citing

If you use this API for research, please cite this paper.

You can also cite the software directly:

@misc{zachary_sailer_2017_252927,
  author       = {Zachary Sailer and Mike Harms},
  title        = {harmslab/epistasis: Genetics paper release},
  month        = jan,
  year         = 2017,
  doi          = {10.5281/zenodo.1215853},
  url          = {https://doi.org/10.5281/zenodo.1215853}
}

Metadata

Release files for epistasis 0.7.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epistasis 0.7.5
File Size Uploaded
epistasis-0.7.5.tar.gz 88.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for epistasis 0.7.5
File Interpreter ABI Platform
epistasis-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 210.2 kB

Release files / epistasis-0.7.5.tar.gz

Download URL epistasis-0.7.5.tar.gz
Size 88.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e2b0a469f182913211f0754b9ceeb5f91a8718b40af2fab985beffc0b963973d
BLAKE2b-256 checksum
How to use checksums
dee61a7a1f2e4c56b2660dd19df52780932548a052f03298682adea09a67f410
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5

Release files / epistasis-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl

Download URL epistasis-0.7.5-cp39-cp39-macosx_10_9_x86_64.whl
Size 121.5 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
26d71c9a09db948685dcef655c3466cfbc2338b8675b32a07db1c7a0ea9e0605
BLAKE2b-256 checksum
How to use checksums
c80e5aebf0752d318843310373108beab8eb3edefc7951b34a648b518e2b65b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.7.5 This release

2 release files

0.7.4

2 release files

0.7.3

1 release file

0.7.2

1 release file

0.7.1

2 release files

0.7.0

2 release files

0.6.8

2 release files

0.6.7

1 release file

0.6.6

1 release file

0.6.4

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page