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

GALigandDock Protocol with pyrosetta.distributed Using the beta_cart.wts Scorefunction

Warning: This notebook uses pyrosetta.distributed.viewer code, which runs in jupyter notebook and might not run if you're using jupyterlab.

Note: This Jupyter notebook requires the PyRosetta distributed layer. Please make sure to activate the PyRosetta.notebooks conda environment before running this notebook. The kernel is set to use this environment.

In [1]:
import logging
logging.basicConfig(level=logging.INFO)
import matplotlib
%matplotlib inline
import os
import pandas as pd
import pyrosetta
import pyrosetta.distributed
import pyrosetta.distributed.io as io
import pyrosetta.distributed.viewer as viewer
import pyrosetta.distributed.packed_pose as packed_pose
import pyrosetta.distributed.tasks.rosetta_scripts as rosetta_scripts
import seaborn
seaborn.set()
import sys

# Notebook setup
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!")

Load the TPA.am1-bcc.gp.params file when using the -beta_cart flag, which has gen_potential atom typing and AM1-BCC partial charges:

In [2]:
pdb_filename = "inputs/test_lig.pdb"
ligand_params = "inputs/TPA.am1-bcc.gp.params"
flags = f"""
-ignore_unrecognized_res 1
-extra_res_fa {ligand_params}
-beta_cart
-out:level 200
"""
pyrosetta.distributed.init(flags)
pose_obj = io.pose_from_file(filename=pdb_filename)
INFO:pyrosetta.distributed:maybe_init performing pyrosetta initialization: {'extra_options': '-ignore_unrecognized_res 1 -extra_res_fa inputs/TPA.am1-bcc.gp.params -beta_cart -out:level 200', 'silent': True}
INFO:pyrosetta.rosetta:Found rosetta database at: /mnt/home/klimaj/git/Rosetta/main/source/src/python/PyRosetta/src/pyrosetta/database; using it....
INFO:pyrosetta.rosetta:PyRosetta-4 2019 [Rosetta PyRosetta4.conda.linux.CentOS.python36.Release 2019.39+release.93456a567a8125cafdf7f8cb44400bc20b570d81 2019-09-26T14:24:44] retrieved from: http://www.pyrosetta.org
(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.
INFO:rosetta:core.init.score_function_corrections: {0} [ WARNING ] Flag -beta_nov16 is set but -weights are also specified.  Not changing input weights file!
INFO:rosetta:core.io.pose_from_sfr.PoseFromSFRBuilder: {0} [ WARNING ] TPA337 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.

Now we change the scorefunction in our RosettaScripts script to beta_cart.wts, the weights of which were optimized on protein-ligand complexes using ligands with AM1-BCC partial charges generated with Amber's antechamber.

GALigandDock within RosettaScripts normally outputs multiple .pdb files to disk if run by the command line. However, when using the MultioutputRosettaScriptsTask function in pyrosetta.distributed, the outputs will be captured in memory within this Jupyter session!

In [4]:
xml = f"""
<ROSETTASCRIPTS>
  <SCOREFXNS>
    <ScoreFunction name="fa_standard" weights="beta_cart.wts"/>
  </SCOREFXNS>
  <MOVERS>
    <GALigandDock name="dock"
                  scorefxn="fa_standard"
                  scorefxn_relax="fa_standard"
                  grid_step="0.25"
                  padding="5.0"
                  hashsize="8.0"
                  subhash="3"
                  nativepdb="{pdb_filename}"
                  final_exact_minimize="sc"
                  random_oversample="10"
                  rotprob="0.9"
                  rotEcut="100"
                  sidechains="auto"
                  initial_pool="{pdb_filename}">
      <Stage repeats="10" npool="50" pmut="0.2" smoothing="0.375" rmsdthreshold="2.5" maxiter="50" pack_cycles="100" ramp_schedule="0.1,1.0"/>
      <Stage repeats="10" npool="50" pmut="0.2" smoothing="0.375" rmsdthreshold="1.5" maxiter="50" pack_cycles="100" ramp_schedule="0.1,1.0"/>
    </GALigandDock>
  </MOVERS>
  <PROTOCOLS>
    <Add mover="dock"/>
  </PROTOCOLS>
</ROSETTASCRIPTS>
"""
xml_obj = rosetta_scripts.MultioutputRosettaScriptsTask(xml)
xml_obj.setup()
INFO:rosetta:core.io.pose_from_sfr.PoseFromSFRBuilder: {0} [ WARNING ] TPA337 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.

MultioutputRosettaScriptsTask is a python generator object. Therefore, we need to call list() or set() on it to run it.

Warning, the following cell runs for ~45 minutes CPU time.

In [6]:
if not os.getenv("DEBUG"):
    %time results = list(xml_obj(pose_obj))

Inspect the scores for the GALigandDock trajectories:

In [5]:
if not os.getenv("DEBUG"):
    df = pd.DataFrame.from_records(packed_pose.to_dict(results))
    df
Out[5]:
cart_bonded dslf_fa13 fa_atr fa_dun_dev fa_dun_rot fa_dun_semi fa_elec fa_intra_atr_xover4 fa_intra_elec fa_intra_rep_xover4 ... lk_ball lk_ball_bridge lk_ball_bridge_uncpl lk_ball_iso omega p_aa_pp pickled_pose rama_prepro ref total_score
0 1123.712502 0.0 -2151.762324 2073.947599 351.670653 526.462836 -608.942522 -152.925958 -91.709467 484.474982 ... 914.974515 8.028863 56.938398 2237.073939 3.205810 -84.787860 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 338.665837 -83.04488 2146.657901
1 1126.994362 0.0 -2153.494398 2074.354803 350.045712 527.638427 -598.326113 -155.611156 -95.374631 487.259466 ... 912.676585 8.185741 57.137773 2236.078391 2.616802 -84.905751 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 338.066308 -83.04488 2154.465790
2 1122.218749 0.0 -2152.061341 2074.616276 352.358914 528.828818 -592.915774 -152.872453 -94.779139 484.857347 ... 911.937969 8.482099 59.081443 2234.873025 2.785344 -84.712778 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 338.017765 -83.04488 2160.068530
3 1124.089966 0.0 -2152.510428 2074.255528 352.854664 526.668672 -594.728864 -154.667979 -91.274751 484.674904 ... 911.669956 8.161121 56.862517 2235.493136 2.689288 -84.570622 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 338.948903 -83.04488 2168.046714
4 1127.329477 0.0 -2144.634818 2074.065162 353.115713 528.590003 -591.697767 -157.057321 -99.639525 488.113252 ... 911.687657 8.390250 59.421205 2230.112093 3.098268 -84.642988 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.732965 -83.04488 2171.305626
5 1119.868142 0.0 -2135.739776 2073.996665 353.098796 528.725083 -585.912100 -153.333212 -95.675236 484.059834 ... 904.758285 8.352889 59.583429 2222.677958 2.782730 -84.397516 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.262489 -83.04488 2174.354305
6 1119.054847 0.0 -2128.180817 2074.125675 354.267620 527.658626 -600.190559 -152.753968 -93.492140 484.075625 ... 910.301829 8.267338 58.256741 2225.289996 2.463544 -83.967544 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.339600 -83.04488 2175.892215
7 1118.147392 0.0 -2120.681500 2073.846102 354.157516 527.871629 -589.804841 -153.593008 -94.975244 485.339630 ... 901.078625 8.301181 57.906715 2210.271834 2.188813 -84.127671 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.763695 -83.04488 2176.467254
8 1117.748559 0.0 -2123.042805 2074.240598 354.436350 528.611581 -590.876958 -153.665083 -94.331011 485.674473 ... 902.906292 8.220858 58.551026 2216.794578 2.357257 -84.155674 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.664206 -83.04488 2176.841510
9 1122.056963 0.0 -2148.039319 2074.745640 352.344596 529.868373 -594.182910 -153.210177 -92.399237 484.908058 ... 914.566198 7.920984 55.527792 2237.359424 2.137919 -84.688511 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.407441 -83.04488 2176.972496
10 1117.741151 0.0 -2121.369976 2074.302515 354.174154 527.791725 -590.241078 -153.597633 -95.827353 484.667353 ... 902.542067 8.345890 58.585494 2213.451888 2.415969 -83.917844 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.436524 -83.04488 2177.730121
11 1119.795446 0.0 -2117.973995 2074.530476 354.559199 527.338329 -589.618991 -152.679052 -94.486570 483.735919 ... 900.964799 8.310695 59.028378 2209.505589 2.363121 -83.626671 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 341.958594 -83.04488 2178.204123
12 1118.312826 0.0 -2114.047445 2073.902282 354.175136 527.752024 -582.787032 -155.366733 -95.968917 484.953600 ... 897.209214 8.592110 60.281273 2205.347438 2.395891 -83.962223 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.457713 -83.04488 2178.866416
13 1118.317051 0.0 -2117.307557 2074.313993 354.138775 527.433465 -590.049904 -153.449984 -93.513722 484.159308 ... 901.034141 8.282241 58.387106 2209.445302 2.383612 -83.789749 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.885252 -83.04488 2179.058794
14 1118.256140 0.0 -2123.629410 2074.260297 354.132779 527.720437 -592.217546 -152.449089 -94.956140 484.107818 ... 904.939033 8.292054 58.087667 2215.458503 2.156304 -83.943825 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.712217 -83.04488 2180.117049
15 1117.752265 0.0 -2114.376414 2074.038976 354.257153 527.919548 -589.463209 -154.153409 -96.869409 485.552224 ... 900.635260 8.353362 58.863490 2208.448162 2.554803 -84.106625 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.456327 -83.04488 2180.583104
16 1119.663802 0.0 -2115.773970 2074.093793 354.151646 527.533400 -588.314086 -153.611090 -95.320298 485.147909 ... 900.851984 8.401965 58.705711 2208.861342 2.298621 -83.990494 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.444064 -83.04488 2180.631216
17 1118.929507 0.0 -2116.099773 2073.909466 353.177818 527.268960 -582.793771 -152.797945 -94.676084 484.698239 ... 899.264890 8.385106 58.834187 2207.193408 2.493420 -84.059707 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.345752 -83.04488 2180.725153
18 1118.692345 0.0 -2121.193398 2074.323205 354.166226 527.657215 -588.721658 -153.256935 -95.684619 484.856754 ... 902.384370 8.368650 58.995883 2213.820288 2.424769 -83.954573 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.770906 -83.04488 2180.847581
19 1121.517245 0.0 -2132.859286 2073.740747 354.283261 527.735912 -598.362623 -153.919304 -92.398482 483.048769 ... 908.434224 8.123019 56.443615 2226.746092 2.195113 -84.087127 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.751774 -83.04488 2180.751217
20 1120.747776 0.0 -2127.375634 2073.896934 356.547817 527.681799 -600.943325 -153.540042 -92.812196 485.343720 ... 908.716709 8.092196 56.262864 2225.237135 1.934896 -84.138227 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.643492 -83.04488 2180.879864
21 1116.839196 0.0 -2118.482689 2073.891207 354.155908 526.806919 -586.305973 -154.254092 -91.845749 485.066702 ... 899.245585 8.394896 59.021236 2208.290013 2.226094 -83.855202 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.857928 -83.04488 2181.324150
22 1117.941693 0.0 -2115.636826 2074.302958 354.146873 527.749761 -587.750200 -153.653116 -95.974025 484.157755 ... 900.967950 8.426505 59.073716 2211.663744 2.362630 -83.991207 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.408618 -83.04488 2181.401864
23 1116.500637 0.0 -2114.357782 2074.051987 354.119153 527.691554 -588.315750 -153.221795 -92.867507 483.416645 ... 899.084521 8.246251 57.568979 2207.411666 2.362959 -83.992033 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.335161 -83.04488 2181.440088
24 1120.434458 0.0 -2122.899390 2073.935206 354.080054 527.643448 -598.458861 -152.784966 -94.281443 484.558852 ... 907.877157 8.220266 57.625948 2221.312457 2.273240 -84.084665 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.841184 -83.04488 2181.525400
25 1119.431342 0.0 -2120.640287 2074.014195 354.108787 527.879213 -583.333339 -153.362764 -94.510391 484.397750 ... 899.917327 8.269664 58.201673 2209.080229 2.580138 -83.971134 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.407423 -83.04488 2181.759201
26 1120.266241 0.0 -2118.909596 2074.762505 353.521146 527.725522 -583.715146 -153.625307 -92.616395 484.624171 ... 899.566101 8.234914 57.339780 2205.439602 2.335625 -83.754730 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 341.944039 -83.04488 2181.829008
27 1117.264440 0.0 -2117.967615 2073.920889 352.837101 527.984058 -583.429823 -153.081684 -96.927710 484.420431 ... 900.899472 8.364630 59.048445 2209.367978 2.274618 -83.939094 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.668094 -83.04488 2181.989318
28 1117.192046 0.0 -2116.088396 2074.109505 354.226898 527.758834 -587.301089 -153.499639 -94.926420 484.217262 ... 900.514420 8.324491 58.216448 2209.462522 2.235938 -84.040372 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.500974 -83.04488 2181.941843
29 1115.740407 0.0 -2121.220723 2073.950516 354.180802 527.823457 -584.729707 -153.132527 -92.970132 484.788703 ... 901.835244 8.304383 58.752266 2213.783240 2.400138 -84.022702 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.452932 -83.04488 2181.977075
30 1118.176537 0.0 -2118.976859 2074.091208 354.235640 527.771483 -591.733103 -153.193661 -94.015077 484.421670 ... 905.297959 8.225279 57.791513 2214.322574 2.560843 -83.994720 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.584211 -83.04488 2182.044673
31 1117.720868 0.0 -2117.913073 2073.964761 354.143081 527.906426 -589.163726 -152.904905 -94.489469 484.573393 ... 901.256252 8.229592 56.822766 2210.611495 2.201650 -84.126880 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.613090 -83.04488 2182.105762
32 1120.610165 0.0 -2120.058676 2074.137857 354.221243 526.489176 -589.280668 -153.848764 -91.706236 484.522268 ... 902.329492 8.334486 58.820247 2210.819610 2.267812 -84.308570 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.590574 -83.04488 2182.142107
33 1116.528835 0.0 -2114.868437 2073.857444 354.169507 527.771740 -587.077078 -153.825286 -93.215278 484.916617 ... 899.883852 8.286588 57.875725 2207.725086 2.314438 -84.073244 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.429989 -83.04488 2182.435992
34 1118.887136 0.0 -2119.543055 2074.126521 353.328521 528.791448 -584.198246 -153.874909 -96.050302 484.634286 ... 899.690522 8.214202 57.495022 2208.838554 2.626603 -84.212765 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.517557 -83.04488 2182.829516
35 1117.173583 0.0 -2116.769462 2074.056933 354.164934 527.351801 -584.333500 -153.785952 -92.757097 483.602991 ... 899.034577 8.332849 58.410754 2206.737206 2.301316 -83.816302 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.539722 -83.04488 2182.715754
36 1118.897286 0.0 -2123.904734 2073.872455 354.384303 527.646746 -590.495957 -154.263097 -95.314800 484.645354 ... 906.082402 8.268748 56.961587 2218.768584 2.820835 -84.201293 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.705109 -83.04488 2183.402096
37 1126.205813 0.0 -2152.142984 2074.917354 353.307715 528.107170 -582.578905 -154.116226 -95.336262 487.068420 ... 909.171597 8.781040 62.662417 2237.343204 3.504083 -84.192562 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 337.419080 -83.04488 2182.847308
38 1116.328492 0.0 -2117.094750 2073.901394 354.204171 527.850793 -590.565227 -152.014204 -94.162300 483.845064 ... 903.492147 8.190625 56.990750 2212.085955 2.336527 -84.112099 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.552713 -83.04488 2183.796557
39 1118.472471 0.0 -2118.173586 2073.906513 354.093842 527.694559 -579.597896 -153.772378 -94.421606 484.157218 ... 899.414054 8.320370 58.245026 2209.080366 2.185829 -84.037889 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.548692 -83.04488 2183.988985
40 1122.074279 0.0 -2120.153906 2074.046413 354.141093 527.769415 -586.209890 -155.410559 -94.022582 485.814683 ... 901.952444 8.477702 58.843519 2213.276321 2.649365 -83.926852 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.441443 -83.04488 2184.389649
41 1120.563660 0.0 -2122.478336 2074.408840 354.076905 527.893912 -589.536028 -153.098357 -94.206318 484.609542 ... 905.121053 8.361940 59.220623 2216.119579 2.268016 -83.997958 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.609626 -83.04488 2184.355960
42 1122.183065 0.0 -2134.140192 2074.061703 354.273227 527.587301 -594.595432 -153.088345 -94.107961 483.686954 ... 910.903751 8.118174 56.584244 2230.277951 2.311996 -84.196198 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 341.194660 -83.04488 2184.470170
43 1121.896046 0.0 -2122.725356 2073.888454 354.339331 528.732720 -582.161860 -153.748085 -93.864669 485.063471 ... 900.362161 8.190309 56.311753 2211.958350 2.368035 -84.045210 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 339.576207 -83.04488 2185.656786
44 1120.136109 0.0 -2129.790646 2074.069462 354.917341 527.542480 -586.778335 -153.076268 -95.400060 484.850197 ... 906.779590 8.362696 57.329232 2225.100940 3.163210 -84.006384 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.155735 -83.04488 2186.132616
45 1119.679063 0.0 -2134.665902 2073.996940 355.192983 527.415419 -593.001728 -153.120848 -94.091495 484.763015 ... 910.660655 8.068935 56.222138 2229.244793 2.515460 -84.164875 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.078616 -83.04488 2185.720084
46 1118.074433 0.0 -2113.160467 2074.074668 353.120830 526.287474 -586.075877 -153.679664 -93.415569 483.843130 ... 900.288128 8.436855 59.436842 2207.194812 2.567297 -83.991158 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 340.728354 -83.04488 2186.292344
47 1117.514275 0.0 -2115.978997 2074.329427 353.768894 526.949539 -575.206892 -153.425757 -96.710046 486.046957 ... 896.743939 8.183895 56.891607 2205.048713 2.446659 -83.981252 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 341.310476 -83.04488 2186.556645
48 1116.978234 0.0 -2125.072550 2074.670339 353.297882 528.306793 -587.755445 -152.715260 -95.858052 483.961905 ... 905.459894 8.162587 56.287570 2220.501922 2.741407 -84.342385 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 338.792190 -83.04488 2186.276192
49 1122.186473 0.0 -2141.044482 2074.397811 354.212538 527.553732 -589.354853 -154.016633 -94.162834 485.014271 ... 911.224885 8.216895 57.795436 2234.960243 2.454796 -84.284048 gANjcHlyb3NldHRhLnJvc2V0dGEuY29yZS5wb3NlClBvc2... 341.233187 -83.04488 2189.951239

50 rows × 30 columns

Now that we have performed GALigandDock, we can plot the ligand binding energy landscape:

In [6]:
if not os.getenv("DEBUG"):
    matplotlib.rcParams["figure.figsize"] = [12.0, 8.0]
    seaborn.scatterplot(x="lig_rms", y="total_score", data=df)
Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fffec3d07b8>

Let's look at the ligand dock with the lowest total_score score!

In [7]:
if not os.getenv("DEBUG"):
    ppose_lowest_total_score = results[df.sort_values(by="total_score").index[0]]
    view = viewer.init(ppose_lowest_total_score)
    view.add(viewer.setStyle())
    view.add(viewer.setStyle(command=({"hetflag": True}, {"stick": {"colorscheme": "brownCarbon", "radius": 0.2}})))
    view.add(viewer.setSurface(residue_selector=pyrosetta.rosetta.core.select.residue_selector.ChainSelector("E"), opacity=0.7, color='white'))
    view.add(viewer.setHydrogenBonds())
    view()

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol