Visualize a PDB structure, set styles, and add labels.
import py3Dmol
Instantiate py3Dmol viewer with PDB structure 1NCA (Neuraminidase-FAB complex)
viewer = py3Dmol.view(query='pdb:1NCA')
viewer.show()
You appear to be running in JupyterLab. You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
Apply the following styles to this structure:
viewer.setStyle({'chain':'N'},{'cartoon': {'color': 'orange'}})
viewer.setStyle({'chain':'H'},{'sphere': {'color': 'blue'}})
viewer.setStyle({'chain':'L'},{'sphere': {'color': 'lightblue'}})
viewer.show()
You appear to be running in JupyterLab. You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
viewer.addLabel('Neuraminidase', {'fontColor':'orange', 'backgroundColor':'lightgray'},
{'chain': 'N'})
viewer.addLabel('Heavy chain', {'fontColor':'blue', 'backgroundColor':'lightgray'},
{'chain': 'H'})
viewer.addLabel('Light chain', {'fontColor':'blue', 'backgroundColor':'lightgray'},
{'chain': 'L'})
viewer.show()
You appear to be running in JupyterLab. You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
viewer.setStyle({'resn': ['MAN', 'BMA', 'NAG']}, {'stick':{'colorscheme': 'greenCarbon'}})
viewer.show()
You appear to be running in JupyterLab. You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol