IPyMOL allows you to control PyMOL sessions via IPython. This tool is ideal for situations where you'd like to present your work neatly in a Jupyter Notebook or conveniently prototype PyMOL scripts.
Please ensure that PyMOL is in your $PATH
as pymol
or you can start PyMOL in server mode:
$ pymol -R #-cKRQ to run it without a GUI
pip install ipymol
You can fire up an IPython or IPython Notebook session and start using IPyMOL. For example:
from ipymol import viewer as pymol
pymol.fetch('3odu') # Fetch PDB
pymol.show_as('cartoon') # Show as cartoon
pymol.bg_color('white') # Set background color to white
pymol.display() # Show current display
This series of commands will define a variable pymol
of class MolViewer
, which can pass commands to PyMOL, and then create an image of PDBID:3odu
in your IPython session.
Additional commands can be invoked via pymol.do("[ENTER YOUR COMMAND HERE]")
.
Here's an example notebook with more information.
Enjoy!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。