Interactive visualization of protein–ligand complexes with Py3Dmol

I recently had a problem where I wanted to provide an interactive visualization of multiple different protein–ligand complexes, requiring minimal setup by the user, allowing them to zoom in and out and change the visualization style, without just providing multiple PDB files or a PyMOL session.

To do this, I used Py3Dmol, which was covered in Garrett’s blogpost and has several nice examples in Matteo’s blogpost. While it can be a bit difficult to navigate the documentation, as it is built on 3dmol.js1, a JavaScript library, it can be a nice way to present data in notebooks and integrates nicely with ipywidgets.

For my specific example, I wanted to allow the user to scroll between 3D complexes, change the visualization options (e.g. protein style, ligand style, etc.) and to provide labels for specific atoms for the user to evaluate. I’ve provided an example colab notebook and repo here in case it is helpful for anyone else!

Any tips or alternative suggestions for easy visualization are very welcome!

Refs

  1. Nicholas Rego, David Koes, 3Dmol.js: molecular visualization with WebGL, Bioinformatics, Volume 31, Issue 8, April 2015, Pages 1322–1324, https://doi.org/10.1093/bioinformatics/btu829

Author