Before you turn this problem in, make sure everything runs as expected. First, restart the kernel (in the menubar, select Kernel$\rightarrow$Restart) and then run all cells (in the menubar, select Cell$\rightarrow$Run All).
Make sure you fill in any place that says YOUR CODE HERE
or "YOUR ANSWER HERE", as well as your name and collaborators below:
NAME = ""
COLLABORATORS = ""
Keywords: send_energy(), label_energy(), send_hbonds()
# Notebook setup
import sys
if 'google.colab' in sys.modules:
!pip install pyrosettacolabsetup
import pyrosettacolabsetup
pyrosettacolabsetup.setup()
print ("Notebook is set for PyRosetta use in Colab. Have fun!")
from pyrosetta import *
from pyrosetta.teaching import *
init()
Make sure you are in the directory with the pdb files:
cd google_drive/My\ Drive/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
raise NotImplementedError()
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
raise NotImplementedError()
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
raise NotImplementedError()
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
raise NotImplementedError()
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