User Tools

Site Tools


simulation:configuration_viewers

Visual Molecular Dynamics

Visual Molecular Dynamics, or VMD, is a very popular choice. The documentation is good and it can read may different file formats. The user interface is a bit clunky and takes some time getting used to. There is also a plugin to read hoomd-blue gsd files.

How to install VMD on Mac

Prerequisites

Download the pre-compiled source code: https://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=VMD. You'll have to register with an e-mail address and password. Unpack it and copy it to a folder in your home (~/Programs or similar).

The gsd-vmd plugin can be installed after vmd:

cd ~/Programs
git clone https://github.com/mphoward/gsd-vmd.git
cd gsd-vmd 
mkdir build
cd build 
cmake .. -DVMD_PLUGIN_MOLFILE_PATH="/Users/statt/Programs/vmd-1.9.3/Contents/vmd/plugins/include/" -DVMD_PLUGIN_INCLUDE_PATH="/Users/statt/Programs/vmd-1.9.3/Contents/vmd/plugins/include/"
make install 

Ovito

Ovito is another choice, it has a more streamlined user interface and meshes well with python. As of now, it is completely open source, but there is a paid version with more features.

All features are available from the python scripting interface: https://www.ovito.org/docs/current/python/introduction/installation.html

Install Ovito on Mac

Install ovito on mac from source code: https://www.ovito.org/docs/current/development.build_macosx.php

Install prerequisites first:

brew install qt boost netcdf libssh

Download the source code:

cd ~/programs/code
git clone https://gitlab.com/stuko/ovito.git
cd ovito
mkdir build
cd build

Compile and Install:

cmake .. -DCMAKE_INSTALL_PREFIX="~/Programs/ovito-2.9.0" -DCMAKE_PREFIX_PATH="/usr/local/Cellar/qt/5.14.0"
make -j4
make install

Or, to install the pre-compiled package, which should work on Linux as well:

pip install -U ovito 

Python scripting interface for Ovito

Everything Ovito can do, can be also done from the python interface, see here for documentation. It can be a bit of work to find your way around, but for many tasks (i.e. analyzing lots of trajectories in the same way, etc.) it is worthwhile.

Install with:

conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito

It is important to note that simply conda install ovito will NOT work.

See also here stattlab github for examples and info on how to write python ovito scripts.

Loading Remote Trajectories

To load remote .gsd files in Ovito, go to File > Load Remote File, and use the following syntax:

sftp://user@hostname.matse.illinois.edu/home/user/path_to_trajectory/trajectory_kT_number_rho_number.gsd 

Enter your password when prompted. Make sure that you are in the same network or connected via vpn (i.e. that a terminal ssh user@hostname.matse.illinois.edu connection to the computer with the remote file works).

Others

There is pymol, which is not free. Also, MDanalysis and MDTraj.

For .pdb files

On ubuntu rasmol works, but the image looks ugly.

  • sudo apt-get update -y
  • sudo apt-get install -y rasmol
  • rasmol molecule.pdb

Rendering Nice Looking Snapshots

  • Convert gsd to lammps dump, and open it with VMD.
  • Graphics → Representations → Drawing Method → VDW (shows the particles instead of bonds)
  • Graphics → Representations → Coloring Method → Type
  • Before rendering Graphics → Representations → Sphere Resolution → ~ 35 (computer may slow down)
  • Graphics → Colors → Categories → Type (Under names column if you scroll below elements (C,H,N etc.) you will find your particle types 0,1,2 etc. Select each type and assign a color from 3rd column)

On VMD, tachyon rendering looks good : https://www.ks.uiuc.edu/Research/vmd/minitutorials/tachyonao/

If you have atoms traditional colors are : Carbon-Grey Oxygen-Red Nitrogen-Blue(or green?) Hydrogen-White

A tip for color consistency: Say you have a snapshot as png or in vmd and you want to make snapshots in ovito using the same colors. When you choose a color for each particle type on ovito there is a 'pick from screen' option which let's you copy the same color from other images or configuration viewers.

simulation/configuration_viewers.txt · Last modified: 2023/11/07 00:30 by statt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki