In [2]:
from xmlrpclib import ServerProxy
from IPython.display import Image
import os, sys
In [3]:
import __main__

__main__.pymol_argv = [ 'pymol', '-cp' ]
In [4]:
import pymol
 
pymol.finish_launching()
 
from pymol import cmd
In [5]:
from IPython.display import Image
In [6]:
cmd.delete('all')
cmd.fetch('1lmp')
In [24]:
cmd.do('''
bg_color white
remove solvent
extract ligands,het
as sticks, ligands
as cartoon, 1lmp
color gray, 1lmp
set cartoon_transparency, 0.5, 1lmp
set stick_transparency, 0.5, 1lmp
hide surface, all
show stick, byres(1lmp w. 4 of ligands)
label (n. CA and byres(1lmp w. 4 of ligands)), (resn, resi)
set label_color, black
center ligands
zoom byres(1lmp w. 4 of ligands)
dist hbo,1lmp,ligands,3.2,mode=2
ray
png pic1.png
''')
In [25]:
Image(filename='pic1.png')
Out[25]:
In [28]:
ipython nbconvert Untitled0.ipynb --to html
  File "<ipython-input-28-a8c485ae1647>", line 1
    ipython nbconvert Untitled0.ipynb --to html
                    ^
SyntaxError: invalid syntax
In [2]:
 
In []: