In [1]:
import urllib2
In [2]:
import ipython_glmol
import ipython_glmol.test_data
In [3]:
pdb_lines = urllib2.urlopen("http://www.rcsb.org/pdb/files/1sfc.pdb").readlines()
pdb_lines = [l.strip() for l in pdb_lines if l.startswith("ATOM")]
In [4]:
from ipython_glmol.glmol_repr import Ribbon, Line, BackgroundColor, Helix
from ipython_glmol.glmol_selectors import All, Atom, Heavyatom, Backbone
In [5]:
test_embed = ipython_glmol.PDBEmbed(ipython_glmol.test_pdb_data) + Helix(Atom[53:82]) + Ribbon() + Line(Heavyatom()) + BackgroundColor("000000")
test_embed
Out[5]:
In [6]:
from ipython_glmol.glmol_repr import Sphere, Line
In [7]:
full_embed = ipython_glmol.PDBEmbed("\n".join(pdb_lines + [""])) + Sphere(Backbone()) + Line(Heavyatom() )
full_embed
Out[7]: