In [1]:
from IPython.display import Image
import os, sys
import __main__
__main__.pymol_argv = [ 'pymol', '-cp' ]
import pymol 
pymol.finish_launching() 
from pymol import cmd
In [2]:
cmd.fetch("1LMP")
In [4]:
cmd.ray()
cmd.png('im.png')
Image(filename='im.png')
Out[4]:
In [31]:
cmd.do("""
bg_color white
select nag, resn nag or resn ndg
select cont, (all w. 4.0 of nag) and not het
select contnh1, (all w. 4.0 of nag) and not het and not n. C*
color wheat, (all)
color yellow, (nag)
color cyan,(contnh1)
util.cnc (nag or contnh1)
zoom (all w. 6.0 of nag)
show surface, cont
show sticks, resi 103 or nag
hide nonbonded, resn hoh
rotate y, 90
set transparency, 0.2
""")
cmd.ray()
cmd.png('im2.png')
Image(filename='im2.png')
       
Out[31]:
In [ ]: