Viewing stuff in chemview is fairly easy. But since it deals only with visualization we will use another program (mdtraj) to pull data from the web. This is a protein.


In [1]:
import mdtraj as md
traj = md.load_pdb('2M6K.pdb')
print traj


<mdtraj.Trajectory with 30 frames, 4462 atoms, 292 residues, and unitcells>

Chemview provides a class MolecularViewer and helpers to let you easily display the protein using a cylinder and strand representation.


In [4]:
from chemview import MolecularViewer, enable_notebook
from chemview.contrib import topology_mdtraj
enable_notebook()

mv = MolecularViewer(traj.xyz[0], topology_mdtraj(traj))
mv.cylinder_and_strand()
mv


/home/gabriele/anaconda/lib/python2.7/site-packages/IPython/utils/traitlets.py:364: FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.
  silent = bool(old_value == new_value)

In [5]:
from chemview.export import display_static

display_static(mv)

In [ ]: