carbonscott / pymolPy3

The package enables the use of PyMOL commands directly in Python 3 scripts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What's pymolPy3?

The package enables the use of PyMOL commands directly in Python 3 scripts. NO APIs are requierd.

The length of source code is only 32 lines, but the example has a size of 29MB.

What can it do?

Install pymolPy3

pip install pymolPy3 --user or pip install git+https://github.com/carbonscott/pymolPy3 --upgrade --user

Basic usage

Initializ pymol

import pymolPy3

# Launch pymol with GUI
pm = pymolPy3.pymolPy3()

OR

import pymolPy3

# Launch pymol without GUI
pm = pymolPy3.pymolPy3(0)

Load a PDB structure

pdb = '1f88'

pm(f"load {pdb}.pdb")

Run PyMOL command in pm() -- it's a wrapper

pm(f"...")
#    ~~~
#     |
#     |_______ A string representing PyMOL command.

Examples

The sample script align.view.py under the examples directory would produces the figure below.

About

The package enables the use of PyMOL commands directly in Python 3 scripts.

License:MIT License


Languages

Language:Python 100.0%