Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cxhernandez/ipymol
Control PyMOL sessions via IPython
https://github.com/cxhernandez/ipymol
notebook python structural-biology visualization
Last synced: 4 days ago
JSON representation
Control PyMOL sessions via IPython
- Host: GitHub
- URL: https://github.com/cxhernandez/ipymol
- Owner: cxhernandez
- License: mit
- Created: 2013-11-20T00:56:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-11-03T20:51:56.000Z (almost 2 years ago)
- Last Synced: 2024-09-26T04:07:01.962Z (7 days ago)
- Topics: notebook, python, structural-biology, visualization
- Language: Python
- Homepage:
- Size: 3.27 MB
- Stars: 55
- Watchers: 5
- Forks: 19
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://badge.fury.io/py/ipymol.svg
:target: https://pypi.python.org/pypi/ipymol/
:alt: Latest PyPI versionIPyMOL
======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.
Before You Begin
----------------
Please ensure that PyMOL is in your ``$PATH`` as ``pymol`` or you can start PyMOL in server mode:.. code:: shell
$ pymol -R #-cKRQ to run it without a GUI
Installation
------------.. code:: shell
pip install ipymol
Example Usage
--------------
You can fire up an IPython or IPython Notebook session and start using IPyMOL. For example:.. code:: python
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 displayThis 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!