{ "cells": [ { "cell_type": "markdown", "id": "a3434f0d", "metadata": {}, "source": [ "# TMol How-To Guide — Scoring and Optimization\n", "\n", "[](https://colab.research.google.com/github/RosettaCommons/tmol/blob/main/docs/tutorial/02_scoring_and_optimization.ipynb)" ] }, { "cell_type": "markdown", "id": "8aae5b6b", "metadata": {}, "source": [ "## 2. Scoring and Optimization" ] }, { "cell_type": "markdown", "id": "6e358900", "metadata": {}, "source": [ "Score a structure, minimize it, pack its side chains, and relax it -- the core scoring/optimization loop. This notebook assumes the loading/querying basics from [tmol_how_to_guide.ipynb](01_tmol_how_to_guide.ipynb) section 1." ] }, { "cell_type": "markdown", "id": "471ceff0", "metadata": {}, "source": [ "### Setup (TODO - these extra setup steps will go away when the notebooks are combined)" ] }, { "cell_type": "markdown", "id": "ee57450f", "metadata": {}, "source": [ "Wheel install, imports, seeding, and device selection live in [notebook_setup.py](https://github.com/RosettaCommons/tmol/blob/main/docs/tutorial/notebook_setup.py)." ] }, { "cell_type": "code", "execution_count": 1, "id": "48adfbb3", "metadata": { "execution": { "iopub.execute_input": "2026-10-20T01:12:11.000094Z", "iopub.status.busy": "2026-10-20T01:12:10.999923Z", "iopub.status.idle": "2026-10-20T01:12:17.812709Z", "shell.execute_reply": "2026-10-20T01:12:17.811988Z" }, "tags": [ "collapse-code" ] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Environment variable CCD_MIRROR_PATH not set. Will not be able to use function requiring this variable. To set it you may:\n", " (1) add the line 'export VAR_NAME=path/to/variable' to your .bashrc or .zshrc file\n", " (2) set it in your current shell with 'export VAR_NAME=path/to/variable'\n", " (3) write it to a .env file in the root of the atomworks.io repository\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Environment variable PDB_MIRROR_PATH not set. Will not be able to use function requiring this variable. To set it you may:\n", " (1) add the line 'export VAR_NAME=path/to/variable' to your .bashrc or .zshrc file\n", " (2) set it in your current shell with 'export VAR_NAME=path/to/variable'\n", " (3) write it to a .env file in the root of the atomworks.io repository\n" ] } ], "source": [ "try:\n", " import google.colab # noqa: F401\n", "except ImportError:\n", " IN_COLAB = False\n", "else:\n", " IN_COLAB = True\n", "\n", "if IN_COLAB:\n", " from urllib.request import urlretrieve\n", "\n", " urlretrieve(\n", " \"https://raw.githubusercontent.com/RosettaCommons/tmol/\"\n", " \"main/docs/tutorial/notebook_setup.py\",\n", " \"notebook_setup.py\",\n", " )\n", "\n", "from notebook_setup import * # noqa: F401,F403\n", "\n", "device, param_db = setup()\n" ] }, { "cell_type": "markdown", "id": "3d482b3a", "metadata": {}, "source": [ "We use ubiquitin (1UBQ) as the running example, loaded the same way as in section 1, plus a `ScoreFunction`." ] }, { "cell_type": "code", "execution_count": 2, "id": "2c29efb4", "metadata": { "execution": { "iopub.execute_input": "2026-10-20T01:12:17.815071Z", "iopub.status.busy": "2026-10-20T01:12:17.814643Z", "iopub.status.idle": "2026-10-20T01:12:21.971485Z", "shell.execute_reply": "2026-10-20T01:12:21.970899Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "n_poses=1, max_n_blocks=76\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/runner/work/tmol/tmol/.venv/lib/python3.12/site-packages/biotite/structure/io/pdb/file.py:629: DeprecationWarning: The chararray class is deprecated and will be removed in a future release. Use an ndarray with a string or bytes dtype instead.\n", " record = np.char.array(np.where(array.hetero, \"HETATM\", \"ATOM\"))\n" ] }, { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.