forked from prody/coMD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comd.tcl
1697 lines (1504 loc) · 78.6 KB
/
comd.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
# Copyright (c) 2010, University of Pittsburgh
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the <organization> nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package provide comd 1.0
package require solvate
package require autoionize
package require psfgen
package require autopsf
package require pbctools
package require exectool
set COMD_PATH $env(COMD_PATH)
set PACKAGE_PATH "$COMD_PATH"
set PACKAGEPATH "$COMD_PATH"
variable platform $tcl_platform(platform)
switch $platform {
unix {
set TMPDIR "/tmp" ; # or even $::env(TMPDIR), at times.
} macintosh {
set TMPDIR $::env(TRASH_FOLDER) ;# a better place?
} default {
set TMPDIR [pwd]
catch {set TMPDIR $::env(TMP)}
catch {set TMPDIR $::env(TEMP)}
}
}
namespace eval ::comd:: {
namespace export comd
variable version 1.0
variable w
# Variables for system setup
variable molid -1
# input files
variable walker1_pdb
variable walker2_pdb
variable walker1_chid
variable walker2_chid
# Ionization parameters
variable topo_file [list]
variable solvent_padding_x 15
variable solvent_padding_y 15
variable solvent_padding_z 15
# Minimization parameters
variable para_file [list]
variable temperature 298
variable min_length 500
# ANM-MC-Metropolis parameters
variable anm_cutoff ""
variable dev_mag ""
variable accept_para ""
variable max_steps ""
variable step_cutoff ""
# TMD options
variable spring_k 20000
variable tmd_len 10
# Simulation options
variable comd_cycle 100
variable num_cores ""
variable gpus_selected ""
variable gpus_selection1
variable gpus_selection2
variable gpus_present 1
variable python_path ""
variable NAMD_PATH ""
# output options
variable outputdir
variable output_prefix
variable from_commandline 0
variable run_now 1
variable start_dir [pwd]
# Logvew window counter
variable logcount 0
variable lognames [list]
variable titles [list "Prepare System"]
variable interfaces [list "prepare"]
variable which_mode [lindex $titles 0]
}
proc wsplit {string sep} {
set first [string first $sep $string]
if {$first == -1} {
return [list $string]
} else {
set l [string length $sep]
set left [string range $string 0 [expr {$first-1}]]
set right [string range $string [expr {$first+$l}] end]
return [concat [list $left] [wsplit $right $sep]]
}
}
proc comd::Logview {log_file_name} {
variable logcount
variable lognames
set logindex [lsearch $lognames $log_file_name]
set log .somenonsense
if {$logindex > -1} {
set windowname "log$logindex"
set log .$windowname
}
if {[winfo exists $log] == 0} {
if {$logindex > -1} {
lset lognames $logindex "somenonsense"
}
set logindex $logcount
lappend lognames $log_file_name
set windowname "log$logindex"
set log [toplevel ".$windowname"]
wm title $log "Logfile [lindex [file split $log_file_name] end] ($log_file_name)"
wm resizable $log 1 1
incr logcount
text $log.text -bg White -bd 2 \
-yscrollcommand ".$windowname.vscr set"
scrollbar $log.vscr -command ".$windowname.text yview"
pack $log.text -side left -fill both -expand 1
pack $log.vscr -side right -fill y
}
$log.text configure -state normal
#set count 0
#set tabwidth 0
#foreach family [lsort -dictionary [font families]] {
# $log.text tag configure f[incr count] -font [list $family 10]
# $log.text insert end ${family}:\t {} \
# "This is a simple sampler\n" f$count
# set w [font measure [$log.text cget -font] ${family}:]
# if {$w+5 > $tabwidth} {
# set tabwidth [expr {$w+5}]
# $log.text configure -tabs $tabwidth
# }
#}
$log.text delete 1.0 end
set logfile [open $log_file_name "r"]
set line ""
while {[gets $logfile line] != -1} {
$log.text insert end "$line\n"
}
close $logfile
$log.text yview moveto 1
$log.text configure -state disabled
}
proc ::comd::comdgui {} {
variable w
global env
# If already initialized, just turn on
if [winfo exists .comdgui] {
wm deiconify .comdgui
raise .comdgui
return
}
# Initialize window
set w [toplevel .comdgui]
wm title $w "COllective Molecular Dynamics v$::comd::version"
wm resizable $w 0 0
# Set main frame
set mf [frame $w.main_frame]
# VISUALIZE results
# Prepare System and Simulation Files
set mfa [frame $mf.prepare]
# Select input files
set mfaif [labelframe $mfa.input_files -text "Protein structures:" -bd 2]
# Initial PDB
grid [button $mfaif.ini_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The walker1 protein structure should be given in the standard PDB format."}] \
-row 1 -column 0 -sticky w
grid [label $mfaif.ini_label -text "Initial PDB: " -width 21] \
-row 1 -column 1 -sticky w
grid [entry $mfaif.ini_path -width 47 \
-textvariable ::comd::walker1_pdb] \
-row 1 -column 2 -columnspan 6 -sticky ew
grid [button $mfaif.ini_browse -text "Browse" -width 14 -pady 1 -command {
set tempfile [tk_getOpenFile \
-filetypes {{"PDB files" { .pdb .PDB }} {"All files" *}}]
if {![string equal $tempfile ""]} {
set ::comd::walker1_pdb $tempfile
} }] \
-row 1 -column 8 -columnspan 3 -sticky w
# Final PDB
grid [button $mfaif.fin_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The walker2 protein structure should be given in the standard PDB format."}] \
-row 2 -column 0 -sticky w
grid [label $mfaif.fin_label -text "Final PDB: " -width 21] \
-row 2 -column 1 -sticky w
grid [entry $mfaif.fin_path -width 47 \
-textvariable ::comd::walker2_pdb] \
-row 2 -column 2 -columnspan 6 -sticky ew
grid [button $mfaif.fin_browse -text "Browse" -width 14 -pady 1 -command {
set tempfile [tk_getOpenFile \
-filetypes {{"PDB files" { .pdb .PDB }} {"All files" *}}]
if {![string equal $tempfile ""]} {
set ::comd::walker2_pdb $tempfile
} }] \
-row 2 -column 8 -columnspan 3 -sticky w
grid [button $mfaif.inich_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The chain ID for the walker1 and walker2 structure which should be in the previously imported PDB file."}] \
-row 3 -column 0 -sticky w
grid [label $mfaif.inich_label -text "Initial PDB chain ID: " -width 21] \
-row 3 -column 1 -sticky w
grid [entry $mfaif.inich_entry -width 17 \
-textvariable ::comd::walker1_chid] \
-row 3 -column 2 -columnspan 3 -sticky ew
grid [label $mfaif.separatpr_label -width 6] \
-row 3 -column 5 -sticky w
grid [button $mfaif.finch_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The chain ID for the walker1 structure which should be in the previously imported PDB file."}] \
-row 3 -column 6 -sticky w
grid [label $mfaif.finch_label -text "Final PDB chain ID: " -width 21] \
-row 3 -column 7 -sticky w
grid [entry $mfaif.finch_entry -width 17 \
-textvariable ::comd::walker2_chid] \
-row 3 -column 8 -columnspan 3 -sticky ew
pack $mfaif -side top -ipadx 0 -ipady 5 -fill x -expand 1
# Enter ionization options
set mfaio [labelframe $mfa.ionize_options -text "Ionization parameters" -bd 2]
#Solvation box padding and counter ions
grid [button $mfaio.padding_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "This is the half of the walker1 distance between the protein \
and its imaginary copies under periodic boundary conditions. For systems with \
probes, the resulting padding distance will be slightly larger, due to \
constraint of preserving the ratio of 20 water molecules per probe molecule."}] \
-row 0 -column 0 -sticky w
grid [label $mfaio.padding_label -text "Box padding (A): " -width 21] \
-row 0 -column 1 -sticky w
grid [entry $mfaio.padding_entry_x -width 5 \
-textvariable ::comd::solvent_padding_x] \
-row 0 -column 2 -sticky ew
grid [entry $mfaio.padding_entry_y -width 5 \
-textvariable ::comd::solvent_padding_y] \
-row 0 -column 3 -sticky ew
grid [entry $mfaio.padding_entry_z -width 5 \
-textvariable ::comd::solvent_padding_z] \
-row 0 -column 4 -sticky ew
grid [label $mfaio.separatpr_label -width 6] \
-row 1 -column 5 -sticky w
grid [button $mfaio.neutralize_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "By default, counter ions will be added to neutralize a charged \
system. A charged system (if the protein is charged) may be obtained by unchecking this option."}] \
-row 0 -column 6 -sticky w
grid [label $mfaio.neutralize_label -text "Add counter ions: " -width 21] \
-row 0 -column 7 -sticky w
grid [checkbutton $mfaio.neutralize_check -width 1 \
-variable ::comd::neutralize] \
-row 0 -column 8 -sticky e
grid [entry $mfaio.salt_conc_entry -width 13 \
-textvariable ::comd::salt_concentration] \
-row 0 -column 9 -columnspan 2 -sticky w
$mfaio.neutralize_check select
pack $mfaio -side top -ipadx 0 -ipady 5 -fill x -expand 1
#Topology files
grid [button $mfaio.topo_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "Multiple topology files can be specified that will be given to psfgen package of vmd. \
Therefore, from given static structure this will create bonds, angles and various structural elements \
based on topology parameters provided. Suggested file extension is .top but others will be accepted."}] \
-row 1 -column 0 -sticky w
grid [label $mfaio.topo_label -text "Topology files: " -width 21] \
-row 1 -column 1 -sticky w
grid [frame $mfaio.topo_frame] \
-row 1 -rowspan 6 -column 2 -columnspan 6 -sticky w
scrollbar $mfaio.topo_frame.scroll -command "$mfaio.topo_frame.list yview"
listbox $mfaio.topo_frame.list -activestyle dotbox \
-yscroll "$mfaio.topo_frame.scroll set" \
-width 45 -height 6 -setgrid 1 -selectmode browse \
-listvariable ::comd::topo_file
frame $mfaio.topo_frame.buttons
pack $mfaio.topo_frame.list $mfaio.topo_frame.scroll -side left -fill y -expand 1
grid [button $mfaio.topo_add -text "Add" -width 14 -pady 1 \
-command [namespace code {
set tempfiles [tk_getOpenFile -multiple 1 \
-filetypes { {{Topology files} {.top .TOP .rtf .RTF .str .STR}} {{All files} {*}} }]
if {$tempfiles!=""} {
foreach tempfile $tempfiles {
if {[lsearch $::comd::topo_file $tempfile] > -1} {
tk_messageBox -type ok -title "WARNING" \
-message "$tempfile has already been added to the list."
} else {
lappend ::comd::topo_file $tempfile
}
}
}
}]] \
-row 1 -column 8 -columnspan 3 -sticky w
grid [button $mfaio.topo_delete -text "Remove" -width 14 -pady 1 \
-command [namespace code {
foreach i [.comdgui.main_frame.prepare.ionize_options.topo_frame.list curselection] {
.comdgui.main_frame.prepare.ionize_options.topo_frame.list delete $i
} }]] \
-row 2 -column 8 -columnspan 3 -sticky w
# Enter minimization options
set mfamo [labelframe $mfa.minimize_options -text "Minimization parameters" -bd 2]
#Temperature and minimization length parameters
grid [button $mfamo.temperature_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The temperature for molecular dynamics simulation needs to be entered. The units are in Kelvin."}] \
-row 0 -column 0 -sticky w
grid [label $mfamo.temperature_label -text "Temperature (K): " -width 21] \
-row 0 -column 1 -sticky w
grid [entry $mfamo.temperature_entry -width 17 \
-textvariable ::comd::temperature] \
-row 0 -column 2 -columnspan 3 -sticky ew
grid [label $mfamo.separatpr_label -width 6] \
-row 0 -column 5 -sticky w
grid [button $mfamo.length_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "After running targeted molecular dynamics simulations the walker2 structure needs to be equilibrated into a stable state. Longer minimization creates
more stable structures which will guarantee users have a stable targeted molecular dynamics simulation. The units are in ps. "}] \
-row 0 -column 6 -sticky w
grid [label $mfamo.length_label -text "Minimization length (steps): " -width 21] \
-row 0 -column 7 -sticky w
grid [entry $mfamo.length_entry -width 17 \
-textvariable ::comd::min_length] \
-row 0 -column 8 -columnspan 3 -sticky ew
#Parameter files
grid [button $mfamo.para_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "Multiple parameter files can be specified for the force field.
The file should be provided in par or prm format and include necessary parameters required for NAMD."}] \
-row 1 -column 0 -sticky w
grid [label $mfamo.para_label -text "Parameter files: " -width 21] \
-row 1 -column 1 -sticky w
grid [frame $mfamo.para_frame] \
-row 1 -rowspan 6 -column 2 -columnspan 6 -sticky w
scrollbar $mfamo.para_frame.scroll -command "$mfamo.para_frame.list yview"
listbox $mfamo.para_frame.list -activestyle dotbox \
-yscroll "$mfamo.para_frame.scroll set" \
-width 45 -height 6 -setgrid 1 -selectmode browse \
-listvariable ::comd::para_file
frame $mfamo.para_frame.buttons
pack $mfamo.para_frame.list $mfamo.para_frame.scroll \
-side left -fill y -expand 1
grid [button $mfamo.para_add -text "Add" -width 14 -pady 1 \
-command [namespace code {
set tempfiles [tk_getOpenFile -multiple 1 \
-filetypes { {{Parameter files} {.par .PAR .prm .PRM .str .STR}} {{All files} {*}} }]
if {$tempfiles!=""} {
foreach tempfile $tempfiles {
if {[lsearch $::comd::para_file $tempfile] > -1} {
tk_messageBox -type ok -title "WARNING" \
-message "$tempfile has already been added to the list."
} else {
lappend ::comd::para_file $tempfile
}
}
}
}]] \
-row 1 -column 8 -columnspan 3 -sticky w
grid [button $mfamo.para_delete -text "Remove" -width 14 -pady 1 \
-command [namespace code {
foreach i [.comdgui.main_frame.prepare.minimize_options.para_frame.list curselection] {
.comdgui.main_frame.prepare.minimize_options.para_frame.list delete $i
} }]] \
-row 2 -column 8 -columnspan 3 -sticky w
pack $mfamo -side top -ipadx 0 -ipady 5 -fill x -expand 1
set mfamc [labelframe $mfa.anmmc_options -text "ANM-MC-Metropolis options:" -bd 2]
#grid [button $mfamc.anmcut_help -text "?" -width 1 -padx 0 -pady 0 -command {
# tk_messageBox -type ok -title "HELP" \
# -message "In ANM calculations, the cutoff parameter is the maximum distance that two residues are in contact. The units are A. "}] \
# -row 0 -column 0 -sticky w
#grid [label $mfamc.anmc_label -text "ANM cutoff (A): " -width 21] \
# -row 0 -column 1 -sticky w
#grid [entry $mfamc.anmc_field -width 17 \
# -textvariable ::comd::anm_cutoff] \
# -row 0 -column 2 -columnspan 3 -sticky w
grid [button $mfamc.step_cutoffut_help -text "?" -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "To keep structure intact and to avoid having unrealistic \
and very different structures in ANM-MC step, an rmsd threshold is used. Suggested value is 4 A."}] \
-row 0 -column 0 -sticky w
grid [label $mfamc.step_cutoff_label -text "Step cutoff (A):"] \
-row 0 -column 1 -sticky w
grid [entry $mfamc.step_cutoff_field -width 17 \
-textvariable ::comd::step_cutoff] \
-row 0 -column 2 -columnspan 3 -sticky w
grid [label $mfamc.separatpr1_label -width 6] \
-row 0 -column 5 -sticky w
grid [button $mfamc.dev_mag_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The scaling factor used when disturbing the protein structure in ANM-MC steps. Default and suggested value is 0.1 A."}] \
-row 0 -column 6 -sticky w
grid [label $mfamc.dev_mag_label -text "Deviation (A): " -width 21] \
-row 0 -column 7 -sticky w
grid [entry $mfamc.dev_mag_field -width 17 \
-textvariable ::comd::dev_mag] \
-row 0 -column 8 -columnspan 3 -sticky w
grid [button $mfamc.accept_para_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The starting value for the acceptance parameter in ANM-MC steps. Default and suggested value is 0.1."}] \
-row 1 -column 0 -sticky w
grid [label $mfamc.accept_para_label -text "Acceptance ratio: " -width 21] \
-row 1 -column 1 -sticky w
grid [entry $mfamc.accept_para_field -width 17 \
-textvariable ::comd::accept_para] \
-row 1 -column 2 -columnspan 3 -sticky w
grid [label $mfamc.separatpr2_label -width 6] \
-row 1 -column 5 -sticky w
grid [button $mfamc.max_steps_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The maximal number of steps in ANM-MC step. Default and suggested value is 1000000."}] \
-row 1 -column 6 -sticky w
grid [label $mfamc.max_steps_label -text "Max no of ANM steps: " -width 21] \
-row 1 -column 7 -sticky w
grid [entry $mfamc.max_steps_field -width 17 \
-textvariable ::comd::max_steps] \
-row 1 -column 8 -columnspan 3 -sticky w
pack $mfamc -side top -ipadx 0 -ipady 5 -fill x -expand 1
set mfatm [labelframe $mfa.tmd_options -text "TMD options:" -bd 2]
grid [button $mfatm.spring_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "In targeted molecular dynamics simulation, the target potential is harmonic and \
the spring constant term shows the force applied to a given structure to reach the target structure."}] \
-row 0 -column 0 -sticky w
grid [label $mfatm.spring_label -text "Spring constant: " -width 21] \
-row 0 -column 1 -sticky w
grid [entry $mfatm.spring_field -width 17 \
-textvariable ::comd::spring_k] \
-row 0 -column 2 -columnspan 3 -sticky w
grid [label $mfatm.separatpr2_label -width 6] \
-row 0 -column 5 -sticky w
grid [button $mfatm.tmd_len_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The length of targeted molecular dynamics simulations in the units of ps. The length of collective molecular dynamics will change based on the structure and for a structure with 200 residues suggested length is in the order of hundreds."}] \
-row 0 -column 6 -sticky w
grid [label $mfatm.tmd_len_label -text "TMD length (ps): " -width 21] \
-row 0 -column 7 -sticky w
grid [entry $mfatm.tmd_len_field -width 17 \
-textvariable ::comd::tmd_len] \
-row 0 -column 8 -columnspan 3 -sticky w
pack $mfatm -side top -ipadx 0 -ipady 5 -fill x -expand 1
########################################3
set mfaso [labelframe $mfa.simulation_options -text "Simulation options:" -bd 2]
grid [button $mfaso.cmd_cyc_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "Each CoMD cycle consists of minimization, ANM-MC-Metropolis disturbances and targeted molecular dynamics. Please choose the maximum number of cycles performed. Fewer cycles may be run if the starting and walker2 structures for a given cycle are very close."}] \
-row 0 -column 0 -sticky w
grid [label $mfaso.cmd_cyc_label -text "No of coMD cycles: " -width 21] \
-row 0 -column 1 -sticky w
grid [entry $mfaso.cmd_cyc_field -width 17 \
-textvariable ::comd::comd_cycle] \
-row 0 -column 2 -columnspan 3 -sticky w
grid [label $mfaso.separatpr1_label -width 6] \
-row 0 -column 5 -sticky w
grid [button $mfaso.run_now_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "If this is checked the simulations will run as soon as the system is prepared"}] \
-row 0 -column 6 -sticky w
grid [label $mfaso.run_now_label -text "Run now: " -width 21] \
-row 0 -column 7 -sticky w
grid [label $mfaso.separatpr2_label -width 13] \
-row 1 -column 8 -columnspan 2 -sticky w
grid [checkbutton $mfaso.run_now_check -width 1 \
-variable ::comd::run_now] \
-row 0 -column 10 -sticky e
grid [button $mfaso.gpu_id_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The identifiers for the GPUs that will run your TMD simulation separated by commas. NAMD can use one GPU per thread and multiple threads can share GPUs."}] \
-row 1 -column 0 -sticky w
grid [label $mfaso.gpu_id_label -text "GPU IDs: " -width 21] \
-row 1 -column 1 -sticky w
grid [entry $mfaso.gpu_id_field -width 17 \
-textvariable ::comd::gpus_selected] \
-row 1 -column 2 -columnspan 3 -sticky w
grid [label $mfaso.separatpr3_label -width 6] \
-row 1 -column 5 -sticky w
grid [button $mfaso.num_cores_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "The number of physical cores in the cluster or PC that will run your TMD simulation. NAMD is running parallel on CPUs."}] \
-row 1 -column 6 -sticky w
grid [label $mfaso.num_cores_label -text "No of physical cores: " -width 21] \
-row 1 -column 7 -sticky w
grid [entry $mfaso.num_cores -width 17 \
-textvariable ::comd::num_cores] \
-row 1 -column 8 -columnspan 3 -sticky ew
pack $mfaso -side top -ipadx 0 -ipady 5 -fill x -expand 1
########################################4
set mfaoo [labelframe $mfa.output_options -text "Output options:" -bd 2]
grid [button $mfaoo.outdir_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "Output folder, default is current working directory."}] \
-row 0 -column 0 -sticky w
grid [label $mfaoo.outdir_label -text "Output folder: " -width 21] \
-row 0 -column 1 -sticky w
grid [entry $mfaoo.outdir_path -width 47 -textvariable ::comd::outputdir] \
-row 0 -column 2 -columnspan 6 -sticky ew
grid [button $mfaoo.dcd_browse -text "Browse" -width 14 -pady 1 -command {
set tempfile [tk_chooseDirectory]
if {![string equal $tempfile ""]} {
set ::comd::outputdir $tempfile
}}] \
-row 0 -column 8 -columnspan 3 -sticky w
grid [button $mfaoo.prefix_help -text "?" -width 1 -padx 0 -pady 0 -command {
tk_messageBox -type ok -title "HELP" \
-message "All output files and folders will start with this prefix.\
A unique and descriptive prefix choice may allow running multiple simulations in the same folder."}] \
-row 1 -column 0 -sticky w
grid [label $mfaoo.prefix_label -text "Output prefix: " -width 21] \
-row 1 -column 1 -sticky w
grid [entry $mfaoo.prefix_path -width 17 \
-textvariable ::comd::output_prefix] \
-row 1 -column 2 -columnspan 3 -sticky w
grid [label $mfaoo.separator_label -width 6] \
-row 1 -column 5 -sticky w
pack $mfaoo -side top -ipadx 0 -ipady 5 -fill x -expand 1
# Prepare System
button $mfa.button -text "Prepare System" -command ::comd::Prepare_system -bd 3
pack $mfa.button
pack $mfa -side top -padx 0 -pady 0 -fill x -expand 1
pack $mf -side top -padx 0 -pady 0 -fill x -expand 1
return $w
}
proc ::comd::Prepare_system {} {
# WHAT IS NEW?
# 3.1 - Bug fixes and suchlike
# 3.0 - Can now be run from the command line
# 2.1 - Bug fixes, and file checks
# 2.0 - Improved system setup provides lesser number of solvent atoms
# 2.0 - Cleans up intermediate files
# 2.0 - Outputs a log file for troubleshooting, and further intstructions
# 2.0 - NAMD configuration files are prepared for a single or multiple
# simulations
# HOW THE CODE WORKS
# The code will
# (1) solvate the protein, or everything in the PDB/PSF files that you provide
# (2) add counter ions to neutralize the system
# (3) write output files for each simulation
# Setups of multiple simulations differ only at random number seeds.
# This will be sufficient to result in a different trajectory.
variable w
variable pro
if {$::comd::outputdir != ""} {
if {![file isdirectory $::comd::outputdir]} {
if {[catch {file mkdir $::comd::outputdir}]} {
if {[info exists ::comd::from_commandline]} {
error "Could not make output folder: $::comd::outputdir"
} else {
tk_messageBox -type ok -title "ERROR" \
-message "Could not make output folder: $::comd::outputdir"
}
return
}
}
}
if {$::comd::walker1_pdb == "" || $::comd::walker2_pdb == ""} {
tk_messageBox -type ok -title "ERROR" \
-message "Both PDB files must be specified."
return
}
if {$::comd::solvent_padding_z < 4} {
tk_messageBox -type ok -title "ERROR" \
-message "Solvent box padding parameter must be larger than 4 A at least in the z direction."
return
}
if {[string length [string trim $::comd::output_prefix]] == 0} {
tk_messageBox -type ok -title "ERROR" \
-message "Please enter a descriptive name (prefix) for the system."
return
}
if {$::comd::temperature == ""} {
tk_messageBox -type ok -title "ERROR" \
-message "The temperature must be specified."
return
}
if {$::comd::gpus_selected == ""} {
if {[catch {
set output [eval exec "nvidia-smi"]
set records [split $output "\n"]
set j [llength $records]
set k 0
set i 0
set done_header 0
set found_processes 0
set ::comd::gpus_selected [list]
foreach rec $records {
set found_processes [string match *Processes* $rec]
if {$found_processes == 1} {break}
if {$i == 6 && $done_header == 0} {
set done_header 1
set i 0
} elseif {$done_header && $i == 1} {
set fields [split $rec " "]
lappend ::comd::gpus_selected [lindex $fields 3]
} elseif {$done_header && $i == 3} {
set i 0
}
incr i
incr k
}
set ::comd::gpus_selected [lreplace $::comd::gpus_selected [expr {[llength $::comd::gpus_selected]-1 }] [expr {[llength $::comd::gpus_selected]-1 }]]
}]} {
set ::comd::gpus_present 0
} else {
set ::comd::gpus_present 1
}
} else {
set ::comd::gpus_selected [split $::comd::gpus_selected ","]
}
# Divide the GPUs between the two runs if there are two runs and we have an even number of GPUs
if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]
&& [expr [llength $::comd::gpus_selected] % 2 == 0]
} then {
set ::comd::gpus_selection1 [list]
set ::comd::gpus_selection2 [list]
for {set i 0} {$i < [expr [llength $::comd::gpus_selected]/2]} {incr i} {
lappend ::comd::gpus_selection1 [lindex $::comd::gpus_selected $i]
lappend selection2 [lindex $::comd::gpus_selected [expr {${i} + [llength $::comd::gpus_selected]/2 }]]
}
} else {
if {[expr [llength $::comd::gpus_selected] > 1]} {
set ::comd::gpus_selected [join $::comd::gpus_selected ","]
}
set ::comd::gpus_selection1 $::comd::gpus_selected
set ::comd::gpus_selection2 $::comd::gpus_selected
}
# Linux version
if {$::comd::num_cores == ""} {
if {!([catch {set num_cores [expr {[eval "exec cat /proc/cpuinfo | grep processor | tail -n 1 | awk \"\{ print \\\$3 \}\""] + 1}]}])} {
set ::comd::num_cores $num_cores
}
}
# Mac version
if {$::comd::num_cores == ""} {
if {!([catch {set num_cores [exec sysctl -a | grep machdep.cpu | grep thread_count | awk "{ print \$2}"]}])} {
set ::comd::num_cores $num_cores
}
}
global env
global COMD_PATH
set log_file [open [file join "$::comd::outputdir" "$::comd::output_prefix.log"] w]
puts $log_file "---==## [clock format [clock seconds]] #==---"
puts $log_file "Version: $::comd::version"
puts $log_file "Info: Logging started for setup of $::comd::output_prefix."
puts $log_file "Solvation: Box padding $::comd::solvent_padding_x A in x, $::comd::solvent_padding_y A in y, $::comd::solvent_padding_z A in z."
####### SOLVATION AND IONIZATION OF WALKER 1 PROTEIN STRUCTURE #######
resetpsf
mol delete all
mol new $::comd::walker1_pdb
if {[info exists ::comd::walker1_chid] && ([string trim $::comd::walker1_chid] != "")} {
set pro [atomselect top "not altloc B and not hydrogen and chain $::comd::walker1_chid"]
} else {
set pro [atomselect top "not altloc B and not hydrogen and protein and not resname UNK"]
}
$pro writepdb init.pdb
mol delete all
mol new init.pdb
if {$::comd::topo_file == [list]} {
lappend ::comd::topo_file "$COMD_PATH/top_all36_prot.rtf"
lappend ::comd::topo_file "$COMD_PATH/toppar_water_ions.str"
}
autopsf -mol top -top $::comd::topo_file -prefix pro
solvate pro_formatted_autopsf.psf pro_formatted_autopsf.pdb \
-x $::comd::solvent_padding_x -y $::comd::solvent_padding_y -z $::comd::solvent_padding_z \
+x $::comd::solvent_padding_x +y $::comd::solvent_padding_y +z $::comd::solvent_padding_z -o pro_wb
set totalcharge 0
foreach charge [[atomselect top "all"] get charge] {
set totalcharge [expr $totalcharge + $charge]
}
# number of CL and NA atoms are determined
set nna 0
set ncl 0
puts $log_file "Ionization: Initial PDB System has a total charge of $totalcharge electrons."
if {$totalcharge > 0} {
set ncl [expr round($totalcharge)]
puts $log_file "Ionization: $ncl chloride ions will be added to walker1."
autoionize -psf pro_wb.psf -pdb pro_wb.pdb \
-o [file join $::comd::outputdir "walker1_ionized"] -from 5 -between 5 -nna $nna -ncl $ncl -seg ION
puts $log_file "Ionization: Initial PDB System is ionized to become neutral."
} elseif {$totalcharge < 0} {
set nna [expr -1 * round($totalcharge)]
puts $log_file "Ionization: $nna sodium ions will be added to walker1."
autoionize -psf pro_wb.psf -pdb pro_wb.pdb \
-o [file join $::comd::outputdir "walker1_ionized"] -from 5 -between 5 -nna $nna -ncl $ncl -seg ION
puts $log_file "Ionization: Initial PDB System is ionized to become neutral."
}
mol new init.pdb
set everyone [atomselect top "all"]
set walker1_lims [measure minmax $everyone]
set walker1_cent [measure center $everyone]
set ixmin [lindex $walker1_lims 0 0]
set ixmax [lindex $walker1_lims 1 0]
set iymin [lindex $walker1_lims 0 1]
set iymax [lindex $walker1_lims 1 1]
set izmin [lindex $walker1_lims 0 2]
set izmax [lindex $walker1_lims 1 2]
set ixcen [lindex $walker1_cent 0]
set iycen [lindex $walker1_cent 1]
set izcen [lindex $walker1_cent 2]
set ixlen [expr {$ixmax-$ixmin+16}]
set iylen [expr {$iymax-$iymin+16}]
set izlen [expr {$izmax-$izmin+16}]
if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} {
####### SOLVATION AND IONIZATION OF WALKER 2 PROTEIN STRUCTURE #######
resetpsf
mol delete all
mol new $::comd::walker2_pdb
if {[info exists ::comd::walker2_chid] && ([string trim $::comd::walker2_chid] != "")} {
set pro [atomselect top "not altloc B and not hydrogen and chain $::comd::walker2_chid"]
} else {
set pro [atomselect top "not altloc B and not hydrogen and protein and not resname UNK"]
}
$pro writepdb fino.pdb
mol delete all
mol new fino.pdb
autopsf -mol top -top $::comd::topo_file -prefix pro
solvate pro_formatted_autopsf.psf pro_formatted_autopsf.pdb \
-x $::comd::solvent_padding_x -y $::comd::solvent_padding_y -z $::comd::solvent_padding_z \
+x $::comd::solvent_padding_x +y $::comd::solvent_padding_y +z $::comd::solvent_padding_z -o pro_wb
set totalcharge 0
foreach charge [[atomselect top "all"] get charge] {
set totalcharge [expr $totalcharge + $charge]
}
# number of CL and NA atoms are determined
set nna 0
set ncl 0
puts $log_file "Ionization: Final PDB System has a total charge of $totalcharge electrons."
if {$totalcharge > 0} {
set ncl [expr round($totalcharge)]
puts $log_file "Ionization: $ncl chloride ions will be added to walker2."
autoionize -psf pro_wb.psf -pdb pro_wb.pdb \
-o [file join $::comd::outputdir "walker2_ionized"] -from 5 -between 5 -nna $nna -ncl $ncl -seg ION
puts $log_file "Ionization: Final PDB System is ionized to become neutral."
} elseif {$totalcharge < 0} {
set nna [expr -1 * round($totalcharge)]
puts $log_file "Ionization: $nna sodium ions will be added to walker2."
autoionize -psf pro_wb.psf -pdb pro_wb.pdb \
-o [file join $::comd::outputdir "walker2_ionized"] -from 5 -between 5 -nna $nna -ncl $ncl -seg ION
puts $log_file "Ionization: Final PDB System is ionized to become neutral."
}
mol new fino.pdb
set everyone [atomselect top "all"]
set walker2_lims [measure minmax $everyone]
set walker2_cent [measure center $everyone]
set fxmin [lindex $walker2_lims 0 0]
set fxmax [lindex $walker2_lims 1 0]
set fymin [lindex $walker2_lims 0 1]
set fymax [lindex $walker2_lims 1 1]
set fzmin [lindex $walker2_lims 0 2]
set fzmax [lindex $walker2_lims 1 2]
set fxcen [lindex $walker2_cent 0]
set fycen [lindex $walker2_cent 1]
set fzcen [lindex $walker2_cent 2]
set fxlen [expr {$fxmax-$fxmin+16.0}]
set fylen [expr {$fymax-$fymin+16.0}]
set fzlen [expr {$fzmax-$fzmin+16.0}]
}
####### INITIAL MINIMIZATION OF STARTING PROTEIN STRUCTURES #######
puts $log_file "Simulation: NAMD configuration files for minimization written in ${::comd::output_prefix}_walker1_min"
if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} {
puts $log_file "and ${::comd::output_prefix}_walker2_min."
}
close $log_file
if {$::comd::para_file == [list]} {
lappend ::comd::para_file "$COMD_PATH/par_all36m_prot.prm"
lappend ::comd::para_file "$COMD_PATH/toppar_water_ions.str"
}
set tcl_file_name [file join "$::comd::outputdir" "$::comd::output_prefix.tcl"]
set tcl_file [open $tcl_file_name w]
puts $tcl_file "#This tcl file will run full collective molecular dynamics simulation with given parameters."
puts $tcl_file "cd $::comd::outputdir"
puts $tcl_file "set sh_filename \"${::comd::output_prefix}_min0.sh\""
puts $tcl_file "set sh_file \[open \$sh_filename w\]"
puts $tcl_file "package require exectool"
if {$::comd::NAMD_PATH == ""} {
puts $tcl_file "set namd2path \[::ExecTool::find \"namd2\"\]"
} else {
puts $tcl_file "set namd2path ${::comd::NAMD_PATH}"
}
if {$::comd::python_path == ""} {
puts $tcl_file "set python_path \[::ExecTool::find \"python\"\]"
} else {
puts $tcl_file "set python_path $::comd::python_path\/python"
}
puts $tcl_file "if {\$namd2path == \"\"} {"
puts $tcl_file "set err_file \[open \"$::comd::output_prefix.log\" a\]"
puts $tcl_file "puts \$err_file \"ERROR: namd2 binary not found\""
puts $tcl_file "exit"
puts $tcl_file "}"
puts $tcl_file "puts \$sh_file \"\\\#\\\!\\\/bin\\\/bash\""
# If there are two different walkers for initial and final structures, divide the CPU cores between them
if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} {
set ::comd::num_cores [expr {$::comd::num_cores / 2}]
}
#if {$::comd::gpus_present} {
# set processes_per_run [expr {[llength [wsplit $::comd::gpus_selection1 ","]] + 1}]
#
# if {[info exists ::comd::num_cores]} {
# set remainder [expr {$::comd::num_cores % $processes_per_run}]
# set processes_per_run [expr {$::comd::num_cores - $remainder - $processes_per_run}]
# }
#} else {
# set processes_per_run [expr {$::comd::num_cores - 1}]
#}
puts $tcl_file "puts \$sh_file \"NAMD=\\\"\$namd2path \+idlepoll \\\"\""
# Walker 1 minimization
puts $tcl_file "file mkdir \"${::comd::output_prefix}_walker1_min\""
puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker1_min\" \"min.conf\"\] w\]"
puts $tcl_file "puts \$namd_file \"coordinates ..\/walker1_ionized.pdb\""
puts $tcl_file "puts \$namd_file \"structure ..\/walker1_ionized.psf\""
puts $tcl_file "puts \$namd_file \"set temperature $::comd::temperature\""
puts $tcl_file "puts \$namd_file \"set outputname walker1_minimized0\""
puts $tcl_file "puts \$namd_file \"set firsttimestep 0\""
puts $tcl_file "puts \$namd_file \"paraTypeCharmm on\""
foreach tempfile $::comd::para_file {
puts $tcl_file "puts \$namd_file \"parameters $tempfile\""
}
puts $tcl_file "puts \$namd_file \"temperature $::comd::temperature\""
puts $tcl_file "puts \$namd_file \"cellBasisVector1 ${ixlen},0,0\""
puts $tcl_file "puts \$namd_file \"cellBasisVector2 0,${iylen},0\""
puts $tcl_file "puts \$namd_file \"cellBasisVector3 0,0,${izlen}\""
puts $tcl_file "puts \$namd_file \"cellOrigin ${ixcen},${iycen},${izcen}\""
puts $tcl_file "puts \$namd_file \"exclude scaled1-4\""
puts $tcl_file "puts \$namd_file \"1-4scaling 1.0\""
puts $tcl_file "puts \$namd_file \"cutoff 12.0\""
puts $tcl_file "puts \$namd_file \"timestep 1.0\""
puts $tcl_file "puts \$namd_file \"switching on\""
puts $tcl_file "puts \$namd_file \"switchdist 10.0\""
puts $tcl_file "puts \$namd_file \"pairlistdist 13.5\""
puts $tcl_file "puts \$namd_file \"rigidBonds none\""
puts $tcl_file "puts \$namd_file \"nonbondedFreq 1\""
puts $tcl_file "puts \$namd_file \"fullElectFrequency 1\""
puts $tcl_file "puts \$namd_file \"stepspercycle 5\""
puts $tcl_file "puts \$namd_file \"langevin on\""
puts $tcl_file "puts \$namd_file \"langevinDamping 5\""
puts $tcl_file "puts \$namd_file \"langevinTemp \\\$temperature\""
puts $tcl_file "puts \$namd_file \"langevinHydrogen on\""
puts $tcl_file "puts \$namd_file \"outputname \\\$outputname\""
puts $tcl_file "puts \$namd_file \"outputEnergies $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"outputPressure $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"restartfreq $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"dcdfreq $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"xstfreq $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"twoAwayX yes\""
puts $tcl_file "puts \$namd_file \"twoAwayY yes\""
puts $tcl_file "puts \$namd_file \"twoAwayZ yes\""
puts $tcl_file "puts \$namd_file \"minimize $::comd::min_length\""
puts $tcl_file "puts \$namd_file \"reinitvels \\\$temperature\""
puts $tcl_file "close \$namd_file"
puts $tcl_file "puts \$sh_file \"cd ${::comd::output_prefix}_walker1_min\""
puts $tcl_file "puts \$sh_file \"\\\$NAMD \+devices $::comd::gpus_selection1 \+ppn $::comd::num_cores min.conf > min0.log \\|\\| \\\$NAMD \+ppn $::comd::num_cores min.conf > min0.log \&\""
puts $tcl_file "puts \$sh_file \"cd ..\""
if {[expr {$::comd::walker1_pdb}] ne [expr {$::comd::walker2_pdb}]} {
# Walker 2 minimization
puts $tcl_file "file mkdir \"${::comd::output_prefix}_walker2_min\""
puts $tcl_file "set namd_file \[open \[file join \"${::comd::output_prefix}_walker2_min\" \"min.conf\"\] w\]"
puts $tcl_file "puts \$namd_file \"coordinates ..\/walker2_ionized.pdb\""
puts $tcl_file "puts \$namd_file \"structure ..\/walker2_ionized.psf\""
puts $tcl_file "puts \$namd_file \"set temperature $::comd::temperature\""
puts $tcl_file "puts \$namd_file \"set outputname walker2_minimized0\""
puts $tcl_file "puts \$namd_file \"set firsttimestep 0\""
puts $tcl_file "puts \$namd_file \"paraTypeCharmm on\""
foreach tempfile $::comd::para_file {
puts $tcl_file "puts \$namd_file \"parameters $tempfile\""
}
puts $tcl_file "puts \$namd_file \"temperature $::comd::temperature\""