MDAnalysis 安装及使用

MDAnalysis 不作介绍。
上官网链接:https://www.mdanalysis.org/pages/installation_quick_start/

conda 安装及使用

安装前注意:

  1. matplotlib库版本问题,需要卸载重新安装低版本,否则有参数无法运行
    The ‘warn’ parameter of use() is deprecated since Matplotlib 3.1 and will be removed in 3.3. If any parameter follows ‘warn’, they should be pass as keyword, not positionally.
    方法:依次在Anaconda Prompt中运行,需要用管理员权限运行
conda uninstall matplotlib
conda uninstall matplotlib-base
conda install matplotlib=3.2.0 # 可以安装更低版本,不可以高于3.2.0

如果在卸载前安装过MDAnalysis,需要重新安装。故应先装matplotlib,再安装MDAnalysis。

MDAnalysis 分析分子动力学轨迹 MDAnalysis-0.7.2.tar.gz MDAnalysis is an object-oriented python toolkit to analyze molecular dynamics trajectories generated by CHARMM, Gromacs, NAMD, LAMMPS, or Amber. It allows one to read molecular dynamics trajectories and access the atomic coordinates through numpy arrays. This provides an extremely flexible and relatively fast framework for complex analysis tasks. In addition, CHARMM-style atom selection commands are implemented. Trajectories can also be manipulated (for instance, fit to a reference structure) and written out. A typical usage pattern is to iterate through a trajectory and analyze coordinates for every frame. In the following example the end-to-end distance of a protein and the radius of gyration of the backbone atoms are calculated: import MDAnalysis from MDAnalysis.tests.datafiles import PSF,DCD # test trajectory import numpy.linalg u = MDAnalysis.Universe(PSF,DCD) # always start with a Universe nterm = u.s4AKE.N[0] # can access structure via segid (s4AKE) and atom name cterm = u.s4AKE.C[-1] # ... takes the last atom named 'C' bb = u.selectAtoms('protein and backbone') # a selection (a AtomGroup) for ts in u.trajectory: # iterate through all frames r = cterm.pos - nterm.pos # end-to-end vector from atom positions d = numpy.linalg.norm(r) # end-to-end distance rgyr = bb.radiusOfGyration() # method of a AtomGroup; updates with each frame print "frame = %d: d = %f Angstroem, Rgyr = %f Angstroem" % (ts.frame, d, rgyr)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值