Harnessing Molecular Data for 3D Visualization

Digital molecule models are described in a data format that is not specifically designed for describing molecules in three dimensions. In fact, they can do this, and much more. There are several molecular visualization tools that use that data to great effect for many biology-related use cases, including various ways to style components of a molecule. I will focus on one tool that I find is the best one to work with: Chimera X. not that if you are looking for a way to work with molecular data directly inside a 3D editor such as Blender, skip to the bottom of this post for a recommendation.

It would be unreasonable to expect a molecule data format and associated visualization to render images on par with advanced 3D platforms like Blender or Maya. They come surprisingly close. To use molecular data to create 3D experiences, such as Virtual Reality, the visualization tools can be used to set up the “look” of a molecule and then export it to a format a 3D IDE can understand. Specific features supported by different output formats vary within and between visualization tools. Expect to experiment to find a format that can preserve the specific properties of a molecule that might be needed during an experience: peptide chains, residues, Cartoon style vs ball-and-stick…

A technical artist will also want to work out how to reliably repeat exports for specialized use cases efficiently. In Chimera, this can be done by creating a script based on a log that it generates while executing commands. Any command from the UI or command line are echoed to the log and can be saved. Scripts are plain text files with a command per line in the order of execution.

To preserve individual chains in a 3D Model I exported each as a separate .pdb file. .pdb is the only format that includes the option to save out the current selection. This requires some settings to preserve the origin when opening them in Maya or Blender so that they maintain their relative positions to each other after import. .PDB requires a plugin in the 3D software to import, such as Molecular Maya.

I found that I could open and edit the .PDB data file to split the chains by their delimiters. Comparing the data files from the text editing vs the selection export, I found they were exactly the same. Either approach lends itself to scripting if there is the need to process more than a few files.

.cif file format in Chimera X with expanded model hierarchy on Right.
Selecting a chain
Saving a chain as .PDB
Install an Add-on/Extension to import .pdb files in your 3D editor
Uncheck Object to origin to retain the model registration so that chains will align
.pdb file imports result in a nice chain hierarchy but all the models are ball-and-stick style.
.glb format preserves model style shapes, but does not support saving sub-selections
.glb will make a heirarchy if each chain has a different model display style.

I didn’t think I would find a molecule-model-oriented extension for Blender or Maya, but was pleasantly suprised by MolecularNodes Blender Add-on. MolecularNodes moves the Python code used in Chimera into the geometry nodes of Blender, resulting in a very powerful integration with no dependency on any external application. It handles fetching molecule data files from multiple sources, managing the display styles, textures, colors and so forth. Because it is editable in geometry nodes it allows someone with Blender experience to take the implementation further than could be done in other tools.

I plan to write more about Molecular Nodes and other integrations to 3D editors in the future.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.