|
100 | 100 | "source": [ |
101 | 101 | "# Interactive Graphics\n", |
102 | 102 | "\n", |
103 | | - "In addition to mixing documentation with interactive Python, the notebook also allows Python modules to embed interactive graphics. For example, the [BioSimSpace Project](https://biosimspace.org) provides a easy wrapper around the Python molecular viewer [nglview](https://github.com/arose/nglview. This can be used to view molecules from within a notebook.\n", |
| 103 | + "In addition to mixing documentation with interactive Python, the notebook also allows Python modules to embed interactive graphics. For example, the [BioSimSpace Project](https://biosimspace.org) provides a easy wrapper around the Python molecular viewer [nglview](https://github.com/arose/nglview). This can be used to view molecules from within a notebook.\n", |
104 | 104 | "\n", |
105 | 105 | "Execute the cell below by selecting it and pressing SHIFT+Return. This will import the `viewMolecules` function from BioSimSpace, which will load the molecules contained in the file `data/complex.pdb` and will display it below." |
106 | 106 | ] |
107 | 107 | }, |
108 | 108 | { |
109 | 109 | "cell_type": "code", |
110 | | - "execution_count": 10, |
111 | | - "metadata": {}, |
112 | | - "outputs": [ |
113 | | - { |
114 | | - "name": "stdout", |
115 | | - "output_type": "stream", |
116 | | - "text": [ |
117 | | - "Reading molecules from '['data/complex.pdb']'\n", |
118 | | - "Rendering the molecules...\n" |
119 | | - ] |
120 | | - }, |
121 | | - { |
122 | | - "data": { |
123 | | - "application/vnd.jupyter.widget-view+json": { |
124 | | - "model_id": "6b81714c36a1440fbccb764310f1bcd4", |
125 | | - "version_major": 2, |
126 | | - "version_minor": 0 |
127 | | - }, |
128 | | - "text/html": [ |
129 | | - "<p>Failed to display Jupyter Widget of type <code>NGLWidget</code>.</p>\n", |
130 | | - "<p>\n", |
131 | | - " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", |
132 | | - " that the widgets JavaScript is still loading. If this message persists, it\n", |
133 | | - " likely means that the widgets JavaScript library is either not installed or\n", |
134 | | - " not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", |
135 | | - " Widgets Documentation</a> for setup instructions.\n", |
136 | | - "</p>\n", |
137 | | - "<p>\n", |
138 | | - " If you're reading this message in another frontend (for example, a static\n", |
139 | | - " rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", |
140 | | - " it may mean that your frontend doesn't currently support widgets.\n", |
141 | | - "</p>\n" |
142 | | - ], |
143 | | - "text/plain": [ |
144 | | - "NGLWidget()" |
145 | | - ] |
146 | | - }, |
147 | | - "metadata": {}, |
148 | | - "output_type": "display_data" |
149 | | - }, |
150 | | - { |
151 | | - "data": { |
152 | | - "application/vnd.jupyter.widget-view+json": { |
153 | | - "model_id": "f134df58e2d54ffca895157cfd7e8479", |
154 | | - "version_major": 2, |
155 | | - "version_minor": 0 |
156 | | - }, |
157 | | - "text/html": [ |
158 | | - "<p>Failed to display Jupyter Widget of type <code>Tab</code>.</p>\n", |
159 | | - "<p>\n", |
160 | | - " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", |
161 | | - " that the widgets JavaScript is still loading. If this message persists, it\n", |
162 | | - " likely means that the widgets JavaScript library is either not installed or\n", |
163 | | - " not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", |
164 | | - " Widgets Documentation</a> for setup instructions.\n", |
165 | | - "</p>\n", |
166 | | - "<p>\n", |
167 | | - " If you're reading this message in another frontend (for example, a static\n", |
168 | | - " rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", |
169 | | - " it may mean that your frontend doesn't currently support widgets.\n", |
170 | | - "</p>\n" |
171 | | - ], |
172 | | - "text/plain": [ |
173 | | - "Tab(children=(Box(children=(Box(children=(Box(children=(Label(value='step'), IntSlider(value=1, min=-100)), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='delay'), IntSlider(value=100, max=1000, min=10)), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='background'), ColorPicker(value='white')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='camera'), Dropdown(options=('perspective', 'orthographic'), value='perspective')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value=''), HBox(children=(ToggleButton(value=False, description='Smoothing', tooltip='smoothing trajectory'), Button(description=' Center', icon='bullseye', style=ButtonStyle()), Button(description=' Screenshot', icon='camera', style=ButtonStyle()), Button(description='qtconsole', style=ButtonStyle(), tooltip='pop up qtconsole')), layout=Layout(flex='1 1 auto', width='auto'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between'))), layout=Layout(align_items='stretch', display='flex', flex_flow='column', width='100%')),)), Box(), Box(), Box(), Box(), Box()), layout=Layout(align_items='stretch', align_self='center'), _titles={'2': 'Preference', '3': 'Theme', '1': 'Representation', '0': 'General', '5': 'Help', '4': 'Extra'})" |
174 | | - ] |
175 | | - }, |
176 | | - "metadata": {}, |
177 | | - "output_type": "display_data" |
178 | | - } |
179 | | - ], |
| 110 | + "execution_count": null, |
| 111 | + "metadata": {}, |
| 112 | + "outputs": [], |
180 | 113 | "source": [ |
181 | 114 | "from BioSimSpace import viewMolecules\n", |
182 | 115 | "v = viewMolecules(\"data/complex.pdb\")" |
|
247 | 180 | "You can create your own cells in two different ways;\n", |
248 | 181 | "\n", |
249 | 182 | "* either by pressing SHIFT+Return on the last cell (which creates a new cell at the bottom of the notebook),\n", |
250 | | - "* or by click \"Insert | Cell Above\" or \"Insert | Cell Below\" to insert a new cell above or below the currently selected cell.\n", |
| 183 | + "* or by clicking \"Insert | Cell Above\" or \"Insert | Cell Below\" from the menu to insert a new cell above or below the currently selected cell.\n", |
251 | 184 | "\n", |
252 | 185 | "You can choose whether this should be a code or documentation (markdown) cell by selecting the appropriate value from the drop-down at the top.\n", |
253 | 186 | "\n", |
|
360 | 293 | "source": [ |
361 | 294 | "# Running external programs in a code cell\n", |
362 | 295 | "\n", |
363 | | - "You can do more than just execute Python in the code cells. You can run *any command* you want! Just put an exclamation mark first, and then type the command as you would normally in any shell. For example, the below cell is running `ls`" |
| 296 | + "You can do more than just execute Python in the code cells. You can run *any command* you want! Just put an exclamation mark first, and then type the command normally as you would in a terminal. For example, the below cell is running `ls`" |
364 | 297 | ] |
365 | 298 | }, |
366 | 299 | { |
367 | 300 | "cell_type": "code", |
368 | | - "execution_count": 7, |
369 | | - "metadata": {}, |
370 | | - "outputs": [ |
371 | | - { |
372 | | - "name": "stdout", |
373 | | - "output_type": "stream", |
374 | | - "text": [ |
375 | | - "01_jupyter_howto.ipynb\tdata images LICENSE\r\n" |
376 | | - ] |
377 | | - } |
378 | | - ], |
| 301 | + "execution_count": null, |
| 302 | + "metadata": {}, |
| 303 | + "outputs": [], |
379 | 304 | "source": [ |
380 | 305 | "! ls" |
381 | 306 | ] |
|
389 | 314 | }, |
390 | 315 | { |
391 | 316 | "cell_type": "code", |
392 | | - "execution_count": 5, |
393 | | - "metadata": {}, |
394 | | - "outputs": [ |
395 | | - { |
396 | | - "name": "stdout", |
397 | | - "output_type": "stream", |
398 | | - "text": [ |
399 | | - "MIT License\r\n", |
400 | | - "\r\n", |
401 | | - "Copyright (c) 2018 CCPBioSim\r\n", |
402 | | - "\r\n", |
403 | | - "Permission is hereby granted, free of charge, to any person obtaining a copy\r\n", |
404 | | - "of this software and associated documentation files (the \"Software\"), to deal\r\n", |
405 | | - "in the Software without restriction, including without limitation the rights\r\n", |
406 | | - "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n", |
407 | | - "copies of the Software, and to permit persons to whom the Software is\r\n", |
408 | | - "furnished to do so, subject to the following conditions:\r\n", |
409 | | - "\r\n", |
410 | | - "The above copyright notice and this permission notice shall be included in all\r\n", |
411 | | - "copies or substantial portions of the Software.\r\n", |
412 | | - "\r\n", |
413 | | - "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n", |
414 | | - "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n", |
415 | | - "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n", |
416 | | - "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n", |
417 | | - "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n", |
418 | | - "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n", |
419 | | - "SOFTWARE.\r\n" |
420 | | - ] |
421 | | - } |
422 | | - ], |
| 317 | + "execution_count": null, |
| 318 | + "metadata": {}, |
| 319 | + "outputs": [], |
423 | 320 | "source": [ |
424 | 321 | "! cat LICENSE" |
425 | 322 | ] |
|
433 | 330 | }, |
434 | 331 | { |
435 | 332 | "cell_type": "code", |
436 | | - "execution_count": 8, |
| 333 | + "execution_count": null, |
437 | 334 | "metadata": {}, |
438 | 335 | "outputs": [], |
439 | 336 | "source": [ |
|
442 | 339 | }, |
443 | 340 | { |
444 | 341 | "cell_type": "code", |
445 | | - "execution_count": 11, |
446 | | - "metadata": {}, |
447 | | - "outputs": [ |
448 | | - { |
449 | | - "name": "stdout", |
450 | | - "output_type": "stream", |
451 | | - "text": [ |
452 | | - "Reading molecules from '['dioxin.pdb']'\n", |
453 | | - "Rendering the molecules...\n" |
454 | | - ] |
455 | | - }, |
456 | | - { |
457 | | - "data": { |
458 | | - "application/vnd.jupyter.widget-view+json": { |
459 | | - "model_id": "3897e864bd424f339fc3bf61654d589c", |
460 | | - "version_major": 2, |
461 | | - "version_minor": 0 |
462 | | - }, |
463 | | - "text/html": [ |
464 | | - "<p>Failed to display Jupyter Widget of type <code>NGLWidget</code>.</p>\n", |
465 | | - "<p>\n", |
466 | | - " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", |
467 | | - " that the widgets JavaScript is still loading. If this message persists, it\n", |
468 | | - " likely means that the widgets JavaScript library is either not installed or\n", |
469 | | - " not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", |
470 | | - " Widgets Documentation</a> for setup instructions.\n", |
471 | | - "</p>\n", |
472 | | - "<p>\n", |
473 | | - " If you're reading this message in another frontend (for example, a static\n", |
474 | | - " rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", |
475 | | - " it may mean that your frontend doesn't currently support widgets.\n", |
476 | | - "</p>\n" |
477 | | - ], |
478 | | - "text/plain": [ |
479 | | - "NGLWidget()" |
480 | | - ] |
481 | | - }, |
482 | | - "metadata": {}, |
483 | | - "output_type": "display_data" |
484 | | - }, |
485 | | - { |
486 | | - "data": { |
487 | | - "application/vnd.jupyter.widget-view+json": { |
488 | | - "model_id": "7b724428058b405cad46effdd764403f", |
489 | | - "version_major": 2, |
490 | | - "version_minor": 0 |
491 | | - }, |
492 | | - "text/html": [ |
493 | | - "<p>Failed to display Jupyter Widget of type <code>Tab</code>.</p>\n", |
494 | | - "<p>\n", |
495 | | - " If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n", |
496 | | - " that the widgets JavaScript is still loading. If this message persists, it\n", |
497 | | - " likely means that the widgets JavaScript library is either not installed or\n", |
498 | | - " not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n", |
499 | | - " Widgets Documentation</a> for setup instructions.\n", |
500 | | - "</p>\n", |
501 | | - "<p>\n", |
502 | | - " If you're reading this message in another frontend (for example, a static\n", |
503 | | - " rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n", |
504 | | - " it may mean that your frontend doesn't currently support widgets.\n", |
505 | | - "</p>\n" |
506 | | - ], |
507 | | - "text/plain": [ |
508 | | - "Tab(children=(Box(children=(Box(children=(Box(children=(Label(value='step'), IntSlider(value=1, min=-100)), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='delay'), IntSlider(value=100, max=1000, min=10)), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='background'), ColorPicker(value='white')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value='camera'), Dropdown(options=('perspective', 'orthographic'), value='perspective')), layout=Layout(display='flex', flex_flow='row', justify_content='space-between')), Box(children=(Label(value=''), HBox(children=(ToggleButton(value=False, description='Smoothing', tooltip='smoothing trajectory'), Button(description=' Center', icon='bullseye', style=ButtonStyle()), Button(description=' Screenshot', icon='camera', style=ButtonStyle()), Button(description='qtconsole', style=ButtonStyle(), tooltip='pop up qtconsole')), layout=Layout(flex='1 1 auto', width='auto'))), layout=Layout(display='flex', flex_flow='row', justify_content='space-between'))), layout=Layout(align_items='stretch', display='flex', flex_flow='column', width='100%')),)), Box(), Box(), Box(), Box(), Box()), layout=Layout(align_items='stretch', align_self='center'), _titles={'2': 'Preference', '3': 'Theme', '1': 'Representation', '0': 'General', '5': 'Help', '4': 'Extra'})" |
509 | | - ] |
510 | | - }, |
511 | | - "metadata": {}, |
512 | | - "output_type": "display_data" |
513 | | - }, |
514 | | - { |
515 | | - "data": { |
516 | | - "text/plain": [ |
517 | | - "<BioSimSpace.Notebook.view.View at 0x7f6180924240>" |
518 | | - ] |
519 | | - }, |
520 | | - "execution_count": 11, |
521 | | - "metadata": {}, |
522 | | - "output_type": "execute_result" |
523 | | - } |
524 | | - ], |
| 342 | + "execution_count": null, |
| 343 | + "metadata": {}, |
| 344 | + "outputs": [], |
525 | 345 | "source": [ |
526 | 346 | "from BioSimSpace import viewMolecules # importing again in case we restarted the kernel\n", |
527 | 347 | "viewMolecules(\"dioxin.pdb\")" |
|
573 | 393 | "\n", |
574 | 394 | "\n", |
575 | 395 | "\n", |
576 | | - "Alternatively, you can go to the \"Running\" tab to see everything of your's that is currently running in the hub.\n", |
| 396 | + "Alternatively, you can go to the \"Running\" tab to see everything of your's that is currently running in the hub. Click the \"Shutdown\" button on the right for anything that you aren't using and want to shut down.\n", |
577 | 397 | "\n", |
578 | 398 | "\n", |
579 | 399 | "\n", |
580 | | - "You can use the hub to download files by selecting them and clicking the \"Download\" button that will appear. Other buttons will appear depending on the type of file, e.g. \"Duplicate\", \"View\", \"Edit\" etc. The bin icon will delete the file.\n", |
| 400 | + "Back in the \"Files\" tab, clicking the checkbox next to a file brings up buttons that let you download files. You can use the hub to download files by selecting them and clicking the \"Download\" button that will appear. Other buttons will appear depending on the type of file, e.g. \"Duplicate\", \"View\", \"Edit\" etc. The bin icon will delete the file.\n", |
581 | 401 | "\n", |
582 | 402 | "\n", |
583 | 403 | "\n", |
|
607 | 427 | "* `wham` and `wham-2d` : Tools used for weighted histogram analysis\n", |
608 | 428 | "* `Sire` and `BioSimSpace` : The [Sire](https://siremol.org) and [BioSimSpace](https://biosimspace.org) python simulation framework and workflow node packages.\n", |
609 | 429 | "\n", |
610 | | - "The cloud server was build with docker. If you want to download it yourself to run on your own computer then please install docker and type\n", |
| 430 | + "The cloud server was build with docker. If you want to download it yourself to run on your own computer at home after the workshop then please install docker and type\n", |
611 | 431 | "\n", |
612 | 432 | "```\n", |
613 | 433 | "docker run -it --rm -p 8888:8888 chryswoods/bss-workshop:latest\n", |
614 | 434 | "```\n", |
615 | 435 | "\n", |
616 | | - "This will download and run the image from dockerhub and will make it available at the web address that will be printed to the screen (e.g. it will look something like `SOMETHING`). You can see and download the DockerFile used to generate this image [from here](https://github.com/michellab/BioSimSpaceWebsite/tree/master/docker/bss-workshop).\n", |
| 436 | + "This will download and run the image from dockerhub and will make it available at the web address that will be printed to the screen (e.g. it will look something like `http://localhost:8888/?token=641396480e6421eae8b18261d82a75f958fe166e1c8b20a8`). Simply open that address in your browser :-). You can see and download the DockerFile used to generate this image [from here](https://github.com/michellab/BioSimSpaceWebsite/tree/master/docker/bss-workshop).\n", |
617 | 437 | "\n", |
618 | 438 | "Thanks to the [Microsoft Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/) on which this Jupyter image is running." |
619 | 439 | ] |
|
0 commit comments