-
Notifications
You must be signed in to change notification settings - Fork 52
/
solvate.tcl
executable file
·7625 lines (7568 loc) · 129 KB
/
solvate.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/tclsh
#
# This scripts writes a input file for packmol, and runs packmol,
# that automatically setup
# a solvation shell with 0.16 sodium and chloride concentrations such
# that the whole system is neutral, considering neutral histidines and
# charged
#
# Make it executable with: chmod +x solvate.tcl
# Run with: ./solvate.tcl structure.pdb -shell 15. -charge +5 -density 1.0 -o solvated.pdb
#
# Where:
# structure.pdb is the pdb file to be solvated (usually a protein)
#
# "15." is the size of the solvation shell. This
# is an optional parameter. If not set, 15. will be used.
#
# +5 is the total charge of the system, to be neutralized.
# This is also and optional parameter, if not used, the package
# considers histidine residues as neutral, Arg and Lys as +1
# and Glu and Asp as -1, and sets up the Sodium and Chloride
# concentrations automatically.
# Alternatively, use the -noions to not add any ions, just water.
#
# 1.0 is the desired density. Optional. If not set, the density
# will be set to 1.0 g/ml.
#
# solvated.pdb: is the (optional) name for the solvated system output
# file. If this argument is not provided, it will be the default
# "solvated.pdb" file.
#
# pack.inp: is the (optional) name for the packmol input file that
# will be generated. If not provided, packmol_input.inp will be used.
#
# L. Martinez, Aug 2, 2011. ([email protected])
#
set args [ split $argv " " ]
set iarg 0
foreach arg $args {
if { [ string trim $arg ] > " " } {
incr iarg
set input_argument($iarg) $arg
}
}
if { $iarg == 0 } {
puts " "
puts " Solvate.tcl script for Packmol "
puts " "
puts " Run with: "
puts " "
puts " solvate.tcl structure.pdb -shell 15. -charge +5 -density 1.0 -i pack.inp -o solvated.pdb"
puts "
Where:
structure.pdb is the pdb file to be solvated (usually a protein)
\"15.\" is the size of the solvation shell. This
is an optional parameter. If not set, 15. will be used.
+5 is the total charge of the system, to be neutralized.
This is also and optional parameter, if not used, the package
considers histidine residues as neutral, Arg and Lys as +1
and Glu and Asp as -1. The Na+ and Cl- concentrations are set
the closest possible to 0.16M, approximately the physiological
concentration.
Alternatively, use the -noions to not add any ions, just water.
1.0 is the desired density. Optional. If not set, the density
will be set to 1.0 g/ml.
solvated.pdb: is the (optional) name for the solvated system output
file. If this argument is not provided, it will be the default
solvated.pdb file.
pack.inp: is the (optional) name for the packmol input file that
will be generated. If not provided, packmol_input.inp will be used.
"
exit
}
set pdb_file $input_argument(1)
set charge "none"
set shell "none"
set density "none"
set output "solvated.pdb"
set packmol_input "packmol_input.inp"
set noions "false"
for { set i 2 } { $i <= $iarg } { incr i } {
if { $input_argument($i) == "-charge" } { set charge $input_argument([expr $i + 1]) }
if { $input_argument($i) == "-shell" } { set shell $input_argument([expr $i + 1]) }
if { $input_argument($i) == "-density" } { set density $input_argument([expr $i + 1]) }
if { $input_argument($i) == "-o" } { set output $input_argument([expr $i + 1]) }
if { $input_argument($i) == "-i" } { set packmol_input $input_argument([expr $i + 1]) }
if { $input_argument($i) == "-noions" } { set noions "true" }
}
puts " ###########################################################################"
puts " solvate.tcl script: Solvates a (protein) structure with water and ions,"
puts " using Packmol. "
puts " ###########################################################################"
puts " Input pdb file to be solvated: $pdb_file "
puts -nonewline " User set structure charge: $charge "
if { $charge == "none" } { puts " - will compute from structure. " } else { puts " " }
puts -nonewline " User set shell size: $shell "
if { $shell == "none" } { puts " - using default: 15.0 Angs. " } else { puts " " }
puts -nonewline " User set density: $density "
if { $density == "none" } { puts " - using default: 1.0 g/ml " } else { puts " " }
# If the user didn't set the sell size, use default one
if { $shell == "none" } { set shell 15. }
#
# Computing the size of the structure (maximum and minimum size on each direction)
#
set pdb_file_name $pdb_file
set pdb_file [ open $pdb_file r ]
set pdb_file [ read $pdb_file ]
set pdb_file [ split $pdb_file "\n" ]
set natoms 0
foreach line $pdb_file {
if { [ string range $line 0 3 ] == "ATOM" |
[ string range $line 0 5 ] == "HETATM" } {
incr natoms
set x [ string trim [ string range $line 30 37 ] ]
set y [ string trim [ string range $line 38 45 ] ]
set z [ string trim [ string range $line 46 54 ] ]
if { [ info exists xmin ] == 1 } {
if { $x < $xmin } { set xmin $x }
if { $y < $ymin } { set ymin $y }
if { $z < $zmin } { set zmin $z }
if { $x > $xmax } { set xmax $x }
if { $y > $ymax } { set ymax $y }
if { $z > $zmax } { set zmax $z }
} else {
set xmin $x
set ymin $y
set zmin $z
set xmax $x
set ymax $y
set zmax $z
}
}
}
set x_length [ expr $xmax - $xmin + 2.0*$shell ]
set y_length [ expr $ymax - $ymin + 2.0*$shell ]
set z_length [ expr $zmax - $zmin + 2.0*$shell ]
puts " -------------------------------------------------------"
puts " Minimum and maximum coordinates of structure atoms "
puts " X_min = $xmin X_max = $xmax "
puts " Y_min = $ymin Y_max = $ymax "
puts " Z_min = $zmin Z_max = $zmax "
puts " -------------------------------------------------------"
puts " Box side length in each direction: "
puts " x: $x_length "
puts " y: $y_length "
puts " z: $z_length "
puts " -------------------------------------------------------"
#
# If the user didn't set the total charge of the system, compute the charge
#
if { $charge == "none" } {
set charge 0
set number 0
set nhis 0; set narg 0; set nlys 0; set nglu 0; set nasp 0
foreach line $pdb_file {
set amino [string range $line 17 19]
if { [ string trim [ string range $line 12 15 ] ] == "N" } {
if { $amino == "HIS" } { incr nhis }
if { $amino == "HSD" } { incr nhis }
if { $amino == "ARG" } { set charge [expr $charge + 1]; incr narg }
if { $amino == "LYS" } { set charge [expr $charge + 1]; incr nlys }
if { $amino == "GLU" } { set charge [expr $charge - 1]; incr nglu }
if { $amino == "ASP" } { set charge [expr $charge - 1]; incr nasp }
}
}
puts " -------------------------------------------------------"
puts " HIS = $nhis (associated charge = 0) "
puts " ARG = $narg (associated charge = +$narg) "
puts " LYS = $nlys (associated charge = +$nlys) "
puts " GLU = $nglu (associated charge = -$nglu) "
puts " ASP = $nasp (associated charge = -$nasp) "
puts " -------------------------------------------------------"
puts " Total structure charge = $charge"
puts " -------------------------------------------------------"
}
#
# Compute the molar mass of the structure
#
foreach data { \
"H 1.00800 " \
"HC 1.00800 " \
"HA 1.00800 " \
"HT 1.00800 " \
"HP 1.00800 " \
"HB 1.00800 " \
"HR1 1.00800 " \
"HR2 1.00800 " \
"HR3 1.00800 " \
"HS 1.00800 " \
"HE1 1.00800 " \
"HE2 1.00800 " \
"HA1 1.00800 " \
"HA2 1.00800 " \
"HA3 1.00800 " \
"HF1 1.00800 " \
"HF2 1.00800 " \
"C 12.01100 " \
"CA 12.01100 " \
"CT1 12.01100 " \
"CT2 12.01100 " \
"CT3 12.01100 " \
"CPH1 12.01100 " \
"CPH2 12.01100 " \
"CPT 12.01100 " \
"CY 12.01100 " \
"CP1 12.01100 " \
"CP2 12.01100 " \
"CP3 12.01100 " \
"CC 12.01100 " \
"CD 12.01100 " \
"CPA 12.01100 " \
"CPB 12.01100 " \
"CPM 12.01100 " \
"CM 12.01100 " \
"CS 12.01100 " \
"CE1 12.01100 " \
"CE2 12.01100 " \
"CST 12.01100 " \
"CT 12.01100 " \
"CT1x 12.01100 " \
"CT2x 12.01100 " \
"CT3x 12.01100 " \
"CN 12.01100 " \
"CAP 12.01100 " \
"COA 12.01100 " \
"C3 12.01100 " \
"N 14.00700 " \
"NR1 14.00700 " \
"NR2 14.00700 " \
"NR3 14.00700 " \
"NH1 14.00700 " \
"NH2 14.00700 " \
"NH3 14.00700 " \
"NC2 14.00700 " \
"NY 14.00700 " \
"NP 14.00700 " \
"NPH 14.00700 " \
"NC 14.00700 " \
"O 15.99900 " \
"OB 15.99900 " \
"OC 15.99900 " \
"OH1 15.99900 " \
"OS 15.99940 " \
"OT 15.99940 " \
"OM 15.99900 " \
"OST 15.99900 " \
"OCA 15.99900 " \
"S 32.06000 " \
"SM 32.06000 " \
"SS 32.06000 " \
"HE 4.00260 " \
"NE 20.17970 " \
"CF1 12.01100 " \
"CF2 12.01100 " \
"CF3 12.01100 " \
"FE 55.84700 " \
"CLAL 35.45300 " \
"FA 18.99800 " \
"F1 18.99800 " \
"F2 18.99800 " \
"F3 18.99800 " \
"DUM 0.00000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"H 1.00800 " \
"HC 1.00800 " \
"HA 1.00800 " \
"HT 1.00800 " \
"HP 1.00800 " \
"HB 1.00800 " \
"HR1 1.00800 " \
"HR2 1.00800 " \
"HR3 1.00800 " \
"HS 1.00800 " \
"HE1 1.00800 " \
"HE2 1.00800 " \
"HA1 1.00800 " \
"HA2 1.00800 " \
"HA3 1.00800 " \
"HF1 1.00800 " \
"HF2 1.00800 " \
"C 12.01100 " \
"CA 12.01100 " \
"CT1 12.01100 " \
"CT2 12.01100 " \
"CT3 12.01100 " \
"CPH1 12.01100 " \
"CPH2 12.01100 " \
"CPT 12.01100 " \
"CY 12.01100 " \
"CP1 12.01100 " \
"CP2 12.01100 " \
"CP3 12.01100 " \
"CC 12.01100 " \
"CD 12.01100 " \
"CPA 12.01100 " \
"CPB 12.01100 " \
"CPM 12.01100 " \
"CM 12.01100 " \
"CS 12.01100 " \
"CE1 12.01100 " \
"CE2 12.01100 " \
"CST 12.01100 " \
"CT 12.01100 " \
"CT1x 12.01100 " \
"CT2x 12.01100 " \
"CT3x 12.01100 " \
"CN 12.01100 " \
"CAP 12.01100 " \
"COA 12.01100 " \
"C3 12.01100 " \
"N 14.00700 " \
"NR1 14.00700 " \
"NR2 14.00700 " \
"NR3 14.00700 " \
"NH1 14.00700 " \
"NH2 14.00700 " \
"NH3 14.00700 " \
"NC2 14.00700 " \
"NY 14.00700 " \
"NP 14.00700 " \
"NPH 14.00700 " \
"NC 14.00700 " \
"O 15.99900 " \
"OB 15.99900 " \
"OC 15.99900 " \
"OH1 15.99900 " \
"OS 15.99940 " \
"OT 15.99940 " \
"OM 15.99900 " \
"OST 15.99900 " \
"OCA 15.99900 " \
"S 32.06000 " \
"SM 32.06000 " \
"SS 32.06000 " \
"HE 4.00260 " \
"NE 20.17970 " \
"CF1 12.01100 " \
"CF2 12.01100 " \
"CF3 12.01100 " \
"FE 55.84700 " \
"CLAL 35.45300 " \
"FA 18.99800 " \
"F1 18.99800 " \
"F2 18.99800 " \
"F3 18.99800 " \
"DUM 0.00000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"HT 1.00800 " \
"OT 15.99940 " \
"HAS 1.00800 " \
"HOS 1.00800 " \
"CTS 12.01100 " \
"CBS 12.01100 " \
"OHS 15.99940 " \
"OES 15.99940 " \
"OXT 15.99940 " \
"HL 1.008000 " \
"HCL 1.008000 " \
"HT 1.008000 " \
"HOL 1.008000 " \
"HAL1 1.008000 " \
"HAL2 1.008000 " \
"HAL3 1.008000 " \
"HEL1 1.008000 " \
"HEL2 1.008000 " \
"CL 12.011000 " \
"CTL1 12.011000 " \
"CTL2 12.011000 " \
"CTL3 12.011000 " \
"CTL5 12.011000 " \
"CEL1 12.011000 " \
"CEL2 12.011000 " \
"NTL 14.007000 " \
"NH3L 14.007000 " \
"OBL 15.999400 " \
"OCL 15.999400 " \
"OT 15.999400 " \
"OSL 15.999400 " \
"O2L 15.999400 " \
"OHL 15.999400 " \
"PL 30.974000 " \
"SL 32.060000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"DUM 0.000000 " \
"HT 1.008000 " \
"HN1 1.008000 " \
"HN2 1.008000 " \
"HN3 1.008000 " \
"HN3B 1.008000 " \
"HN3C 1.008000 " \
"HNP 1.008000 " \
"HN4 1.008000 " \
"HN5 1.008000 " \
"HN6 1.008000 " \
"HN7 1.008000 " \
"HN8 1.008000 " \
"HN9 1.008000 " \
"HNE1 1.008000 " \
"HNE2 1.008000 " \
"CN1 12.011000 " \
"CN1A 12.011000 " \
"CN1T 12.011000 " \
"CN2 12.011000 " \
"CN3 12.011000 " \
"CN3A 12.011000 " \
"CN3B 12.011000 " \
"CN3C 12.011000 " \
"CN3D 12.011000 " \
"CN3T 12.011000 " \
"CN4 12.011000 " \
"CN5 12.011000 " \
"CN5G 12.011000 " \
"CN7 12.011000 " \
"CN7B 12.011000 " \
"CN7C 12.011000 " \
"CN7D 12.011000 " \
"CN8 12.011000 " \
"CN8B 12.011000 " \
"CN9 12.011000 " \
"CNE1 12.011000 " \
"CNE2 12.011000 " \
"CNA 12.011000 " \
"CNA2 12.011000 " \
"CN6 12.011000 " \
"CN7E 12.011000 " \
"NN1 14.007000 " \
"NN1C 14.007000 " \
"NN2 14.007000 " \
"NN2B 14.007000 " \
"NN2C 14.007000 " \
"NN2U 14.007000 " \
"NN2G 14.007000 " \
"NN3 14.007000 " \
"NN3A 14.007000 " \
"NN3I 14.007000 " \
"NN3G 14.007000 " \
"NN4 14.007000 " \
"NN5 14.007000 " \
"NN6 14.007000 " \
"OT 15.999400 " \
"ON1 15.999400 " \
"ON1C 15.999400 " \
"ON2 15.999400 " \
"ON3 15.999400 " \
"ON4 15.999400 " \
"ON5 15.999400 " \
"ON6 15.999400 " \
"ON6B 15.999400 " \
"ON2B 15.999400 " \
"FN1 18.998400 " \
"FNA 18.998400 " \
"P 30.974000 " \
"P2 30.974000 " \
"P3 30.974000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"DUM 0.001 " \
"CPH1 12.011000 " \
"CPH2 12.011000 " \
"HR3 1.008000 " \
"HR1 1.008000 " \
"NR1 14.007000 " \
"NR2 14.007000 " \
"HL 1.008000 " \
"HCL 1.008000 " \
"HT 1.008000 " \
"HOL 1.008000 " \
"HAL1 1.008000 " \
"HAL2 1.008000 " \
"HAL3 1.008000 " \
"HEL1 1.008000 " \
"HEL2 1.008000 " \
"CL 12.011000 " \
"CTL1 12.011000 " \
"CTL2 12.011000 " \
"CTL3 12.011000 " \
"CTL5 12.011000 " \
"CEL1 12.011000 " \
"CEL2 12.011000 " \
"NTL 14.007000 " \
"NH3L 14.007000 " \
"OBL 15.999400 " \
"OCL 15.999400 " \
"OT 15.999400 " \
"OSL 15.999400 " \
"O2L 15.999400 " \
"OHL 15.999400 " \
"PL 30.974000 " \
"SL 32.060000 " \
"CPH1 12.011000 " \
"CPH2 12.011000 " \
"HR3 1.008000 " \
"HR1 1.008000 " \
"NR1 14.007000 " \
"NR2 14.007000 " \
"HT 1.008000 " \
"HN1 1.008000 " \
"HN2 1.008000 " \
"HN3 1.008000 " \
"HN3B 1.008000 " \
"HN3C 1.008000 " \
"HNP 1.008000 " \
"HN4 1.008000 " \
"HN5 1.008000 " \
"HN6 1.008000 " \
"HN7 1.008000 " \
"HN8 1.008000 " \
"HN9 1.008000 " \
"HNE1 1.008000 " \
"HNE2 1.008000 " \
"CN1 12.011000 " \
"CN1A 12.011000 " \
"CN1T 12.011000 " \
"CN2 12.011000 " \
"CN3 12.011000 " \
"CN3A 12.011000 " \
"CN3B 12.011000 " \
"CN3C 12.011000 " \
"CN3D 12.011000 " \
"CN3T 12.011000 " \
"CN4 12.011000 " \
"CN5 12.011000 " \
"CN5G 12.011000 " \
"CN7 12.011000 " \
"CN7B 12.011000 " \
"CN7C 12.011000 " \
"CN7D 12.011000 " \
"CN8 12.011000 " \
"CN8B 12.011000 " \
"CN9 12.011000 " \
"CNE1 12.011000 " \
"CNE2 12.011000 " \
"CNA 12.011000 " \
"CNA2 12.011000 " \
"CN6 12.011000 " \
"CN7E 12.011000 " \
"NN1 14.007000 " \
"NN1C 14.007000 " \
"NN2 14.007000 " \
"NN2B 14.007000 " \
"NN2C 14.007000 " \
"NN2U 14.007000 " \
"NN2G 14.007000 " \
"NN3 14.007000 " \
"NN3A 14.007000 " \
"NN3I 14.007000 " \
"NN3G 14.007000 " \
"NN4 14.007000 " \
"NN5 14.007000 " \
"NN6 14.007000 " \
"OT 15.999400 " \
"ON1 15.999400 " \
"ON1C 15.999400 " \
"ON2 15.999400 " \
"ON3 15.999400 " \
"ON4 15.999400 " \
"ON5 15.999400 " \
"ON6 15.999400 " \
"ON6B 15.999400 " \
"ON2B 15.999400 " \
"FN1 18.998400 " \
"FNA 18.998400 " \
"P 30.974000 " \
"P2 30.974000 " \
"P3 30.974000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"DUM 0.001 " \
"CPH1 12.011000 " \
"CPH2 12.011000 " \
"HR3 1.008000 " \
"HR1 1.008000 " \
"NR1 14.007000 " \
"NR2 14.007000 " \
"H 1.00800 " \
"HC 1.00800 " \
"HA 1.00800 " \
"HT 1.00800 " \
"HP 1.00800 " \
"HB 1.00800 " \
"HR1 1.00800 " \
"HR2 1.00800 " \
"HR3 1.00800 " \
"HS 1.00800 " \
"HE1 1.00800 " \
"HE2 1.00800 " \
"HA1 1.00800 " \
"HA2 1.00800 " \
"HA3 1.00800 " \
"HF1 1.00800 " \
"HF2 1.00800 " \
"C 12.01100 " \
"CA 12.01100 " \
"CT1 12.01100 " \
"CT2 12.01100 " \
"CT3 12.01100 " \
"CPH1 12.01100 " \
"CPH2 12.01100 " \
"CPT 12.01100 " \
"CY 12.01100 " \
"CP1 12.01100 " \
"CP2 12.01100 " \
"CP3 12.01100 " \
"CC 12.01100 " \
"CD 12.01100 " \
"CPA 12.01100 " \
"CPB 12.01100 " \
"CPM 12.01100 " \
"CM 12.01100 " \
"CS 12.01100 " \
"CE1 12.01100 " \
"CE2 12.01100 " \
"CST 12.01100 " \
"CT 12.01100 " \
"CT1x 12.01100 " \
"CT2x 12.01100 " \
"CT3x 12.01100 " \
"CN 12.01100 " \
"CAP 12.01100 " \
"COA 12.01100 " \
"C3 12.01100 " \
"N 14.00700 " \
"NR1 14.00700 " \
"NR2 14.00700 " \
"NR3 14.00700 " \
"NH1 14.00700 " \
"NH2 14.00700 " \
"NH3 14.00700 " \
"NC2 14.00700 " \
"NY 14.00700 " \
"NP 14.00700 " \
"NPH 14.00700 " \
"NC 14.00700 " \
"O 15.99900 " \
"OB 15.99900 " \
"OC 15.99900 " \
"OH1 15.99900 " \
"OS 15.99940 " \
"OT 15.99940 " \
"OM 15.99900 " \
"OST 15.99900 " \
"OCA 15.99900 " \
"S 32.06000 " \
"SM 32.06000 " \
"SS 32.06000 " \
"HE 4.00260 " \
"NE 20.17970 " \
"CF1 12.01100 " \
"CF2 12.01100 " \
"CF3 12.01100 " \
"FE 55.84700 " \
"CLAL 35.45300 " \
"FA 18.99800 " \
"F1 18.99800 " \
"F2 18.99800 " \
"F3 18.99800 " \
"DUM 0.00000 " \
"HL 1.008000 " \
"HCL 1.008000 " \
"HT 1.008000 " \
"HOL 1.008000 " \
"HAL1 1.008000 " \
"HAL2 1.008000 " \
"HAL3 1.008000 " \
"HEL1 1.008000 " \
"HEL2 1.008000 " \
"CL 12.011000 " \
"CTL1 12.011000 " \
"CTL2 12.011000 " \
"CTL3 12.011000 " \
"CTL5 12.011000 " \
"CEL1 12.011000 " \
"CEL2 12.011000 " \
"NTL 14.007000 " \
"NH3L 14.007000 " \
"OBL 15.999400 " \
"OCL 15.999400 " \
"OT 15.999400 " \
"OSL 15.999400 " \
"O2L 15.999400 " \
"OHL 15.999400 " \
"PL 30.974000 " \
"SL 32.060000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"HN1 1.008000 " \
"HN2 1.008000 " \
"HN3 1.008000 " \
"HN3B 1.008000 " \
"HN3C 1.008000 " \
"HNP 1.008000 " \
"HN4 1.008000 " \
"HN5 1.008000 " \
"HN6 1.008000 " \
"HN7 1.008000 " \
"HN8 1.008000 " \
"HN9 1.008000 " \
"HNE1 1.008000 " \
"HNE2 1.008000 " \
"CN1 12.011000 " \
"CN1A 12.011000 " \
"CN1T 12.011000 " \
"CN2 12.011000 " \
"CN3 12.011000 " \
"CN3A 12.011000 " \
"CN3B 12.011000 " \
"CN3C 12.011000 " \
"CN3D 12.011000 " \
"CN3T 12.011000 " \
"CN4 12.011000 " \
"CN5 12.011000 " \
"CN5G 12.011000 " \
"CN7 12.011000 " \
"CN7B 12.011000 " \
"CN7C 12.011000 " \
"CN7D 12.011000 " \
"CN8 12.011000 " \
"CN8B 12.011000 " \
"CN9 12.011000 " \
"CNE1 12.011000 " \
"CNE2 12.011000 " \
"CNA 12.011000 " \
"CNA2 12.011000 " \
"CN6 12.011000 " \
"CN7E 12.011000 " \
"NN1 14.007000 " \
"NN1C 14.007000 " \
"NN2 14.007000 " \
"NN2B 14.007000 " \
"NN2C 14.007000 " \
"NN2U 14.007000 " \
"NN2G 14.007000 " \
"NN3 14.007000 " \
"NN3A 14.007000 " \
"NN3I 14.007000 " \
"NN3G 14.007000 " \
"NN4 14.007000 " \
"NN5 14.007000 " \
"NN6 14.007000 " \
"ON1 15.999400 " \
"ON1C 15.999400 " \
"ON2 15.999400 " \
"ON3 15.999400 " \
"ON4 15.999400 " \
"ON5 15.999400 " \
"ON6 15.999400 " \
"ON6B 15.999400 " \
"ON2B 15.999400 " \
"FN1 18.998400 " \
"FNA 18.998400 " \
"P 30.974000 " \
"P2 30.974000 " \
"P3 30.974000 " \
"SOD 22.989770 " \
"MG 24.305000 " \
"POT 39.102000 " \
"CES 132.900000 " \
"CAL 40.080000 " \
"CLA 35.450000 " \
"ZN 65.370000 " \
"DUM 0.001 " \
"H 1.00800 " \
"HC 1.00800 " \
"HA 1.00800 " \
"HT 1.00800 " \
"HP 1.00800 " \
"HR1 1.00800 " \
"HR2 1.00800 " \
"HR3 1.00800 " \
"HS 1.00800 " \
"HE1 1.00800 " \
"HE2 1.00800 " \
"HA1 1.00800 " \
"HA2 1.00800 " \
"HA3 1.00800 " \
"HB1 1.00800 " \
"HB2 1.00800 " \
"C 12.01100 " \
"CA 12.01100 " \
"CT1 12.01100 " \
"CT2 12.01100 " \
"CT3 12.01100 " \
"CPH1 12.01100 " \
"CPH2 12.01100 " \
"CPT 12.01100 " \
"CY 12.01100 " \
"CP1 12.01100 " \
"CP2 12.01100 " \
"CP3 12.01100 " \
"CC 12.01100 " \
"CD 12.01100 " \
"CPA 12.01100 " \
"CPB 12.01100 " \
"CPM 12.01100 " \
"CM 12.01100 " \
"CS 12.01100 " \
"CE1 12.01100 " \
"CE2 12.01100 " \
"N 14.00700 " \
"NR1 14.00700 " \
"NR2 14.00700 " \
"NR3 14.00700 " \
"NH1 14.00700 " \
"NH2 14.00700 " \
"NH3 14.00700 " \
"NC2 14.00700 " \
"NY 14.00700 " \
"NP 14.00700 " \
"NPH 14.00700 " \
"O 15.99900 " \
"OB 15.99900 " \
"OC 15.99900 " \
"OH1 15.99900 " \
"OS 15.99940 " \
"OT 15.99940 " \
"OM 15.99900 " \
"S 32.06000 " \
"SM 32.06000 " \
"SS 32.06000 " \
"HE 4.00260 " \
"NE 20.17970 " \
"LP 0.000000 " \
"CAL 40.08000 " \
"ZN 65.37000 " \
"FE 55.84700 " \
"DUM 0.00000 " \
"H 1.00800 " \
"HC 1.00800 " \
"HA 1.00800 " \
"HT 1.00800 " \
"LP 0.0 " \
"CT 12.01100 " \
"C 12.01100 " \
"CH1E 13.01900 " \
"CH2E 14.02700 " \
"CH3E 15.03500 " \
"CR1E 13.01900 " \
"CM 12.01100 " \
"N 14.00670 " \
"NR 14.00670 " \
"NP 14.00670 " \
"NH1E 15.01470 " \
"NH2E 16.02270 " \
"NH3E 17.03070 " \
"NC2E 16.02270 " \
"NH1 14.00670 " \
"NH2 14.00670 " \
"NH3 14.00670 " \
"NC2 14.00670 " \
"O 15.99940 " \
"OC 15.99940 " \
"OH1E 17.00740 " \
"OH2E 18.01540 " \
"OH1 15.99940 " \
"OH2 15.99940 " \
"OM 15.99940 " \
"OT 15.99940 " \
"OS 15.99940 " \
"S 32.06000 " \
"SH1E 33.06800 " \
"FE 55.84700 " \
"H 1.00800 " \
"H2 1.00800 " \
"HO 1.00800 " \
"HT 1.00800 " \
"LP 0.0 " \
"C 12.01100 " \
"CH 13.01900 " \
"C2 14.02700 " \
"CA 12.01100 " \
"CB 12.01100 " \
"CE 13.01900 " \
"CF 13.01900 " \
"C3 15.03500 " \
"CS 12.01100 " \
"N2 14.00670 " \
"NA 14.00670 " \
"NB 14.00670 " \
"NC 14.00670 " \
"NS 14.00670 " \
"NH2E 16.02270 " \
"NH3 14.00670 " \
"O 15.99940 " \
"O2 15.99940 " \
"OS 15.99940 " \
"OH 15.99940 " \
"OH2 15.99940 " \
"OT 15.99940 " \
"OSS 15.99940 " \
"OST 15.99940 " \
"SD 22.98980 " \
"P 30.97400 " \
"BR 79.90400 " \
"MG 24.30500 "
} {
set data [ split $data " " ]
set i 0
foreach value $data {
if { $value > " " } { incr i; set val($i) $value }
if { $i == 2 } {
set mass($val(1)) $val(2)
}
}
}
#
# Charm atom classes
#
foreach data { \
"S S " \
"O1 OC " \
"O2 OC " \
"O3 OC " \
"O4 OC " \
"N NH1 " \
"HN H " \
"CA CT1 " \
"HA HB " \
"CB CT3 " \
"HB1 HA " \
"HB2 HA " \
"HB3 HA " \
"C C " \
"O O " \
"N NH1 " \
"HN H " \
"CA CT1 " \
"HA HB " \
"CB CT2 " \
"HB1 HA " \
"HB2 HA " \
"CG CT2 " \
"HG1 HA " \
"HG2 HA " \
"CD CT2 " \
"HD1 HA " \
"HD2 HA " \
"NE NC2 " \
"HE HC " \
"CZ C " \
"NH1 NC2 " \
"HH11 HC " \
"HH12 HC " \
"NH2 NC2 " \
"HH21 HC " \
"HH22 HC " \