Free topology in non-DD simulations
[gromacs.git] / docs / how-to / visualize.rst
bloba6b56490b130afad0cedf591748bdc15ebab10ee
1 .. _reference manual: gmx-manual-parent-dir_
3 .. _gmx-visualize:
5 Visualization Software
6 ----------------------
8 Some programs that are useful for visualizing either a trajectory file and/or a coordinate file are:
10 * `VMD`_ - a molecular visualization program for displaying, animating, and analyzing
11   large biomolecular systems using 3-D graphics and built-in scripting. Reads |Gromacs| trajectories.
12 * `PyMOL`_ - capable molecular viewer with support for animations, high-quality rendering, crystallography,
13   and other common molecular graphics activities. Does not read |Gromacs| trajectories in default
14   configuration, requiring conversion to PDB or similar format. When compiled with `VMD`_ plugins,
15   :ref:`trr` & :ref:`xtc` files can be loaded.
16 * `Rasmol`_ - the derivative software `Protein Explorer`_ (below) might be a better alternative, but
17   the Chime component requires windows. `Rasmol`_ works fine on Unix.
18 * `Protein Explorer`_ - a `RasMol`_\ -derivative, is the easiest-to-use and most powerful software
19   for looking at macromolecular structure and its relation to function. It runs on Windows or Macintosh/PPC computers.
20 * `Chimera`_ - A full featured, Python-based visualization program with all sorts of features for
21   use on any platform. The current version reads |Gromacs| trajectories.
22 * `Molscript`_ - This is a script-driven program form high-quality display of molecular 3D structures
23   in both schematic and detailed representations. You can get an academic license for free from Avatar.
25 Also if appropriate libraries were found at configure-time, :ref:`gmx view` can useful.
27 Topology bonds vs Rendered bonds
28 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 Remember that each of these visualization tools is only looking at the coordinate file you gave it
31 (except when you give :ref:`gmx view` a :ref:`tpr` file). Thus it's not using your topology which is
32 described in either your :ref:`top` file or your :ref:`tpr` file. Each of these programs makes their
33 own guesses about where the chemical bonds are for rendering purposes, so do not be surprised if the
34 heuristics do not always match your topology.
36 .. _Rasmol: http://www.umass.edu/microbio/rasmol/index2.htm
37 .. _Protein Explorer: http://www.umass.edu/microbio/rasmol/
38 .. _Chimera: http://www.rbvi.ucsf.edu/chimera/
39 .. _Molscript: http://www.avatar.se/molscript/
42 Extracting Trajectory Information
43 ---------------------------------
45 There are several techniques available for finding information in |Gromacs|
46 trajectory (:ref:`trr`, :ref:`xtc`, :ref:`tng`) files.
48 * use the |Gromacs| trajectory analysis utilities
49 * use :ref:`gmx traj` to write a :ref:`xvg` file and read that in an external program as above
50 * write your own C code using ``gromacs/share/template/template.cpp`` as a template
51 * use :ref:`gmx dump` and redirect the shell output to a file and read that in an external
52   program like MATLAB, or Mathematica or other spreadsheet software.
54 External tools to perform trajectory analysis
55 ---------------------------------------------
57 In recent years several external tools have matured sufficiently to analyse diverse sets
58 of trajectory data from several simulation packages. Below is a short list of tools
59 that are known to be able to analyse |Gromacs| trajectory data.
61 * `MDTraj <http://mdtraj.org/latest/index.html>`__
62 * `MDAnalysis <https://www.mdanalysis.org/>`__
63 * `LOOS <http://loos.sourceforge.net/>`__
66 Plotting Data
67 -------------
69 The various |Gromacs| analysis utilities can generate :ref:`xvg` files. These are text files
70 that have been specifically formatted for direct use in Grace. You can, however, in
71 all |Gromacs| analysis programs turn off the Grace specific codes by running the programs
72 with the ``-xvg none`` option. This circumvents problems with tools like gnuplot and Excel (see below).
74 Note that Grace uses some embedded backslash codes to indicate superscripts, normal script, etc. in units. So "Area (nm\S2\N)" is nm squared. 
76 Software
77 ^^^^^^^^
79 Some software packages that can be used to graph data in a :ref:`xvg` file:
81 * Grace - WYSIWYG 2D plotting tool for the X Window System and M\*\ tif. Grace runs on practically
82   any version of Unix-like OS, provided that you can satisfy its library dependencies (Lesstif is a
83   valid free alternative to Motif). It is also available for the other common operation systems.
84 * gnuplot - portable command-line driven interactive data and function plotting utility for UNIX,
85   IBM OS/2, MS Windows, DOS, Macintosh, VMS, Atari and many other platforms. Remember to use::
87     set datafile commentschars "#@&"
89   to avoid gnuplot trying to interpret Grace-specific commands in the :ref:`xvg` file or use
90   the ``-xvg none`` option when running the analysis program. For simple usage,::
92     plot "file.xvg" using 1:2 with lines
94   is a hack that will achieve the right result.
95 * MS Excel - change the file extension to .csv and open the file (when prompted, choose to ignore the
96   first 20 or so rows and select fixed-width columns, if you are using German MS Excel version, you
97   have to change decimal delimiter from "," to ".", or use your favourite \*nix tool.
98 * Sigma Plot A commercial tool for windows with some useful analysis tools in it.
99 * R - freely available language and environment for statistical computing and graphics which provides
100   a wide variety of statistical and graphical techniques: linear and nonlinear modelling, statistical
101   tests, time series analysis, classification, clustering, etc.
102 * SPSS A commercial tool (Statistical Product and Service Solutions), which can also plot and analyse data.
105 Micelle Clustering
106 ------------------
108 This is necessary for the :ref:`gmx spatial` tool if you have a fully-formed single aggregate and
109 want to generate the spatial distribution function for that aggregate or for solvent around that aggregate.
111 Clustering to ensure that the micelle is not split across a :ref:`periodic boundary condition <gmx-pbc>`
112 border is an essential step prior to calculating properties such as the radius of gyration and the
113 radial distribution function. Without this step your results will be incorrect (a sign of this error
114 is unexplained huge fluctuations in the calculated value when the visualized trajectory looks fine).
116 Three steps are required:
118 * use :ref:`trjconv <gmx trjconv>` ``-pbc cluster`` to obtain a single frame that has all of the
119   lipids in the unit cell. This must be the first frame of your trajectory. A similar frame
120   from some previous timepoint will not work.
121 * use :ref:`grompp <gmx grompp>` to make a new :ref:`tpr` file based on the frame that was output from the step above.
122 * use :ref:`trjconv <gmx trjconv>` ``-pbc nojump`` to produce the desired trajectory using the newly produced :ref:`tpr` file.
124 More explicitly, the same steps are:
128  gmx trjconv -f a.xtc -o a_cluster.gro -e 0.001 -pbc cluster
129  gmx grompp -f a.mdp -c a_cluster.gro -o a_cluster.tpr
130  gmx trjconv -f a.xtc -o a_cluster.xtc -s a_cluster.tpr -pbc nojump