This notebook showcases some of the interactive plotting functions
plotNetwork_interactive in AESOP using the Barnase-Barstar Directed Mutagenesis example.The sample code below imports the relevant classes and functions to perform user specified mutations and output the electrostatic analysis results using interactive plots.
Before proceeding, make sure you have the python packages
networkx installed as described in the documentation.
from aesop import DirectedMutagenesis, plotScan_interactive, plotNetwork_interactive path_apbs = 'path\to\executable\apbs' path_coulomb = 'path\to\executable\coulomb' path_pdb2pqr = 'path\to\executable\pdb2pqr' jobname = 'directedscan' pdbfile = 'barnase_barstar.pdb' selstr = ['chain A', 'chain B'] target = ['resnum 27', 'resnum 73', 'resnum 83', 'resnum 87', # mutations in chain A 'resnum 145', 'resnum 149', 'resnum 164', 'resnum 186'] # mutations in chain B mutation = ['ASP', 'LYS', 'GLU', 'GLU', # mutations in chain A 'ARG', 'ARG', 'ASP', 'LYS'] # mutations in chain B mutscan = DirectedMutagenesis(pdb=pdbfile, pdb2pqr_exe=path_pdb2pqr, apbs_exe=path_apbs, coulomb_exe=path_coulomb, jobname=jobname, selstr=selstr, target=target, mutation=mutation, minim=True) mutscan.run()
Once DirectedMutagenesis 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.
plotScan_interactive(mutscan,display_output='notebook') #If you are not using a notebook to run your code then use the code below instead: #plotScan_interactive(mutscan)
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.
plotNetwork_interactive(mutscan,display_output='notebook') #If you are not using a notebook to run your code then use the code below instead: #plotNetwork_interactive(mutscan)
@> 3159 atoms and 1 coordinate sets were parsed in 0.03s. DEBUG:.prody:3159 atoms and 1 coordinate sets were parsed in 0.03s.