{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# LTP ElecSimilarity Interactive Plotting Demo" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook showcases the interactive plotting function `plotESD_interactive` in AESOP using the [LTP plant proteins ElecSimilarity example](https://aesop.readthedocs.io/en/latest/elecsimilarity.html#example-case-1-ltp-plant-proteins).The sample code below imports the relevant classes and functions to perform Electrostatic Similarity analysis and output the results using interactive plots.\n", "\n", "Before proceeding, make sure you have the python packages `plotly` and `networkx` installed as described in the [documentation](https://aesop.readthedocs.io/en/latest/installation.html)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from aesop import ElecSimilarity, plotESD_interactive\n", "\n", "path_apbs = 'path\\to\\executable\\apbs'\n", "path_coulomb = 'path\\to\\executable\\coulomb'\n", "path_pdb2pqr = 'path\\to\\executable\\pdb2pqr'\n", "\n", "pdbfiles = ['1MZL.pdb', 'SCA1.pdb', 'SCA3.pdb']\n", "jobname = 'LTP_test1'\n", "\n", "family = ElecSimilarity(pdbfiles=pdbfiles,\n", " pdb2pqr_exe=path_pdb2pqr,\n", " apbs_exe=path_apbs,\n", " jobname=jobname)\n", "\n", "family.run(superpose=True, center=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once ElecSimilarity is instantiated and finished running, we can plot the results. The `plotESD_interactive` by default, outputs the results in an html file and opens it up in your browser. However, if you are using a [notebook](https://jupyter.org/) to view it, you can display the plot inline by passing the argument `display_output='notebook'` to the function.\n", "\n", "The `plotESD_interactive` function combines the heatmap and dendrogram functionality of `plotDend` and `plotESD` but now hovering over specific regions displays the corresponding ESD. Additionally, clicking and dragging in the plot allows you to zoom in a subset of values. The plotly modebar in the top right has additional options such as zoom, autoscale and saving as a static image." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plotESD_interactive(family,display_output='notebook')\n", "#If you are not using a notebook to run your code then use the code below instead:\n", "#plotESD_interactive(family)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }