Welcome to this quick introduction to STM4, the molecular visualization toolkit! The first version of this tutorial has been delivered at the AVS Workshop 2008 at ETH Zürich. |
First of all presenting myself. After studies in Rome at the Università la Sapienza, I worked for Digital Equipment where I specialized in software engineering for (mildly boring) logistic applications. Then in 1995 I had the opportunity to start working for Advanced Visual Systems (AVS), where I discovered the fascinating world of visualization. In 2003 I moved to the Swiss National Supercomputing Centre (CSCS) in the Data Analysis and Visualization Services. Here I started working mostly with the center's chemistry users helping them for their visualization needs, providing tools and developing chemistry visualization and data analysis projects. |
STM4 (and STM3 before it) is a framework for the development of unusual and enhanced techniques for chemistry visualization. Its main goal is not to replace existing tools, but to provide a platform on which new, advanced or unusual visualization techniques can be implemented. The toolkit started as an Ohio Supercomputer Center project called See The Molecule and evolved through the work of many people. At CSCS was selected prior to my arrival as the chemistry visualization group workhorse. After my arrival I engineered it till it reached its current form. STM3 was the first engineered version. But it started growing without much order. So a new version with a renewed data model and a more powerful structure visualization module was created and it is the current STM4. There is a list of differences between STM3 and STM4 that you can find useful. My plan is to remove STM3 when I'm sure no one is using it. |
To offer broader set of techniques besides molecular structures visualization. For example in STM4 it is possible to visualize CFD data together with molecular structures. The images show (clockwise from left): the flow around a nanotube represented as a LEA texture; electronic currents around water molecules in a magnetic field; electronic density represented with volume render visualization technique. |
Which is the main difference between STM4 and other chemistry visualization tools like Molekel, VMD, Chimera and others? These are end user tools, with a point-and-click, simple to use user interface. STM4 instead needs some more work to be used, but it is much more flexible and expandable. |
Now we analyze the architecture of STM4. |
STM4 is built on top of AVS/Express. STM4 is a collection of modules that are combined together to build an AVS/Express application (a network, in AVS/Express idiom). As you see, STM4 has not only the user interface and the viewing area, but the whole AVS/Express environment available. To learn more how AVS/Express works, see the slides of the “An introduction to AVS/Express user” course. |
STM4 is composed by:
AVS/Express provides:
|
Before continuing, take a look at some of the visualizations made inside STM4. |
More can be found in the STM4 image gallery or on the CSCS pages. |
The main component of STM4 is a library of modules that could be combined like a LEGO construction set. The modules derive mainly from user requests or because they were needed in some visualization project. |
The STM4 modules are grouped under Libraries → STM4 You notice there is also a STM3 entry. It contains the old set of modules and will be removed anytime soon. |
The STM4 library contains various sub-libraries:
|
STM4 introduces two new data types inside AVS/Express: The first one is the Molecular Data Type that describes a generic molecular structure. The other one is the Display Parameters data type that carries information about how a given structure is visualized. Other information is carried by standard AVS/Express data types, like volumetric data that is represented by a Field Data Type. Other data types extensively used are the Graphical Object (the red line) and the Screen Image (the violet line). |
More information about STM4, and AVS/Express, can be found in the following places:
|
There are some special cases to consider launching AVS/Express on various platforms (see slide). The script |
Start instantiating from the Full Apps sublibrary the MolDisplayApp pre-built application. Then read a structure and experiment with the various Draw Structure molecular representation methods. |
To add a second structure to the display instantiate a Read Structure module to read the second structure and another Draw Structure to visualize it. The red (Graphical Object) line goes, together with the first one, to the UViewer3D module. Then change the appearance of one of the structures going to the Draw Structure or Draw Structure#1 Module panel. |
Now delete the application (File → Delete Application) and instantiate the CrystalDisplayApp application. Read a file containing unit cell and symmetries (for example one in Shel-X format) and change unit cell replication and symmetry computation. |
Now add a Draw Polyhedra or Draw Simple Polyhedra module to add coordination polyhedra around selected atoms. |
To enhance the presentation of the structure you can add:
|
Now delete the application (File → Delete Application) and instantiate the VolumeDisplayApp application. Read a file containing volumetric data (for example one in Gaussian Cube format) and change unit cell replication and the isosurface level and coloring. Note that the Replicate Lattice module replicates not only the molecular structure, but also the volumetric data. |
Now delete the Isosurface module and substitute it with a Volume Render one. Changing the module parameters see how the resulting visualization could transmit more information about the 3D structure respect to a simple isosurface. |
Those are prebuilt applications that are ready to run after instantiation. They could be a starting point also for more specialized applications. |
The base visualization application. |
Visualization specialized for crystal structures. |
Visualization plus the Measure Structure module. Using it you can measure distances and angles in the structure. |
A rather specialized application. It is here just because the setup of the application is not trivial. At its core it has the Pick Unit Cell module. With it you pick on 4 atoms (in the order: Origin, the end of the A vector, the end of the B vector, the end of the C vector). Then the module builds a new unit cell (and atom structure) within this new unit cell. |
Again this application simplifies the usage of the Accumulate Traces module. Goal of the application is to show the movement of selected atoms either as a line trail or as a cloud of occupied positions in a grid of cells. |
Readers for various chemistry formats and scalar or vector data. The writers write some chemistry formats. Make Movie creates a movie out of an animation (for example a trajectory) and Output Image captures a snapshot of the viewer. A tip for Make Movie. Capture to disk and not to memory. This way you find an ImgNNNNN.x or ImgNNNNN.bmp (depending on AVS/Express version) file for each frame in the selected directory. Those images could then be assembled in a higher quality movie. Instead Output Image has a half-bug: lines and fonts are made smaller in the file compared to the one on the screen. The trick here is to increase line widths and font sizes on screen before capturing it. Also sometimes (e.g. if you use depth cueing) you should change Draw Structure modules to Draw Sw Structure ones to produce a good image. |
The up to date list of formats read by STM4 is available on the STM4 page. |
Nothing special is needed to read a file: set the file format, set the kind of animation method present (if any), and enter the filename (or filenames if the format needs more than one file). |
Display the molecular structure and other graphical objects that could help visualization understanding. |
This is the most important piece of STM4: it converts the Molecular Data Type into the graphical representation of the chemical structure. With the module controls you can change the molecular representation of atoms (normal, licorice, space filling) and bonds (tube, line, none); their coloring and labeling. Special settings concern the colormap and range used to convert scalar values to color. With a final set of controls you can chose the InfoSet used to set atom and fragments colors and radii. Here you can fine tune also bonds and sphere radius and quality. |
An Info Set is a group of information about:
You can select the Info Set to use in Draw Structure. To edit existing or create a new set, drop the Info Sets Editor module in your application and go to its panel. The functionalities are quite straightforward. After editing, the module could be deleted. |
To enhance the presentation of the structure you can add:
|
STM4 could compute (or recompute) the structure bonds. The Compute Bonds module normally comes together with the modules that need a bonds recomputation (like Replicate Lattice). If you are sure that the bonds will be recomputed, then use Read Structure No Bonds to read the data. |
The only peculiar module in this set is Compute Selected Bonds. It adds distance based bonds to selected atoms and, optionally, adds also a coordination polyhedra. |
This library contains modules that compute various derived structures like protein surface, backbone, interpolating planes etc. |
For example the Backbone module computes the classical Traces or Tube protein representation. As in other tools this module requires a certain naming of the atoms: in fact the backbone passes through CA Carbon atoms sandwiched between one C and one N atoms. A similar module (General Backbone) draws a tube between user selected atoms. |
The Measure Structure module:
The red input port should be connected to the leftmost (picked_obj) output red port of Uviewer3D. Picking happens with Ctrl-LeftMouseButton. If you click not on an atom, the selection is reset. |
Measure Closer Atoms is not really an interactive module. You have to select one or more atoms from a list and it displays all the interatomic distances in a given range. |
An atom can have one or more associated scalar or vector data. The Threshold Data module consider the first scalar value associated to atoms and outputs only the atoms that satisfy one of the following conditions against one or two values set on the module user interface. The conditions are:
|
STM4 represents trajectories, i.e. a sequence of atomic structures presumably evolving in time, as a sequence of frames. The frames are read one by one by the Read Structure module. In other words, a trajectory is not a first class data type in STM4. The modules in this library have a permanent status that unifies the various frames of a sequence. For example the Interpolate Sequence must save the atom positions of the previous frame and have the next frame before outputting the interpolated frames in between. |
The Accumulate Traces module accumulates the position of selected atoms in a trajectory in two different ways: as single positions and as occupancy of cells in a grid. The first method produces a line for each traced atom. The line is colored by frame number. A nice effect is obtained adding the Illuminated Field Lines AVS/Express standard module. There is a threshold value you can set to correctly split traces that exit from one side of the unit cell and re-enter on the opposite side. The second method creates a 3D regular grid around the structure. At each frame the cells that contain one or more of the selected atoms have their associated count value incremented. The resulting volumetric data is visualized with volume render. |
If the file format contains an associated scalar volumetric data (Gaussian Cube, CHGCAR, PLT), it can be visualized using standard AVS/Express visualization techniques. Here some of them are replicated for convenience plus other specific for STM4. One example of specific module is the Interpolate Volume module that computes a tricubic interpolation of the input volume. |
Volume Render is a standard AVS/Express module replicated here for convenience. Here are some small tips. BTF texture plus OpenGL rendering is fast, but not overly nice. Instead Ray tracer under software render (the "spark" button in the viewer should be gray) is better looking, but it is slower. Alpha Range Model normally should not be Step. Under BTF texture mode the Alternate Object toggle could be not set to speedup the interaction. |
To remove atoms inside or outside a given geometric shape you can use the Crop Structure module. The shapes currently available are:
|
Another functionality commonly used by crystallographers is to put polyhedra around specific atoms. In STM4 this is done by the Draw Polyhedra and Draw Simple Polyhedra modules. For the first module the criteria to select polyhedra vertices could be coordination or distance. The polyhedra could also be changed into a sphere. The 2nd one instead is a porting of the old STM3 module Find Polyhedra. |
As already mentioned you can mix with STM4 modules the standard AVS/Express ones, like has been done in the three visualization here (from left): trajectory in a 3-parameter space; electronic currents represented as LIC textures and arrow glyphs; and the already seen flow around a nanotube. |
In this example the input data is a structure plus a 3D scalar volumetric data. Using Orthoslice a 2D slice is extracted. Then using the standard gradient AVS/Express module plus an arrow glyph the scalar field gradient around an atom is visualized. |
Thank you for your attention! And do not forget to contact me if you need more information or have wild ideas to experiment with. |