import mdtraj as md
import numpy as np
'''
Render a picture of lysozyme protein with nglview
1. import packages
2. Download 1GWD protein
3. Render it
4. Embed in jupyter notebook
'''
import mdtraj as md
import numpy as np
'''
Render a picture of lysozyme protein with nglview
1. import packages
2. Download 1GWD protein
3. Render it
4. Embed in jupyter notebook
'''
# 1. import packages
import nglview as nv
import mdtraj as md
# 2. Download 1GWD protein
traj = md.load('http://www.rcsb.org/pdb/files/1GWD.pdb')
# 3. Render it
view = nv.show_mdtraj(traj)
view
# 4. Embed in jupyter notebook
view.add_representation('cartoon', selection='protein')
view.add_representation('ball+stick', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
view.add_representation('licorice', selection='not water')
view.add_representation('ball+stick', selection='not water')
view.add_representation('spacefill', selection='not water')
view.add_representation('surface', selection='not water')
No such file: http://www.rcsb.org/pdb/files/1GWD.pdb
Go to Google Form