md轨迹的降维方法
unrolr的Python项目详细描述
展开
基于二重距离的度量(https://github.com/jeeberhardt/unrolr)的基于(枢轴)随机邻近嵌入的MD轨迹的构象分析。
先决条件
您至少需要(requirements.txt):
- python 2.7或python 3
- 努比
- h5py
- 熊猫
- matplotlib
- pyopencl
- mdanalysis(>;=0.17)
在unix上安装(debian/ubuntu)
我强烈建议您安装anaconda发行版(https://www.continuum.io/downloads),如果您想要一个干净的python环境,并且几乎已经安装了所有先决条件(numpy、h5py、pandas、matplotlib)。
一。首先,您必须安装opencl:
- 好消息,你不必安装opencl,它是现成的。(更新:坏消息,opencl在macos 10.14中已经贬值。谢谢苹果。)
- 你必须安装AMDGPU graphics stack。
- nvidia:你必须安装CUDA toolkit。
- 英特尔:当然,只要安装这个runtime software package,它也可以在CPU上工作。或者,基于cpu的opencl驱动程序也可以通过conda包管理器的包
pocl
(http://portablecl.org/)安装。
对于任何其他信息,pyopencl的官方安装指南是here。
2.最后一步,从pypi服务器安装
pip install unrolr
或者从源头上
# Get the package wget https://github.com/jeeberhardt/unrolr/archive/master.zip unzip unrolr-master.zip rm unrolr-master.zip cd unrolr-master # Install the package python setup.py install
如果pip在安装所有依赖项时遇到问题,
conda config --append channels conda-forge
conda install pyopencl mdanalysis
# Try again
python setup.py install
opencl上下文
在运行unrolr之前,需要定义opencl上下文。这是一个很好的方式,看看一切是否正常工作。
python -c 'import pyopencl as cl; cl.create_some_context()'
在我的示例中,我可以在3种不同的计算设备(2个图形卡和一个CPU)之间进行选择。
Choose platform: [0] <pyopencl.Platform 'AMD Accelerated Parallel Processing' at 0x7f97e96a8430> Choice [0]:0 Choose device(s): [0] <pyopencl.Device 'Tahiti' on 'AMD Accelerated Parallel Processing' at 0x1e18a30> [1] <pyopencl.Device 'Tahiti' on 'AMD Accelerated Parallel Processing' at 0x254a110> [2] <pyopencl.Device 'Intel(R) Core(TM) i7-3820 CPU @ 3.60GHz' on 'AMD Accelerated Parallel Processing' at 0x21d0300> Choice, comma-separated [0]:1 Set the environment variable PYOPENCL_CTX='0:1' to avoid being asked again.
现在可以设置环境变量。
exportPYOPENCL_CTX='0:1'
示例
from__future__importprint_functionfromunrolrimportUnrolrfromunrolr.feature_extractionimportDihedralfromunrolr.utilsimportsave_datasettop_file='examples/inputs/villin.psf'trj_file='examples/inputs/villin.dcd'# Extract all calpha dihedral angles from trajectory and store them into a HDF5 file (start/stop/step are optionals)d=Dihedral(top_file,trj_file,selection='all',dihedral_type='calpha',start=0,stop=None,step=1).run()X=d.resultsave_dataset('dihedral_angles.h5',"dihedral_angles",X)# Fit X using Unrolr (pSPE + dihedral distance) and save the embedding into a csv fileU=Unrolr(r_neighbor=0.27,n_iter=50000,verbose=1)U.fit(X)U.save(fname='embedding.csv')print('%4.2f%4.2f'%(U.stress,U.correlation))
待办事项列表
- []将spe性能与umap进行比较
- [X]与Python 3的兼容性
- [X]与MDanalysis最新版本的兼容性(=0.17)
- []单元测试
- [X]可从PIP直接访问
- []提高OpenCL性能(全局/本地内存)
引文
Eberhardt,J.,Stote,R.H.,和Dejaegere,A.(2018年)。Unrolr:使用随机接近嵌入的蛋白质构象的结构分析。计算化学杂志,39(30),2551-2557。https://doi.org/10.1002/jcc.25599
许可证
麻省理工学院