[gmx-users] RMSDview

Ing. Vojtech Spiwok Vojtech.Spiwok at vscht.cz
Mon Dec 6 12:28:28 CET 2004


Dear Gromacs users

Here comes a simple console utility for viewing g_rms output
writen in awk + shell. Usage is
./RMSDview file.xvg

The script is:
!!!!!!!!!!!!begining of file!!!!!!!!!!!!
#!/bin/sh

egrep -v @ $1 | egrep -v "#" | awk '
 BEGIN {
 OFS = ""
 ORS = ""
 print "\t" "                         RMSD (nm)\n"
 print "\t" " 0.0       0.1       0.2       0.3       0.4      0.5\n"
 print "\t" " |         |         |         |         |        |  \n"
 print "\t" " --------------------------------------------------  \n"
 }

 {OFS = ""
  ORS = ""
  printf "%3.2f", $1
  print "\t|"
  first[NR] = $2
  second[NR] = $3
  third[NR] = $4
  fourth[NR] = $5
  for (i=1; i<51; i++) {
     j = ((i - 1) / 100)
     k = (i / 100)
     if ((fourth[NR] >= j) && (fourth[NR] < k)) {
      print "4"}
     else {
      if ((third[NR] >= j) && (third[NR] < k)) {
       print "3"}
      else {
       if ((second[NR] >= j) && (second[NR] < k)) {
        print "2"}
       else {
        if ((first[NR] >= j) && (first[NR] < k)) {
         print "1"}
        else {
         print " "}
        }
       }
      }
     }
  print "|\n"}

 END {
 print "\t" " --------------------------------------------------  \n"
 }
 '

!!!!!!!!!!!!!!!!!end of file!!!!!!!!!!!!!!

The output looks like:
                                 RMSD (nm)
         0.0       0.1       0.2       0.3       0.4      0.5
         |         |         |         |         |        |
         --------------------------------------------------
0.00    |3                                                 |
2.00    |     3 1 2                                        |
4.00    |   3  2 1                                         |
6.00    | 2   3   1                                        |
8.00    |  3      12                                       |
10.00   |   3     21                                       |
12.00   |    2  3  1                                       |
14.00   |    3  2  1                                       |
16.00   |   2    3 1                                       |
18.00   |   32     1                                       |
20.00   |    2   3 1                                       |
22.00   |    3 2   1                                       |
24.00   |    3     21                                      |
26.00   |   3     2  1                                     |
28.00   |    23      1                                     |
30.00   |        23  1                                     |
32.00   |   2      3 1                                     |
34.00   |        3   1                                     |
36.00   |    2        3                                    |
38.00   |     2    3  1                                    |
40.00   |  2   3     1                                     |
42.00   |    2 3     1                                     |
44.00   |     2  3    1                                    |
46.00   |      3      1                                    |
48.00   |  2          3                                    |
50.00   |      2  3     1                                  |
52.00   |          3  1                                    |
54.00   |       32    1                                    |
56.00   |    23        1                                   |
58.00   |      2 3      1                                  |
60.00   |       2  3    1                                  |
62.00   |     32        1                                  |
64.00   |   2    3      1                                  |
66.00   |        2 3    1                                  |
68.00   |      3   2   1                                   |
70.00   |      3  2   1                                    |
72.00   |       2    31                                    |
74.00   |     2       3                                    |
76.00   |       2 3   1                                    |
78.00   |    2  3      1                                   |
80.00   |     2    3   1                                   |
82.00   |       2   3  1                                   |
84.00   |      2   3    1                                  |
86.00   |         2    3                                   |
88.00   |       23      1                                  |
90.00   |     2        13                                  |
92.00   |       2  3   1                                   |
94.00   |         23    1                                  |
96.00   |       3 2    1                                   |
98.00   |       2 3    1                                   |
100.00  |      2   3    1                                  |
102.00  |         2  3  1                                  |
104.00  |         23     1                                 |
106.00  |       2   3   1                                  |
108.00  |    2  3       1                                  |
110.00  |         3     1                                  |
112.00  |       2 3      1                                 |
114.00  |     2    3    1                                  |
116.00  |        3       1                                 |
118.00  |       3       21                                 |
120.00  |          3     1                                 |
122.00  |      2 3       1                                 |
124.00  |        23     1                                  |
126.00  |     2   3    1                                   |
128.00  |        2 3    1                                  |
130.00  |          3     1                                 |
132.00  |       2  3    1                                  |
134.00  |       3  2    1                                  |
136.00  |           3  21                                  |
138.00  |       3     2  1                                 |
140.00  |          3 2    1                                |
142.00  |        3     2 1                                 |
144.00  |     3  2       1                                 |
146.00  |   3    2       1                                 |
148.00  |      3  2       1                                |
150.00  |      2 3       1                                 |
152.00  |          3 2    1                                |
154.00  |           3   2 1                                |
156.00  |         3  2    1                                |
158.00  |        3  2     1                                |
160.00  |       32         1                               |
162.00  |     3     2     1                                |
164.00  |       3     2  1                                 |
166.00  |       3  2     1                                 |
168.00  |      2  3     1                                  |
170.00  |        3   2   1                                 |
172.00  |         3     2 1                                |
174.00  |         32      1                                |
176.00  |        32       1                                |
178.00  |    2     3     1                                 |
180.00  |           32    1                                |
182.00  |         2   3   1                                |
184.00  |         2  3    1                                |
186.00  |        3        1                                |
188.00  |       2    3    1                                |
190.00  |             3   12                               |
192.00  |         3       2                                |
194.00  |             3    1                               |
196.00  |           3     1                                |
198.00  |        2    3    1                               |
200.00  |             2  3 1                               |
         --------------------------------------------------

It can be easilly costomized for your number of rows, RMSD range
or for other input (g_hbond etc.).

I hope it can help you.

Vojtech Spiwok



More information about the gromacs.org_gmx-users mailing list