A simple pip-installable Python module to generate pretty 3D visualizations of molecular orbitals like the one below:
VMDCube is designed to work with VMD (Visual Molecular Dynamics) and can render isocountour surfaces saved in the standard cube file format. VMDCube can visualize molecular orbitals, electron density, and other volumetric data.
VMDCube can be used in Python scripts and Jupyter notebooks to render cube files. Here is an example of how to use it in Python:
from vmdcube import VMDCube
vmd = VMDCube() # by default, render all cube files in the current directory
vmd.run()The following showcases VMDCube's visualization capabilities in Jupyter notebooks:
VMDCube is available on PyPI and can be installed using pip:
pip install vmdcubeVMDCube requires the environment variable VMDPATH to be set to the location of the VMD executable.
For example, if you’re using zsh and the VMD executable is /Applications/VMD 1.9.4a55-arm64-Rev11.app/Contents/vmd/vmd_MACOSXARM64, set VMDPATH to this value in your shell configuration file.
For example, for zsh add this line to your ~/.zshrc file:
export VMDPATH=/Applications/VMD\ 1.9.4a55-arm64-Rev11.app/Contents/vmd/vmd_MACOSXARM64After updating ~/.zshrc, either restart your terminal or run the following so the change takes effect:
source ~/.zshrcVMDCube requires VMD to be installed on your system. You can download VMD from the official website: VMD Download.
Clone the repository, then run:
git clone git@github.com:fevangelista/VMDCube.git
cd VMDCube
pip install -e .See the VMDCube introductory tutorial for how to use VMDCube in Jupyter notebooks and available rendering options.