From: Francesco Pietra (chiendarret_at_gmail.com)
Date: Thu Jun 04 2015 - 09:32:47 CDT

Hello:

In view of use with a homotetramer, I was comparing distance.tcl/bigdcd.tcl
with resid vs index for a short single chain, single dcd.

distance.tcl reads:

source bigdcd.tcl

proc distance { frame } {
   global all sel1 sel2 coord1 coord2 outfile
   set coord1 [lindex [$sel1 get {x y z}] 0]
   set coord2 [lindex [$sel2 get {x y z}] 0]
   puts $outfile "$frame: [vecdist $coord1 $coord2]"
 }
set outfile [open distance.dat w];
# set mol [mol new protein.psf waitfor all]
set mol [mol new blg.psf waitfor all]
# mol addfile protein.pdb type pdb waitfor all
mol addfile blg.pdb type pdb waitfor all
# set sel1 [atomselect $mol "protein and resid 34 and alpha"]
set sel1 [atomselect $mol "protein and index 511"]
# set sel2 [atomselect $mol "protein and resid 36 and alpha"]
set sel2 [atomselect $mol "protein and index 538"]
bigdcd distance blg.dcd
bigdcd_wait
close $outfile

where "index 511" corresponds to resid 34 CA atom and "index 538" to resid
36 CA atom.

