This notebook showcases some of the interactive plotting functions
plotNetwork_interactive in AESOP using the Barnase-Barstar Alascan example.The sample code below imports the relevant classes and functions to run an alanine scan and output the results using interactive plots.
Before proceeding, make sure you have the python packages
networkx installed as described in the documentation.
In [ ]:from aesop import Alascan, plotScan_interactive, plotNetwork_interactive path_apbs = 'path\to\executable\apbs' path_coulomb = 'path\to\executable\coulomb' path_pdb2pqr = 'path\to\executable\pdb2pqr' jobname = 'alascan' pdbfile = 'barnase_barstar.pdb' selstr = ['chain A', 'chain B'] alascan = Alascan(pdb=pdbfile, pdb2pqr_exe=path_pdb2pqr, apbs_exe=path_apbs, coulomb_exe=path_coulomb, jobname=jobname, selstr=selstr, minim=False) alascan = Alascan(pdb=pdbfile, jobname=jobname, selstr=selstr) alascan.run()
Once Alascan is instantiated and finished running, we can plot the results. The
plotScan_interactive function by default, outputs the results in an html file and opens it up in your browser. However, if you are using a notebook to view it, you can display the plot inline by passing the argument
display_output='notebook' to the function. Here we display it in the notebook so that it's easier to view alongside the code.
In :plotScan_interactive(alascan,display_output='notebook') #If you are not using a notebook to run your code then use the code below instead: #plotScan_interactive(alascan)
This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x2,y2 ]
plotScan_interactive function displays a bar plot similar to
plotScan but now hovering over specific bars displays the corresponding asssociation/solvation free energy values. 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.
plotNetwork_interactive provides similar functionality but for network plots.
In :plotNetwork_interactive(alascan,display_output='notebook') #If you are not using a notebook to run your code then use the code below instead: #plotNetwork_interactive(alascan)
@> 3159 atoms and 1 coordinate sets were parsed in 0.03s. DEBUG:.prody:3159 atoms and 1 coordinate sets were parsed in 0.03s.