跳转到主要内容

一个用于估计基因型-表型图谱中统计高阶上位效应的Python API。

项目描述

上位效应

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

用于估计基因型-表型图谱中统计高阶上位效应的Python API。

所有模型都遵循Scikit-learn接口,因此可以无缝地集成到PyData生态系统。有关此包中包含的模型类型,请参阅我们的文档。您还可以在我们的论文中了解更多关于这些模型背后的理论。

最后,如果您想在不安装的情况下测试这个包,请尝试这些Jupyter笔记本在这里(感谢Binder!)。

示例

Epistasis软件包在结合GPMap时表现最佳,GPMap是一个用于管理基因型-表型映射数据的API。构建一个GenotypePhenotypeMap对象,并将其直接传递给一个上位性模型。

# 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))

更多示例可以在这些binder笔记本中找到。

安装

Epistasis在Python 3+(我们不保证它在Python 2中也能工作)中运行。

要安装PyPi上的最新版本

pip install epistasis

要从源安装,克隆此存储库并运行

pip install -e .

文档

文档和API参考可以在这里查看。

依赖项

  • gpmap:用于构建强大的基因型-表型映射Python数据结构的模块。
  • Scikit-learn:易于使用的机器学习算法。
  • Numpy:Python的数组操作封装。
  • Scipy:高效的科学数组和拟合操作。
  • lmfit:Python中的非线性最小二乘优化和曲线拟合。

可选依赖项

开发

我们欢迎拉取请求!如果你发现了一个错误,我们希望你能修复它。如果你想要添加一个功能,请提交一个描述添加的拉取请求。我们还要求你为新功能编写适当的单元测试,并添加到我们的Sphinx文档中。

要运行此包的测试,请确保已安装pytest并从基础目录运行

pytest

引用

如果你用此API进行研究,请引用这篇论文

你也可以直接引用软件

@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}
}

由以下支持