This notebook contains material from PyRosetta; content is available on Github.

Accessing PyRosetta Documentation

Keywords: help()

In [ ]:
# Notebook setup
import sys
if 'google.colab' in sys.modules:
    !pip install pyrosettacolabsetup
    import pyrosettacolabsetup
    pyrosettacolabsetup.mount_pyrosetta_install()
    print ("Notebook is set for PyRosetta use in Colab.  Have fun!")
In [3]:
from pyrosetta import *
init()
core.init: Checking for fconfig files in pwd and ./rosetta/flags
core.init: Rosetta version: PyRosetta4.Release.python36.mac r208 2019.04+release.fd666910a5e fd666910a5edac957383b32b3b4c9d10020f34c1 http://www.pyrosetta.org 2019-01-22T15:55:37
core.init: command: PyRosetta -ex1 -ex2aro -database /Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/database
core.init: 'RNG device' seed mode, using '/dev/urandom', seed=-261722691 seed_offset=0 real_seed=-261722691
core.init.random: RandomGenerator:init: Normal mode, seed=-261722691 RG_type=mt19937

From previous section: Make sure you are in the directory with the pdb files:

cd google_drive/My\ Drive/student-notebooks/

In [5]:
pose = pose_from_pdb("inputs/5tj3.pdb")
core.chemical.GlobalResidueTypeSet: Finished initializing fa_standard residue type set.  Created 696 residue types
core.chemical.GlobalResidueTypeSet: Total time to initialize 0.972394 seconds.
core.import_pose.import_pose: File 'inputs/5tj3.pdb' automatically determined to be of type PDB
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue LYS 233
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD  on residue LYS 233
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CE  on residue LYS 233
core.conformation.Conformation: [ WARNING ] missing heavyatom:  NZ  on residue LYS 233
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue ASP 350
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OD1 on residue ASP 350
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OD2 on residue ASP 350
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue LYS 353
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD  on residue LYS 353
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CE  on residue LYS 353
core.conformation.Conformation: [ WARNING ] missing heavyatom:  NZ  on residue LYS 353
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue GLU 354
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD  on residue GLU 354
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OE1 on residue GLU 354
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OE2 on residue GLU 354
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue LYS 382
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD  on residue LYS 382
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CE  on residue LYS 382
core.conformation.Conformation: [ WARNING ] missing heavyatom:  NZ  on residue LYS 382
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CG  on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD1 on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CD2 on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CE1 on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CE2 on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  CZ  on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OH  on residue TYR 454
core.conformation.Conformation: [ WARNING ] missing heavyatom:  OXT on residue GLY:CtermProteinFull 520
core.pack.pack_missing_sidechains: packing residue number 233 because of missing atom number 6 atom name  CG
core.pack.pack_missing_sidechains: packing residue number 350 because of missing atom number 6 atom name  CG
core.pack.pack_missing_sidechains: packing residue number 353 because of missing atom number 6 atom name  CG
core.pack.pack_missing_sidechains: packing residue number 354 because of missing atom number 6 atom name  CG
core.pack.pack_missing_sidechains: packing residue number 382 because of missing atom number 6 atom name  CG
core.pack.pack_missing_sidechains: packing residue number 454 because of missing atom number 6 atom name  CG
core.pack.task: Packer task: initialize from command line()
core.scoring.ScoreFunctionFactory: SCOREFUNCTION: ref2015
core.scoring.etable: Starting energy table calculation
core.scoring.etable: smooth_etable: changing atr/rep split to bottom of energy well
core.scoring.etable: smooth_etable: spline smoothing lj etables (maxdis = 6)
core.scoring.etable: smooth_etable: spline smoothing solvation etables (max_dis = 6)
core.scoring.etable: Finished calculating energy tables.
basic.io.database: Database file opened: scoring/score_functions/hbonds/ref2015_params/HBPoly1D.csv
basic.io.database: Database file opened: scoring/score_functions/hbonds/ref2015_params/HBFadeIntervals.csv
basic.io.database: Database file opened: scoring/score_functions/hbonds/ref2015_params/HBEval.csv
basic.io.database: Database file opened: scoring/score_functions/hbonds/ref2015_params/DonStrength.csv
basic.io.database: Database file opened: scoring/score_functions/hbonds/ref2015_params/AccStrength.csv
basic.io.database: Database file opened: scoring/score_functions/rama/fd/all.ramaProb
basic.io.database: Database file opened: scoring/score_functions/rama/fd/prepro.ramaProb
basic.io.database: Database file opened: scoring/score_functions/omega/omega_ppdep.all.txt
basic.io.database: Database file opened: scoring/score_functions/omega/omega_ppdep.gly.txt
basic.io.database: Database file opened: scoring/score_functions/omega/omega_ppdep.pro.txt
basic.io.database: Database file opened: scoring/score_functions/omega/omega_ppdep.valile.txt
basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA
basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/P_AA_n
core.scoring.P_AA: shapovalov_lib::shap_p_aa_pp_smooth_level of 1( aka low_smooth ) got activated.
basic.io.database: Database file opened: scoring/score_functions/P_AA_pp/shapovalov/10deg/kappa131/a20.prop
basic.io.database: Database file opened: scoring/score_functions/elec_cp_reps.dat
core.scoring.elec.util: Read 40 countpair representative atoms
core.pack.dunbrack.RotamerLibrary: shapovalov_lib_fixes_enable option is true.
core.pack.dunbrack.RotamerLibrary: shapovalov_lib::shap_dun10_smooth_level of 1( aka lowest_smooth ) got activated.
core.pack.dunbrack.RotamerLibrary: Binary rotamer library selected: /Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin
core.pack.dunbrack.RotamerLibrary: Using Dunbrack library binary file '/Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin'.
core.pack.dunbrack.RotamerLibrary: Dunbrack 2010 library took 0.325361 seconds to load from binary
core.pack.pack_rotamers: built 90 rotamers at 6 positions.
core.pack.interaction_graph.interaction_graph_factory: Instantiating DensePDInteractionGraph

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() 
Out[6]:
True

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
Out[19]:
True
In [ ]: