序
HTMD是一个特别的分子可编程环境,用于准备、处理、模拟、可视化和分析分子系统。HTMD基于Python,用户能够轻松地利用Jupyter Notebook在浏览器中运行IPython进行整个计算实验,从操纵PDB,构建、执行、可视化和分析模拟。 本节内容主要展示,如何利用HTMD提供的Python环境,在浏览器中运行jupyter notebook进行ACEMD动力学模拟过程中,蛋白、小分子、动力学轨迹的可视化。 Visualization in HTMD #!/usr/bin/python3 # coding: utf-8 # In[1]:导入模块,开启可视化 from htmd.ui import * from htmd.config import config config(viewer='webgl') %pylab inline # In[2]:交互式可视化 mol = Molecule('3PTB.pdb') # reloading the molecule mol.view(gui=False) # In[3]:可视化参数设置 mol.view(sel='protein', style='NewCartoon', color='Index', hold=True) mol.view(sel='resname BEN', style='Licorice', color=1) # In[4]:操作元素属性,并在可视化中显示 mol.reps.remove() # Clear representations mol.reps.add(sel='protein', style='NewCartoon', color='Index') mol.reps.add(sel='resname BEN', style='Licorice', color=1) print(mol.reps) # Show list of representations (equivalent to mol.reps.list()) mol.view() # In[5]:不显示中间6 Å厚度的原子 mol.reps.remove() # in order to remove the previouly stored representations mol.view(sel='x*x>9') # In[6]:可视化轨迹 from htmd.home import home molTraj = Molecule(home(dataDir='dhfr') + '/dhfr.psf') molTraj.read(home(dataDir='dhfr') + '/dhfr.xtc') molTraj.view() 参考资料 https://software.acellera.com/docs/latest/htmd/tutorials/visualization.html https://software.acellera.com/docs/latest/htmd/tutorials/htmd-molecules.html http://gainstrong.net/works/hudong/