python api用于推断稀疏采样的基因型-表型图中缺失的数据。
gpseer的Python项目详细描述
探地雷达
一种在稀疏测量的基因型-表型图中推断缺失数据的固执己见的方法。
基本用法
最简单的用例是在包含基因型表型数据的输入文件上调用gpseer
。
例如:
gpseer -i phenotypes.csv \ --wildtype "00000"\ --threshold 1\ --spline_order 2\ --epistasis_order 2
输出:
[GPSeer] Running GPSeer on phenotypes.csv. Look for a predictions.csv file with your results. [GPSeer] + Reading data... [GPSeer] └── Done reading data. [GPSeer] + Fitting data... [GPSeer] └── Done fitting data. [GPSeer] + Predicting missing data... [GPSeer] └── Done predicting... [GPSeer] GPSeer finished!
它使用二阶样条函数返回一组表型预测。
命令行选项
要查看所有配置项,请调用gpseer --help
:
A tool for predicting phenotypes in a sparsely sampled genotype-phenotype maps.
Options
-------
-i <Unicode> (GPSeer.infile)
Default: 'test'
Input file.
-o <Unicode> (GPSeer.outfile)
Default: 'predictions.csv'
Output file
--model_definition=<Instance> (GPSeer.model_definition)
Default: None
An epistasis model definition written in Python.
--wildtype=<Unicode> (GPSeer.wildtype)
Default: ''
The wildtype sequence
--threshold=<Float> (GPSeer.threshold)
Default: 0.0
Experimental detection threshold, used by classifer.
--spline_order=<Int> (GPSeer.spline_order)
Default: 0.0
Order of spline..
--spline_smoothness=<Int> (GPSeer.spline_smoothness)
Default: 10
Smoothness of spline.
--epistasis_order=<Int> (GPSeer.epistasis_order)
Default: 1
Order of epistasis in the model.
--nreplicates=<Int> (GPSeer.nreplicates)
Default: None
Number of replicates for calculating uncertainty.
--model_file=<Unicode> (GPSeer.model_file)
Default: ''
File containing epistasis model definition.
高级上位机模型
通过编写一个简短的模型文件,可以使用更高级的模型:
# model.pyfromepistasis.modelsimport(EpistasisPipeline,EpistasisLogisticRegression,EpistasisSpline,EpistasisLinearRegression)c.GPSeer.model_definition=EpistasisPipeline([EpistasisLogisticRegression(threshold=5),EpistasisSpline(k=3),EpistasisLinearRegression(order=3)])
然后调用gpseer
命令。
gpseer -i phenotypes.csv --model_file=model.py
安装
克隆此存储库并使用pip安装:
pip install gpseer
依赖关系
- gpmap:用于分析基因型-表型图的python api。
- 上位性:python api用于提取基因型-表型图中的高阶上位性
- traitlets:python中的静态类型和可配置对象