Skip to content

Commit

Permalink
talk 50% complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwoods2 committed Nov 29, 2024
1 parent e49599b commit 963ef4c
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 171 deletions.
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
"build": { "dockerfile": "Dockerfile" },
"customizations": {
"vscode": {
"extensions": ["ms-python.python", "ms-toolsai.jupyter"],
"extensions": ["ms-python.python", "ms-toolsai.jupyter", "donjayamanne.vscode-default-python-kernel"],
"settings": {
"python.defaultInterpreterPath": "/opt/conda/envs/workshop/bin/python",
"jupyter.defaultKernel": "workshop"
"python.defaultInterpreterPath": "/opt/conda/envs/workshop/bin/python"
}
}
},
Expand Down
111 changes: 42 additions & 69 deletions activity/activity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,9 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [
{
"ename": "ConnectionError",
"evalue": "IMDClient: No handshake packet received",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m~/workspace/imdclient/imdclient/utils.py:89\u001b[0m, in \u001b[0;36mread_into_buf\u001b[0;34m(sock, buf)\u001b[0m\n\u001b[1;32m 88\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 89\u001b[0m received \u001b[38;5;241m=\u001b[39m sock\u001b[38;5;241m.\u001b[39mrecv_into(view[total_received:])\n\u001b[1;32m 90\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m received \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n",
"\u001b[0;31mTimeoutError\u001b[0m: timed out",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mTimeoutError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m~/workspace/imdclient/imdclient/IMDClient.py:226\u001b[0m, in \u001b[0;36mIMDClient._await_IMD_handshake\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 225\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 226\u001b[0m read_into_buf(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_conn, h_buf)\n\u001b[1;32m 227\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (\u001b[38;5;167;01mConnectionError\u001b[39;00m, \u001b[38;5;167;01mTimeoutError\u001b[39;00m, \u001b[38;5;167;01mException\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n",
"File \u001b[0;32m~/workspace/imdclient/imdclient/utils.py:97\u001b[0m, in \u001b[0;36mread_into_buf\u001b[0;34m(sock, buf)\u001b[0m\n\u001b[1;32m 96\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mread_into_buf excepting due to read timeout\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 97\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTimeoutError\u001b[39;00m\n\u001b[1;32m 98\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBlockingIOError\u001b[39;00m:\n",
"\u001b[0;31mTimeoutError\u001b[0m: ",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mConnectionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[2], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mimdclient\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mIMD\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m IMDReader\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mMDAnalysis\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mmda\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m u \u001b[38;5;241m=\u001b[39m mda\u001b[38;5;241m.\u001b[39mUniverse(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msample_simulation/imdgroup.gro\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mimd://localhost:8889\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 6\u001b[0m \u001b[38;5;66;03m# Get an atom from the topology\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;66;03m# Universe -> AtomGroup -> Atom\u001b[39;00m\n\u001b[1;32m 8\u001b[0m atom \u001b[38;5;241m=\u001b[39m u\u001b[38;5;241m.\u001b[39matoms[\u001b[38;5;241m0\u001b[39m]\n",
"File \u001b[0;32m~/anaconda3/envs/imdclient-test/lib/python3.12/site-packages/MDAnalysis/core/universe.py:375\u001b[0m, in \u001b[0;36mUniverse.__init__\u001b[0;34m(self, topology, all_coordinates, format, topology_format, transformations, guess_bonds, vdwradii, fudge_factor, lower_bound, in_memory, in_memory_step, *coordinates, **kwargs)\u001b[0m\n\u001b[1;32m 370\u001b[0m coordinates \u001b[38;5;241m=\u001b[39m _resolve_coordinates(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfilename, \u001b[38;5;241m*\u001b[39mcoordinates,\n\u001b[1;32m 371\u001b[0m \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mformat\u001b[39m,\n\u001b[1;32m 372\u001b[0m all_coordinates\u001b[38;5;241m=\u001b[39mall_coordinates)\n\u001b[1;32m 374\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m coordinates:\n\u001b[0;32m--> 375\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_new(coordinates, \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mformat\u001b[39m, in_memory\u001b[38;5;241m=\u001b[39min_memory,\n\u001b[1;32m 376\u001b[0m in_memory_step\u001b[38;5;241m=\u001b[39min_memory_step, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 378\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m transformations:\n\u001b[1;32m 379\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcallable\u001b[39m(transformations):\n",
"File \u001b[0;32m~/anaconda3/envs/imdclient-test/lib/python3.12/site-packages/MDAnalysis/core/universe.py:580\u001b[0m, in \u001b[0;36mUniverse.load_new\u001b[0;34m(self, filename, format, in_memory, in_memory_step, **kwargs)\u001b[0m\n\u001b[1;32m 577\u001b[0m \u001b[38;5;66;03m# supply number of atoms for readers that cannot do it for themselves\u001b[39;00m\n\u001b[1;32m 578\u001b[0m kwargs[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mn_atoms\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39matoms\u001b[38;5;241m.\u001b[39mn_atoms\n\u001b[0;32m--> 580\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtrajectory \u001b[38;5;241m=\u001b[39m reader(filename, \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mformat\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 581\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtrajectory\u001b[38;5;241m.\u001b[39mn_atoms \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39matoms):\n\u001b[1;32m 582\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe topology and \u001b[39m\u001b[38;5;132;01m{form}\u001b[39;00m\u001b[38;5;124m trajectory files don\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 583\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m have the same number of atoms!\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 584\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mTopology number of atoms \u001b[39m\u001b[38;5;132;01m{top_n_atoms}\u001b[39;00m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 588\u001b[0m fname\u001b[38;5;241m=\u001b[39mfilename,\n\u001b[1;32m 589\u001b[0m trj_n_atoms\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtrajectory\u001b[38;5;241m.\u001b[39mn_atoms))\n",
"File \u001b[0;32m~/anaconda3/envs/imdclient-test/lib/python3.12/site-packages/MDAnalysis/lib/util.py:2553\u001b[0m, in \u001b[0;36mstore_init_arguments.<locals>.wrapper\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2551\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2552\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_kwargs[key] \u001b[38;5;241m=\u001b[39m arg\n\u001b[0;32m-> 2553\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"File \u001b[0;32m~/workspace/imdclient/imdclient/IMD.py:62\u001b[0m, in \u001b[0;36mIMDReader.__init__\u001b[0;34m(self, filename, convert_units, n_atoms, **kwargs)\u001b[0m\n\u001b[1;32m 59\u001b[0m host, port \u001b[38;5;241m=\u001b[39m parse_host_port(filename)\n\u001b[1;32m 61\u001b[0m \u001b[38;5;66;03m# This starts the simulation\u001b[39;00m\n\u001b[0;32m---> 62\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_imdclient \u001b[38;5;241m=\u001b[39m IMDClient(host, port, n_atoms, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 64\u001b[0m imdsinfo \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_imdclient\u001b[38;5;241m.\u001b[39mget_imdsessioninfo()\n\u001b[1;32m 65\u001b[0m \u001b[38;5;66;03m# NOTE: after testing phase, fail out on IMDv2\u001b[39;00m\n",
"File \u001b[0;32m~/workspace/imdclient/imdclient/IMDClient.py:65\u001b[0m, in \u001b[0;36mIMDClient.__init__\u001b[0;34m(self, host, port, n_atoms, socket_bufsize, multithreaded, **kwargs)\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_stopped \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m 64\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_connect_to_server(host, port, socket_bufsize)\n\u001b[0;32m---> 65\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_imdsinfo \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_await_IMD_handshake()\n\u001b[1;32m 66\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_multithreaded \u001b[38;5;241m=\u001b[39m multithreaded\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_multithreaded:\n",
"File \u001b[0;32m~/workspace/imdclient/imdclient/IMDClient.py:229\u001b[0m, in \u001b[0;36mIMDClient._await_IMD_handshake\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 227\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m (\u001b[38;5;167;01mConnectionError\u001b[39;00m, \u001b[38;5;167;01mTimeoutError\u001b[39;00m, \u001b[38;5;167;01mException\u001b[39;00m) \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 228\u001b[0m logger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIMDClient: No handshake packet received: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, e)\n\u001b[0;32m--> 229\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mConnectionError\u001b[39;00m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIMDClient: No handshake packet received\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 231\u001b[0m header \u001b[38;5;241m=\u001b[39m IMDHeader(h_buf)\n\u001b[1;32m 233\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m header\u001b[38;5;241m.\u001b[39mtype \u001b[38;5;241m!=\u001b[39m IMDHeaderType\u001b[38;5;241m.\u001b[39mIMD_HANDSHAKE:\n",
"\u001b[0;31mConnectionError\u001b[0m: IMDClient: No handshake packet received"
]
}
],
"outputs": [],
"source": [
"from imdclient.IMD import IMDReader\n",
"import MDAnalysis as mda\n",
Expand Down Expand Up @@ -113,23 +86,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/law/anaconda3/envs/imdclient-test/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"At time 0.070 fs, the n-terminus and c-terminus are 20.697 angrstroms apart\r"
]
}
],
"outputs": [],
"source": [
"from imdclient.IMD import IMDReader\n",
"import MDAnalysis as mda\n",
Expand All @@ -151,35 +108,15 @@
"metadata": {},
"source": [
"## Live visualization of an analysis\n",
"\n"
"\n",
"Finally, we'll use matplot to create a live visualization of the distance between the two atoms."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/law/anaconda3/envs/imdclient-test/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
},
{
"ename": "ValueError",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 22\u001b[0m\n\u001b[1;32m 19\u001b[0m nter \u001b[38;5;241m=\u001b[39m u\u001b[38;5;241m.\u001b[39mselect_atoms(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mresid 1 and name CA\u001b[39m\u001b[38;5;124m\"\u001b[39m)\u001b[38;5;241m.\u001b[39matoms[\u001b[38;5;241m0\u001b[39m]\n\u001b[1;32m 20\u001b[0m cter \u001b[38;5;241m=\u001b[39m u\u001b[38;5;241m.\u001b[39mselect_atoms(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mresid 129 and name CA\u001b[39m\u001b[38;5;124m\"\u001b[39m)\u001b[38;5;241m.\u001b[39matoms[\u001b[38;5;241m0\u001b[39m]\n\u001b[0;32m---> 22\u001b[0m graph \u001b[38;5;241m=\u001b[39m LiveScalarGraph(\n\u001b[1;32m 23\u001b[0m time_window\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1.0\u001b[39m, \u001b[38;5;66;03m# ps\u001b[39;00m\n\u001b[1;32m 24\u001b[0m dt\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0.010\u001b[39m, \u001b[38;5;66;03m# ps\u001b[39;00m\n\u001b[1;32m 25\u001b[0m title\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDistance vs. Time\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 26\u001b[0m ylabel\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDistance (Å)\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 27\u001b[0m legend_label\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mNter-Cter\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[1;32m 28\u001b[0m )\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m ts \u001b[38;5;129;01min\u001b[39;00m u\u001b[38;5;241m.\u001b[39mtrajectory:\n\u001b[1;32m 31\u001b[0m distance \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39msqrt(np\u001b[38;5;241m.\u001b[39msum((nter\u001b[38;5;241m.\u001b[39mposition \u001b[38;5;241m-\u001b[39m cter\u001b[38;5;241m.\u001b[39mposition) \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m))\n",
"File \u001b[0;32m~/workspace/imd-workshop-2024/activity/graph_utils.py:9\u001b[0m, in \u001b[0;36mLiveScalarGraph.__init__\u001b[0;34m(self, time_window, dt, title, ylabel, legend_label)\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\u001b[38;5;28mself\u001b[39m, time_window, dt, title\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m, ylabel\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m, legend_label\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m 8\u001b[0m plt\u001b[38;5;241m.\u001b[39mion()\n\u001b[0;32m----> 9\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtime_window \u001b[38;5;241m=\u001b[39m time_window\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mn_times \u001b[38;5;241m=\u001b[39m (\u001b[38;5;28mint\u001b[39m)(time_window \u001b[38;5;241m/\u001b[39m dt)\n",
"\u001b[0;31mValueError\u001b[0m: "
]
}
],
"outputs": [],
"source": [
"from imdclient.IMD import IMDReader\n",
"import numpy as np\n",
Expand All @@ -205,6 +142,42 @@
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Challenge 1\n",
"\n",
"Your first challenge is to implement a new analysis function that calculates the number of water molecules within 4 angstroms of the protein during each timestep.\n",
"\n",
"Bonus points if you can create a live visualization of this data!\n",
"\n",
"*Hint*: \n",
"\n",
"All water molecules in the simulation can be selected like this:\n",
"```python\n",
"u.select_atoms('resname SOL')\n",
"```\n",
"For more advanced selection tips, see the [MDAnalysis documentation](https://userguide.mdanalysis.org/stable/selections.html)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from imdclient.IMD import IMDReader\n",
"import numpy as np\n",
"import MDAnalysis as mda\n",
"from graph_utils import LiveTimeseriesGraph\n",
"\n",
"u = mda.Universe(\"sample_simulation/imdgroup.gro\", \"imd://localhost:8889\")\n",
"\n",
"for ts in u.trajectory:\n",
" ## Your analysis code here"
]
}
],
"metadata": {
Expand Down
16 changes: 0 additions & 16 deletions activity/run.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
#!/bin/bash

## TMP
source /usr/local/gromacs/bin/GMXRC

## WAIT UNTIL PORT IS OPEN
SECONDS=0
while lsof -n -i :8889; do
echo "Waiting for port 8889 to open"
sleep 1

if [ $SECONDS -ge 30 ]; then
echo "Timeout reached. Port 8889 did not open."
exit 1
fi
done

mkdir -p sample_simulation
cd sample_simulation

## RUN GROMPP
Expand Down
Loading

0 comments on commit 963ef4c

Please sign in to comment.