Vizualization of 1CPN

Vizualizing the 1CPN model is more chalenging than many other molecular models because each coarse-grained sit in 1CPN in represented by an anisotropic potential. Most vizualization tools (like VMD) are designed for isotropic sites, and generally represent each site by a sphere. Consequently, due to the anisotropic potentials in 1CPN, vizualizing the model requires some additional steps.

The 1CPN model includes offers several workflows for vizualizing 1CPN trajectories. The ideal workflow depends on the type of simulation you have run, and the phenomena of interest that you want the simulation to highlight. Below we describe two approaches for visualizing 1CPN with VMD (Visual Molecular Dynamics) and one approach for high quality vizualization using Blender.

Users who do not have VMD should install it following the instructions at the VMD website (note that VMD 1.9.2 was used in this tutorial).

Throughout this tutorial it is assumed that VMD is accessed though vmd at the command line.

Option 1: Basic VMD

Speed = Fast, Vizualization Quality=Poor

The 1CPN can be quickly vizualized by loading traj.dump directly into LAMMPS.

vmd in.psf -lammpstrj traj.dump

Now that the trajectory is loaded into LAMMPS, a suitable visual representation can be loaded by Opening the Tk console by clicking on Extensions->Tk Console, in the VMD Main window, and executing the following command.

source <path-to-D_1CPN>/1cpn-model//utils/vmd/1cpn.vmd

Note that in this case the bash variable ${D_1CPN} cannot be used and <path-to-D_1CPN> must be hardcoded manually. If you will be vizualizing the 1CPN Model frequently, it is recommended that you add this source command a file located at ~/.vmdrc so that it will be executed automatically when VMD opens.

Though this visualization can be useful for some purposes (like examining bond lengths and angles), it is generally unsuitable for visualizing large simulations.

FIXME make 1cpn.vmd look acceptable for vizualizing the raw traj.dump FIXME SAMPLE VIZUALIZATION

Option 3. Blender

Speed=Low, Vizualization Quality=Very High

The final option for vizualizing the 1CPN model is to use the open source 3D conputer graphics toolset Blender. Blender is a very powerful flexible tool for vizualization and premits the customization of virtually any feature of a digital vizualization. Blender is not strictly designed for molecular vizualizaiton, and therefore

This tutorial assumes a basic familiarity with Blender

FIXME Is blender okay for many frames

FIXME Clean up front of Blender script so that its easier for a new person

  1. Setting up file paths and rendering options.

The main script of interest is ${D_1CPN}/1cpn-model/utils/blender/import_dump.py and cha

PATH_ZEWDIE = PATH_TRAJ =

::
cd /tmp ln -s ${D_1CPN}/example/in.dump frame.dump
  1. Open blender, and change the bottom pannel to text editor
_images/viz_blender-1.png
  1. In the Text Editor window, click the Open button, and navigate to ${D_1CPN}/1cpn-model/utils/blender/import_dump.py. Once the file is loaded, click the Run Script button. This could take a minute or two to run.
_images/viz_blender-2.png
  1. Now the 1CPN Model should be loaded into Blender.
_images/viz_blender-3.png
  1. To see the artistic rendering, move your mouse into the 3D View panel and press Shift-Z to turn on Materials Rendering (or select Viewport Shading -> Rendered using your mouse.) Switching to camera view results in the following image.
_images/viz_blender-4.png

Now that 1CPN is loaded into Blender, anything is possible. Change try new materials, add camera animations, go nuts!

Note

If you’re going to be adventerous and start making significant modifications to ${D_1CPN}/1cpn-model/utils/blender/import_dump.py, I would suggest making file edits in your own text editor and not Blender’s build-in one. If your choose to use your own text edior, just make sure to reload the updated import_dump.py in Blender’s text editor before clicking the Run Script button. Blender should notice when import_dump.py is changed and notify you, but its important to remember that Blender doesn’t refresh its internal text editor by default.