import prody
prot = prody.parsePDB('3UB5')
The default visualization in ProDy uses matplotlib.
%matplotlib inline
prody.showProtein(prot)
<mpl_toolkits.mplot3d.axes3d.Axes3D at 0x10961c2e8>
With the latest version of ProDy, py3Dmol
will be used if it has been imported.
prody.checkUpdates()
import py3Dmol
prody.showProtein(prot)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097a4978>
A number of keyword arguments are supported.
The background color is configurable.
prody.showProtein(prot,backgroundColor="black")
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x109755828>
The height and width of the viewer can be changed.
prody.showProtein(prot, height=400, width=200,backgroundcolor='gray')
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097cfbe0>
The viewer can be zoomed and centered on a given AtomSelectionSpec.
prody.showProtein(prot, zoomto={'resn':'ATP'})
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097cfd30>
Custom styles can be applied by providing AtomSelectionSpec and AtomStyleSpec objects.
A single style may be applied.
prody.showProtein(prot,style={'cartoon':{'colorscheme':'chain'},'stick':{'colorscheme':'chain'}})
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097d7208>
For more complex styling, generate and manipulate the py3Dmol view object directly.
view = prody.view3D(prot)
view.setStyle({'cartoon':{'colorscheme':'chain'}})
view.setStyle({'hetflag':True},{'stick':{'colorscheme':'magentaCarbon'}})
view.setStyle({'bonds': 0},{'sphere':{'radius':0.5}})
view.addLabel('Chain A',{'inFront':True,'showBackground':False,'fontColor':'blue'},{'chain':'A'})
view.addLabel('Chain P',{'inFront':True,'showBackground':False,'fontColor':'green'},{'chain':'P'})
view.show()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
Squared fluctuations (or any other alpha-carbon length numerical vector) can be visualized in a RWB colorscheme. Red values are larger.
gnm, sel = prody.calcGNM(prot,cutoff=7.3)
Individual modes may be visualized.
prody.showProtein(prot,flucts=prody.calcSqFlucts(gnm[0]))
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097d7470>
Styles can still be applied.
prody.showProtein(prot,flucts=gnm[1].getArray(),style={'cartoon':{}})
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097d7860>
It is also possible to provide an array of vectors (one per a calpha) that can be used to animate motions. The animate kwarg takes the 3Dmol.js animate options.
anm, sel = prody.calcANM(prot)
prody.showProtein(prot,vecs=anm[0].getArray(),
flucts=prody.calcSqFlucts(anm[0]),
style={'cartoon':{}})
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097d7b70>
prody.showProtein(prot,prot,flucts=[gnm[1].getArray(),prody.calcSqFlucts(anm[0])],vecs=[anm[0].getArray(),[]])
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1097cffd0>
prody.__version__
'1.10.8'