#!/usr/bin/env python # coding: utf-8 # # *This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks); # content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).* # # < [Working with Pose residues](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.02-Working-with-Pose-Residues.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Getting spatial features from a Pose](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.04-Getting-Spatial-Features-from-Pose.ipynb) >

Open in Colab # # Accessing PyRosetta Documentation # Keywords: help() # In[ ]: get_ipython().system('pip install pyrosettacolabsetup') import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta() import pyrosetta; pyrosetta.init() # In[3]: from pyrosetta import * init() # **From previous section:** # Make sure you are in the directory with the pdb files: # # `cd google_drive/MyDrive/student-notebooks/` # In[5]: pose = pose_from_pdb("inputs/5tj3.pdb") # The full documentaton for PyRosetta can be found here: https://graylab.jhu.edu/PyRosetta.documentation/. You can use it to search for or learn more about any method in PyRosetta. # # One benefit of working within Jupyter notebooks is that we can make use of its autocomplete features. To see an example, try typing `res_24.is_` and pressing `tab` to find other features of residues you can examine. Note that you can scroll down to see more features. # In[ ]: # Now that we've looked through those functions, we know how to confirm that PyRosetta has loaded in the zinc ions as metal ions. # In[6]: zn_resid = pose.pdb_info().pdb2pose('A', 601) res_zn = pose.residue(zn_resid) res_zn.is_metal() # ## Exercise 3: Python Object Help # We can also explore documentation for objects and methods from Jupyter notebooks. Say you wanted to find out more about the Pose object. Try typing in `Pose?`, `?Pose` or `help(Pose)`. # In[ ]: # By the way, now if you ever go on to develop some PyRosetta functions, you can see the importance of docstrings! # # This works for PyRosetta methods as well: # In[8]: res_24 = pose.residue(24) # Uncomment this line: # res_24.atom_index? # ## Exercise 4: Some residue commands # # Now use the `atom_index` method and the method below to find out whether the "CA" atom in res_24 is a backbone atom. # In[9]: # Uncomment this line: # res_24.atom_is_backbone? # In[19]: ### BEGIN SOLUTION res_24.atom_is_backbone(res_24.atom_index("CA")) ### END SOLUTION # In[ ]: # # < [Working with Pose residues](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.02-Working-with-Pose-Residues.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Getting spatial features from a Pose](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.04-Getting-Spatial-Features-from-Pose.ipynb) >

Open in Colab