Keywords: send_energy(), label_energy(), send_hbonds()
!pip install pyrosettacolabsetup
import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta()
import pyrosetta; pyrosetta.init()
from pyrosetta import *
from pyrosetta.teaching import *
init()
Make sure you are in the directory with the pdb files:
cd google_drive/MyDrive/student-notebooks/
# From previous section:
ras = pyrosetta.pose_from_pdb("inputs/6Q21_A.pdb")
sfxn = get_fa_scorefxn()
The PyMOLMover
class contains a method for sending score function information to PyMOL,
which will then color the structure based on relative residue energies.
Open up PyMOL. Instantiate a PyMOLMover
object and use the pymol_mover.send_energy(ras)
to send the coloring command to PyMOL.
pymol_mover = PyMOLMover()
pymol_mover.apply(ras)
print(sfxn(ras))
pymol_mover.send_energy(ras)
YOUR-CODE-HERE
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
from IPython import display
from pathlib import Path
gifPath = Path("./Media/PyMOL-send_energy.gif")
# Display GIF in Jupyter, CoLab, IPython
with open(gifPath,'rb') as f:
display.Image(data=f.read(), format='png',width='800')
What color is residue Proline34? What color is residue Alanine66? Which residue has lower energy?
# your response here
pymol_mover.send_energy(ras, fa_atr)
will have PyMOL color only by the attractive van der Waals energy component. What color is residue 34 if colored by solvation energy, fa_sol
?
# send specific energies to pymol
YOUR-CODE-HERE
You can have PyMOL label each Cα with the value of its residue’s specified energy using:
pymol_mover.label_energy(ras, "fa_atr")
YOUR-CODE-HERE
Finally, if you have scored the pose
first, you can have PyMOL display all of the calculated hydrogen bonds for the structure:
pymol_mover.send_hbonds(ras)
YOUR-CODE-HERE
This Jupyter notebook is an adapted version of "Workshop #3: Scoring" in the PyRosetta workbook: https://graylab.jhu.edu/pyrosetta/downloads/documentation/pyrosetta4_online_format/PyRosetta4_Workshop3_Scoring.pdf