I wonder whether the discrepancy below listed when using resid vs index is
acceptable (NOTICE that I used the index for CA as in the PDB file; is that
correct in the framework of VMD text mode?

vmd -e distance.tcl -dispdev none

distance.dat with resid reads:
1: 6.155873294845215
2: 6.3324751149574
3: 6.267655808391619
4: 6.001893779397328
5: 5.935921404818315
6: 5.75340044561143
7: 5.903206322073248
8: 6.000084026502264
9: 6.123181765569243
10: 5.687617330115469
11: 5.588952884916724
12: 5.621397740963518
13: 5.947689151421404
14: 6.005809460661218
15: 5.892805662838818
16: 5.918587368637095
17: 6.078843142124178
18: 5.829160049190195
19: 5.84493097544958
20: 6.156780825051894
21: 6.089357473930232
22: 6.009320894482683
23: 6.039823223667995
24: 6.131418241840857
25: 6.124286431213598
26: 6.186483359353395
27: 6.195875340907096
28: 5.895764830495841
29: 6.1294518557292275
30: 6.2540777423612335
31: 6.197113229710773
32: 6.313388207648914
33: 6.497207719047839
34: 6.456978080128772
35: 6.30176524717308
36: 6.182407440061586
37: 5.939172896709217
38: 5.906056737141097
39: 6.162640646454019
40: 6.279199743063725
41: 6.543637151419946
42: 6.4449162032242935
43: 6.325669741155785
44: 6.354868984379231
45: 6.457706430729012
46: 6.600767128352138
47: 6.5583006374750195
48: 6.32079177163211
49: 6.452229620126813
50: 6.496551024801622
51: 6.5177934038036645
52: 6.429451293884513
53: 6.376118267780437
54: 6.077281549237033
55: 5.854099658958354
56: 5.850274767463241
57: 6.198129604168876
58: 6.0485286244120795
59: 6.079240381421482
60: 5.9744206773638275
61: 6.123270583092752
62: 6.005473066549851
63: 5.790701277164607
64: 5.653011389975589
65: 5.461100760290221
66: 5.734068473805915
67: 6.072277903551858
68: 6.069468317908955
69: 5.944910088938689
70: 5.9141170718072384
71: 6.090138817001316
72: 5.946905741529113
73: 5.829107452677821
74: 5.68382532616309
75: 5.823621964694188
76: 5.767044531468982
77: 5.841141572062604
78: 5.928387157504003
79: 6.023482333243039
80: 6.063439927725436
81: 6.32053998470388
82: 6.341327289040814
83: 6.20519775761507
84: 6.205142331571849
85: 6.122645673605338
86: 6.022163609208951
87: 6.119559498354708
88: 6.079274521721274
89: 6.220615535374097
90: 6.308776272489288
91: 6.136137501190165
92: 6.1298573018596905
93: 6.018836351487991
94: 5.863414168418454
95: 6.010756622516953
96: 5.956960865296578
97: 5.9995292910653975
98: 5.949459725963331
99: 5.723198191348166
100: 6.123118359030882
101: 6.131361660031941
102: 6.0433403825653125
103: 5.8572285953314145
104: 5.729594744613678
105: 5.841126607065762
106: 5.657990071900067
107: 5.627232755775197
108: 5.609958612253771
109: 5.751144979480783
110: 5.980132615078155
111: 5.988188507430909
112: 6.00627161749879
113: 6.1774497323435344
114: 6.038629865383346
115: 6.032425859407662
116: 5.891878809119978
117: 5.864796880976335
118: 5.871247268345111
119: 5.9467857173220295
120: 5.67542728022883
121: 5.574826338779056
122: 5.608677369260205
123: 5.588631829799197
124: 5.633183388382263
125: 5.85983612192658
126: 5.970173996639731
127: 6.232289989558169
128: 6.183226667096034
129: 5.986306564748091
130: 5.8527187295876235
131: 5.667387304478913
132: 5.6899439458066565
133: 5.469971903764231
134: 5.5354134421856
135: 5.924336859590648
136: 5.902510881946771
137: 5.812784112515541
138: 5.994018048580893
139: 5.778274342588817
140: 5.846868830559261
141: 6.017538249561662

while distance.dat with index reads:
1: 6.81509667694367
2: 7.324764182677088
3: 7.069919323694988
4: 6.900428779331134
5: 6.779582255904655
6: 6.6782552979514165
7: 6.812071722814608
8: 6.821105239039725
9: 7.114210320438186
10: 6.592142422446802
11: 6.128651064070532
12: 6.401949561658085
13: 6.879654235189838
14: 6.981200984844114
15: 6.923510281799492
16: 6.611598623905179
17: 6.704177198345893
18: 6.692500627861949
19: 6.689484962192078
20: 7.093435567839954
21: 6.970505723824979
22: 6.969242736236588
23: 7.015630435244526
24: 7.126333502139914
25: 7.14371333937126
26: 7.205182418657364
27: 7.021344698752695
28: 6.735458362311062
29: 7.0807760874635735
30: 7.274808513852262
31: 7.348204612566441
32: 7.226866649020775
33: 7.2774565429363
34: 7.161418183211406
35: 6.942482885990797
36: 6.931180497247215
37: 6.655856987063322
38: 6.801842519669949
39: 7.094670404756691
40: 7.177321623425995
41: 7.488965388454052
42: 7.421950714761952
43: 7.328199547379709
44: 7.321931128027203
45: 7.358071347664505
46: 7.393026644932146
47: 7.194881981702942
48: 6.9221378596130485
49: 7.266935873670471
50: 7.302311242111963
51: 7.3946852634452656
52: 7.316321929627676
53: 7.424162388205278
54: 7.06378853192656
55: 7.001706179549798
56: 6.986406120219026
57: 7.437136197425969
58: 7.237961221846839
59: 7.1695717193011905
60: 7.092589620751929
61: 7.057414866572976
62: 6.839492425930564
63: 6.6690875175306035
64: 6.5751768692617425
65: 6.405488894058185
66: 6.7391106816201365
67: 6.973626178415096
68: 7.289031136655081
69: 6.876845434473571
70: 6.987305144524046
71: 7.0774340716118935
72: 7.010224910843495
73: 6.873840911774636
74: 6.716127781766796
75: 6.738170363183688
76: 6.766809505258355
77: 6.786923860345665
78: 7.073969821356074
79: 7.091126106383393
80: 7.0465595059673305
81: 7.3873687524421365
82: 7.349306524781023
83: 7.336652772510283
84: 7.409495907622654
85: 7.165156902098029
86: 7.2507191352372145
87: 7.287430091085758
88: 7.275026744776622
89: 7.383866182257686
90: 7.517982670845706
91: 7.423334543688227
92: 7.34049534731532
93: 7.242669391693693
94: 7.024874571499522
95: 7.027173323603344
96: 7.077856913208377
97: 7.167091364510184
98: 7.139585426436412
99: 6.707798939556049
100: 7.284049342902034
101: 7.313782733381586
102: 7.223773237696821
103: 6.729890932705325
104: 6.775945212544188
105: 6.980054229815082
106: 6.877712153627434
107: 6.790306528332171
108: 6.748034371956233
109: 7.05441887523652
110: 7.0834718734935675
111: 6.924383617625959
112: 7.138870200754995
113: 7.054282927996913
114: 7.322920189215957
115: 7.234087982730475
116: 6.952640803525461
117: 7.060739238101184
118: 7.128465696658351
119: 7.152363790442598
120: 6.704962573386964
121: 6.631226126227999
122: 6.664512745103688
123: 6.684939700297468
124: 6.404532936068054
125: 6.989098340683407
126: 6.9912134498442775
127: 7.102676661789097
128: 7.3124875709405375
129: 7.067251234024886
130: 6.805250013051595
131: 6.827058024108577
132: 6.790603362828231
133: 6.551860606998993
134: 6.697579121333028
135: 7.145316428896854
136: 7.033859385577582
137: 6.901371663073955
138: 6.93716503862458
139: 6.796286816824731
140: 6.737236609644235
141: 6.970489721535678