About Forum Issues Tutorials Documentation
</span>
Here, you'll see how to build, visualize, and simulate a protein structure from the PDB.
In [ ]:
import moldesign as mdt
from moldesign import units as u
%matplotlib inline
import numpy as np
from matplotlib.pylab import *
try: import seaborn
except ImportError: pass
In [ ]:
one_yu8 = mdt.from_pdb('1YU8')
one_yu8.draw()
In [ ]:
one_yu8
In [ ]:
headpiece = mdt.Molecule([res for res in one_yu8.residues if res.type == 'protein'])
In [ ]:
protein = mdt.assign_forcefield(headpiece)
In [ ]:
protein.set_energy_model(mdt.models.OpenMMPotential, implicit_solvent='obc')
In [ ]:
mintraj = protein.minimize()
In [ ]:
mintraj.draw(display=False)
In [ ]:
protein.set_integrator(mdt.integrators.OpenMMLangevin,
temperature=300*u.kelvin,
timestep=2.0*u.fs,
frame_interval=2.0*u.ps)
In [ ]:
traj = protein.run(50*u.ps)
In [ ]:
traj.draw()
In [ ]:
plot(traj.time, traj.kinetic_energy)
xlabel('time / %s' % u.default.time); ylabel('energy / %s' % u.default.energy)
In [ ]:
myres = protein.chains['1'].residues['PHE45']
plot(traj.time, traj.dihedral(myres['CG'], myres['CB']).to(u.degrees))
title('dihedral angle vs time')
xlabel('time / %s' % u.default.time); ylabel('angle / degrees')
In [ ]:
plot(traj.time, traj.distance(myres['CG'], myres['CB']))
plt.title('bond length vs time')
xlabel('time / %s' % u.default.time); ylabel('distance / %s' % u.default.length)