From 25a9dac58378f7aff3e54e7c941edc14ed79bc1e Mon Sep 17 00:00:00 2001 From: Charlie Laughton Date: Wed, 23 Sep 2026 17:12:26 +0100 Subject: [PATCH] Enhance MM-GBSA analysis with progress bar and instructions Updated analysis instructions and improved progress tracking in the MM-GBSA notebook. --- MM-GBSA.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MM-GBSA.ipynb b/MM-GBSA.ipynb index 86e2136..8ef508f 100644 --- a/MM-GBSA.ipynb +++ b/MM-GBSA.ipynb @@ -193,7 +193,7 @@ "\n", "### 6. Gather the MM-GBSA data for each snapshot\n", "\n", - "Assuming there is no indication of a probem, we can now run the full MM-GBSA analysis:" + "Assuming there is no indication of a probem, we can now run the full MM-GBSA analysis. For speed reasons, we will only process every tenth snapshot (feel free to change this if you are running this notebook on a GPU-powered platform):" ] }, { @@ -207,7 +207,9 @@ "r_energies = []\n", "l_energies = []\n", "\n", - "for i in range(t.n_frames):\n", + "from tqdm import tqdm # to give a progress bar\n", + "\n", + "for i in tqdm(range(0, t.n_frames, 10):\n", " c_simulation.context.setPositions(t.xyz[i][complex_atoms] * nanometer)\n", " c_state = c_simulation.context.getState(getEnergy=True)\n", " c_energies.append(c_state.getPotentialEnergy())\n", @@ -265,7 +267,7 @@ "source": [ "energy_unit = interaction_energies[0].unit\n", "inverse_unit = np.array(1/energy_unit)\n", - "plt.plot(t.time, interaction_energies * inverse_unit)\n", + "plt.plot(t.time[::10], interaction_energies * inverse_unit)\n", "plt.ylabel(f'Interaction Energy ({energy_unit.get_symbol()})')\n", "plt.xlabel('time (ps)')" ]