-
Notifications
You must be signed in to change notification settings - Fork 3
/
nmwiz.tcl
4144 lines (3712 loc) · 160 KB
/
nmwiz.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
# NMWiz: Normal Mode Visualization, Animation, and Plotting
#
# $Id: nmwiz.tcl,v 1.15 2013/05/22 14:48:45 johns Exp $
#
# University of Illinois Open Source License
# Copyright 2010-2011 Ahmet Bakan
# All rights reserved.
#
# Designed and Developed by: Ahmet Bakan http://ahmetbakan.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the Software), to deal with
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to
# do so, subject to the following conditions:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimers.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimers in the documentation
# and/or other materials provided with the distribution.
#
# Neither the names of Theoretical and Computational Biophysics Group,
# University of Illinois at Urbana-Champaign, nor the names of its contributors
# may be used to endorse or promote products derived from this Software without
# specific prior written permission.
#
# THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS WITH THE SOFTWARE.
package require exectool
package require multiplot
package require heatmapper
package provide nmwiz 1.2
proc sign x {expr {($x>0) - ($x<0)}}
namespace eval ::NMWiz:: {
namespace export nmwizgui
namespace export initialize
variable guicount -1
variable tmpdir
variable titles [list]
variable preserview 1
variable plothandles [list]
#variable namespaces [list]
#variable nmwizguis [list]
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)}
}
}
proc getColorID {color} {
return [lsearch "blue red gray orange yellow tan silver green white pink cyan purple lime mauve ochre iceblue black yellow2 yellow3 green2 green3 cyan2 cyan3 blue2 blue3 violet violet2 magenta magenta2 red2 red3 orange2 orange3" $color]
}
proc showHelp {context} {
set windowname nmwizhelp
if {[winfo exists .$windowname] == 0} {
set log [toplevel ".$windowname"]
wm title $log "NMWiz Help"
wm resizable $log 1 1
incr logcount
text $log.text -bg White -bd 2 -font Courier \
-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
} else {
set log .$windowname
}
$log.text configure -state normal -wrap word
$log.text delete 1.0 end
if {$context == "wizard"} {
$log.text insert end "ProDy Interface\n"
$log.text insert end "===============\n\n"
$log.text insert end "\nActive Mode\n"
$log.text insert end "--------------\n\n"
$log.text insert end "Select the active mode for which you want to draw arrows or make an animation. "
$log.text insert end "Direction of arrows depicting the normal mode can be changed using +/- button. "
$log.text insert end "Arrows can be drawn along both directions by changing the options Mode Graphics Options panel. "
$log.text insert end "The selected color effects both arrow graphics and square fluctuation plots."
$log.text insert end "\n\n**RMSD**\n\n"
$log.text insert end "The RMSD corresponding to the displacement described by the arrows is displayed. User can change the RMSD value to rescale the arrows. "
$log.text insert end "The scaling factor that produces the specified RMSD is printed to the VMD console (along with the magnitude of the mode provided in NMD file). "
$log.text insert end "\n\n**Selection**\n\n"
$log.text insert end "Selection entry allows the user to display arrows for a subset of atoms.\n\n"
$log.text insert end "*TIP*: If the arrow graphics are too crowded or the display is slow, draw arrows for an evenly spaced subset of residues, e.g try 'name CA and residue % 4 == 0', which will draw an arrow for every fourth residue."
$log.text insert end "\n\n\n"
$log.text insert end "Mode Graphics\n"
$log.text insert end "--------------\n\n"
$log.text insert end "Id of the molecule that contains the arrow graphics of the active mode is shown in parentheses.\n\n"
$log.text insert end "Buttons:\n\n"
$log.text insert end " * Draw: draw/redraw arrow graphics for the active mode\n"
$log.text insert end " * Clean: remove most recently drawn arrow graphics\n"
$log.text insert end " * Hide/Show: hide/show most recently drawn arrow graphics\n"
$log.text insert end " * Options: show/hide arrow graphics option panel\n"
$log.text insert end "\nOptions:\n\n"
$log.text insert end "User can change arrow graphics properties and how NMWiz behave upon such changes in this panel.\n"
$log.text insert end "\nBy default:\n\n"
$log.text insert end " * arrow graphics are set to automatically change when graphics properties are changed by the user\n"
$log.text insert end " * current graphics are hidden the active mode is changed\n"
$log.text insert end "\nOptionally:\n\n"
$log.text insert end " * arrows can be drawn in both directions to look like a double headed arrow\n"
$log.text insert end " * arrows shorter than a length (A) can be hidden\n"
$log.text insert end "\nAdditionally, user can change:\n\n"
$log.text insert end " * width of the arrow cylinder\n"
$log.text insert end " * width/height of the arrow head code\n"
$log.text insert end " * graphics material and resolution"
$log.text insert end "\n\n\n"
$log.text insert end "Animations\n"
$log.text insert end "----------\n\n"
$log.text insert end "Id of the molecule that contains the most recently generated animation is shown in parentheses.\n\n"
$log.text insert end "Buttons:\n\n"
$log.text insert end " * Draw: animate fluctuations along the active mode\n"
$log.text insert end " * Play : play/pause the animation\n"
$log.text insert end " * Hide : hide/show the animation\n"
$log.text insert end " * Options: show/hide animation option panel\n"
$log.text insert end "\nOptions:\n\n"
$log.text insert end "User can elect automatic generation and continuous play of animations when the active mode changes. User can also select the number of frames in the animation."
$log.text insert end "\n\n\n"
$log.text insert end "Plotting\n"
$log.text insert end "--------\n\n"
$log.text insert end "Id of the molecule for displaying selected residues is shown in parentheses.\n\n"
$log.text insert end "Buttons:\n\n"
$log.text insert end " * Plot: plot squared-fluctuations along the active mode\n"
$log.text insert end " * Clear: clear all selections and selected atom labels\n"
$log.text insert end " * Hide/Show: hide/show the selected residues\n"
$log.text insert end " * Options: change plotting options\n"
$log.text insert end "\n\n\n"
$log.text insert end "Molecule Representations\n"
$log.text insert end "------------------------\n\n"
$log.text insert end "Id of the molecule that contains the structure is shown in parentheses.\n\n"
$log.text insert end "Buttons:\n\n"
$log.text insert end " * Update: update molecule representation\n"
$log.text insert end " * Focus: reset view to focus on the structure\n"
$log.text insert end " * Hide/Show: hide/show strudture\n"
$log.text insert end " * Options: change molecular system representation\n"
$log.text insert end "\nOptions:\n\n"
$log.text insert end "User can select the representation and coloring scheme. User can change the molecule representation settings manually, by setting 'Show structure as' to 'Custom'.\n\n"
$log.text insert end "Structure can be colored based on the `Mobility` of the residues in the active mode, based on 'Bfactors' that came in NMD file, or based on residue/atom 'Index'.\n\n"
$log.text insert end "In addition to the standard representations (e.g. Tube/Trace/Licorice), structure can be represented as an elastic network. Color scale method and midpoint can be used to adjust mobility and Bfactors based coloring."
$log.text insert end "User can set the cutoff distance, width of dynamic bonds, and node spheres. Note that changing the cutoff distance distance only affects representation, not the precalculated normal mode data.\n\n"
$log.text insert end "*TIP*: When visualizing a large system, display molecule at lower resolutions and/or try displaying fewer atoms if all atoms are displayed."
} elseif {$context == "prody"} {
$log.text insert end "ProDy Interface\n"
$log.text insert end "===============\n\n"
$log.text insert end "ProDy interface allows users to perform the following calculations for molecules loaded in VMD:\n\n"
$log.text insert end "* Anisotropic Network Model (ANM)\n"
$log.text insert end "* Gaussian Network Model (GNM)\n"
$log.text insert end "* Principal Component Analysis (PCA) a.k.a. Essential Dynamics Analysis (EDA)\n\n\n"
$log.text insert end "Atom Selection\n"
$log.text insert end "--------------\n\n"
$log.text insert end "First thing you need to do is selecting the molecule and specifying the atoms that you want to include in the calculations. "
$log.text insert end "If you do not see all molecules in the menu, click 'Update'."
$log.text insert end "\n\n\n"
$log.text insert end "ProDy Job Settings\n"
$log.text insert end "------------------\n\n"
$log.text insert end "Specify the calculation type and output options in this panel. "
$log.text insert end "Coordinate data for selected atoms and the NMD data after calculations will be written into the 'Output directory'. "
$log.text insert end "All output files will named after 'Output filename'.\n\n"
$log.text insert end "**ProDy Scripts**\n\n"
$log.text insert end "NMWiz will try to find the path to Python executable ('python' or 'python.exe') and ProDy script ('prody'). For this to work, both of these files must be in you PATH environment variable. If they are not found, you will be prompted to specify the path."
$log.text insert end "\n\n\n"
$log.text insert end "ANM/GNM Settings\n"
$log.text insert end "----------------\n\n"
$log.text insert end "Specify the following:\n\n"
$log.text insert end " * number of modes to be calculated\n"
$log.text insert end " * index of the frame (coordinate set) to be used in calculations\n"
$log.text insert end " * cutoff distance\n"
$log.text insert end " * force constant"
$log.text insert end "\n\n\n"
$log.text insert end "PCA/EDA Settings\n"
$log.text insert end "----------------\n\n"
$log.text insert end "Note that for PCA/EDA calculations molecule must have multiple frames. Specify the range of frames to be used in calculations. For large systems, prefer to write coordinates in DCD format to gain IO speed and save save disk space."
} elseif {$context == "compare"} {
$log.text insert end "Structure Comparison\n"
$log.text insert end "====================\n\n"
$log.text insert end "This interface allows the user to compare two molecules (or two frames of the same molecule) loaded in VMD. It can be used to align structures and draw deformation vector."
$log.text insert end "Follow these steps to compare structures:\n\n"
$log.text insert end "1) Load molecules into VMD\n\n"
$log.text insert end "Select the molecules that you want to compare. If you don't see the molecule, click 'Update' button. "
$log.text insert end "\n\n"
$log.text insert end "2) Select atoms and specify frames\n\n"
$log.text insert end "Make atom selections for each molecule (or frame). Note that the number of selected atoms must be the same. "
$log.text insert end "\n\n"
$log.text insert end "3) Align molecules (or frames)\n\n"
$log.text insert end "Before deformation vector is calculated, you need to align the molecules (or frames) to have a meaningful depiction of structural change. "
$log.text insert end "\n\n"
$log.text insert end "Finally, click 'Calculate' button to generate depiction of structural change and NMWiz GUI."
} elseif {$context == "frommolecule"} {
$log.text insert end "From Molecule\n"
$log.text insert end "=============\n\n"
$log.text insert end "This interface allows the user to analyze normal mode data present in file formats that are recognized by VMD. "
$log.text insert end "Follow these steps to analyze your data:\n\n"
$log.text insert end "1) Load data into VMD\n\n"
$log.text insert end "Normal mode data can be retrieved from a molecule with multiple frames in VMD. "
$log.text insert end "The molecule must contain both coordinate and normal mode data. "
$log.text insert end "First, you need to load the coordinate data as a new molecule and then load the normal mode data into the same molecule."
$log.text insert end "\n\n"
$log.text insert end "2) Select the molecule and atoms\n\n"
$log.text insert end "Select the molecule with normal mode data. If you don't see the molecule, click 'Update' button. "
$log.text insert end "You can also select a subset of atoms for which you want to display normal mode data graphics."
$log.text insert end "\n\n"
$log.text insert end "3) Specify data frames\n\n"
$log.text insert end "Frames that contain coordinate and normal mode data must be specified. "
$log.text insert end "Note that '0' is the index of the very first frame, and 'end' can be used to specify the last frame of the molecule. "
$log.text insert end "\n\n"
$log.text insert end "Finally, click load button to instantiate NMWiz window for selected data."
$log.text insert end "\n\n\n"
$log.text insert end "*TIP*: If normal mode data is calculated for all atom data for a large molecular system, select backbone or carbon alpha atoms "
$log.text insert end "for more responsive visual analysis experience, e.g enter 'name CA' as the selection string."
} elseif {$context == "main"} {
$log.text insert end "NMWiz Main\n"
$log.text insert end "==========\n\n\n"
$log.text insert end "Load Normal Mode Data\n"
$log.text insert end "---------------------\n\n"
$log.text insert end "Main interface allows user to load data into NMWiz in two ways: "
$log.text insert end "\n\n"
$log.text insert end "**Load NMD File**\n\n"
$log.text insert end "If you have an NMD file, click 'Load NMD file' button to select the file. "
$log.text insert end "The contents will be loaded and a Wizard window associated with the data will appear."
$log.text insert end "\n\n"
$log.text insert end "**From Molecule**\n\n"
$log.text insert end "Alternatively, when normal mode data is present in a file format that is recognized by VMD, "
$log.text insert end "load the files into VMD as a molecule and click 'From Molecule' button. A window will appear to "
$log.text insert end "facilitate selection of normal mode data from a molecule with multiple frames.\n\n"
$log.text insert end "Note that, data obtained from a molecule can be saved in NMD format from the Main window and NMD files can be parsed with ProDy for further analysis."
$log.text insert end "\n\n\n"
$log.text insert end "Perform NMA Calculations\n"
$log.text insert end "------------------------\n\n"
$log.text insert end "You can use NMWiz to perform NMA calculations via ProDy for molecules loaded in VMD. "
$log.text insert end "Click 'ProDy Interface' and follow the instructions therein for ANM, GNM, and PCA (EDA) calculations."
$log.text insert end "\n\n\n"
$log.text insert end "Settings and Options\n"
$log.text insert end "--------------------\n\n"
$log.text insert end "**Preserve View**\n\n"
$log.text insert end "When NMWiz loads data, VMD will shift focus to the new molecule. Check this to preserve the current view when loading a new dataset."
}
$log.text yview moveto 0
$log.text configure -state disabled
}
# Called by nmwiz_tk function
# Makes the Main Window
proc initGUI {} {
variable w
variable platform
if [winfo exists .nmwizgui] {
wm deiconify .nmwizgui
raise .nmwizgui
return
}
set w [toplevel .nmwizgui]
wm title $w "NMWiz 1.2 - Main"
wm resizable $w 0 0
set wmf [frame $w.mainframe -bd 2]
grid [button $wmf.loadnmd -width 20 -text "Load NMD File" -command {
set tempfile [tk_getOpenFile \
-filetypes {{"NMD files" { .nmd .NMD }} {"Text files" { .txt .TXT }} {"All files" *}}]
if {![string equal $tempfile ""]} {::NMWiz::loadNMD $tempfile}}] \
-row 3 -column 0 -columnspan 2 -sticky we
grid [button $wmf.fromol -width 20 -text "From Molecule" -command ::NMWiz::initFromMolecule] \
-row 5 -column 0 -columnspan 2 -sticky we
grid [button $wmf.prody -width 20 -text "ProDy Interface" -command ::NMWiz::initProdyGUI] \
-row 6 -column 0 -columnspan 2 -sticky we
grid [button $wmf.compare -width 20 -text "Structure Comparison" -command ::NMWiz::initStrComp] \
-row 7 -column 0 -columnspan 2 -sticky we
grid [button $wmf.showhelp -text "Help" \
-command {::NMWiz::showHelp main}] \
-row 8 -column 0 -sticky we
grid [button $wmf.website -text "Website" \
-command "vmd_open_url http://www.csb.pitt.edu/NMWiz/"] \
-row 8 -column 1 -sticky we
if {[molinfo num] > 0} {
set ::NMWiz::preserview 1
}
grid [checkbutton $wmf.preserview -text " preserve current view" \
-variable ::NMWiz::preserview] \
-row 10 -column 0 -columnspan 3 -sticky w
#pack $wmf.options -side top -fill x -expand 1
pack $wmf -side top -fill x -expand 1
#if {$::NMWiz::guicount > -1} {
# for {set i 0} {$i <= $::NMWiz::guicount} {incr i} {
# set ns "::nmgui$i"
# if {[namespace exists $ns]} {
foreach ns [namespace children :: "nmdset*"] {
set wgf [labelframe $w.{[string range $ns 2 end]}frame -text "[subst $${ns}::title]" -bd 2]
grid [button $wgf.show -text "GUI" \
-command "${ns}::nmwizgui" ] \
-row 0 -column 0 -sticky we
grid [button $wgf.remove -text "Remove" \
-command "::NMWiz::removeDataset $ns"] \
-row 0 -column 1 -sticky we
grid [button $wgf.save -text "Save" \
-command "::NMWiz::writeNMD $ns"] \
-row 0 -column 2 -sticky we
pack $wgf -side top -fill x -expand 1
}
# }
# }
#}
}
variable nmwizColors "blue red gray orange yellow tan green white pink \
cyan purple black yellow2 yellow3 green2 green3 \
cyan2 cyan3 blue2 blue3 violet magenta magenta2 red2 red3 orange2 \
orange3"
cd ~
variable outputdir [pwd]
variable defaultColor "yellow3"
variable prodyMolecule
variable prodyMolid -1
variable prodyNFrames 0
variable prodySelstr "protein and name CA or nucleic and name P C4' C2"
variable prodySelAtoms 0
variable prodyScript "ANM"
variable prodyPrefix ""
variable prodyHeatmap 0
variable prodyRmCoords 0
variable prodyPCAfile "DCD"
variable prodyPCAAligned 0
variable prodyTask ""
variable prodyFrame 0
variable prodyCutoff 15
variable prodyExtend none
variable prodyGNMCutoff 10
variable prodyGamma 1
variable prodyNModes 10
variable prodyFirstFrame 0
variable prodySkipFrame 1
variable prodyLastFrame end
variable fromolMolecule
variable fromolMolid -1
variable fromolNFrames 0
variable fromolSelstr "all"
variable fromolSelAtoms 0
variable fromolFrame 0
variable fromolFirstFrame 1
variable fromolLastFrame end
variable strcompRefSelstr "name CA and protein"
variable strcompTarSelstr "name CA and protein"
variable strcompRefMol ""
variable strcompTarMol ""
variable strcompRefFrame 0
variable strcompTarFrame 0
variable strcompRefid -1
variable strcompTarid -1
variable strcompRefN 0
variable strcompTarN 0
proc initStrComp {} {
variable strcompGUI
# If already initialized, just turn on
if [winfo exists .nmwizstrcomp] {
wm deiconify .nmwizstrcomp
raise .nmwizstrcomp
return
}
set strcompGUI [toplevel .nmwizstrcomp]
wm title $strcompGUI "NMWiz - Structure Comparison"
wm resizable $strcompGUI 0 0
# Main frame (molecule and selection)
set wmf [labelframe $strcompGUI.mainFrame -text "Molecule Selection" -bd 2]
grid [label $wmf.molRLabel -text "Reference"] \
-row 1 -column 2 -sticky w
grid [label $wmf.molTLabel -text "Target"] \
-row 1 -column 3 -sticky w
grid [label $wmf.molLabel -text "Molecule:"] \
-row 2 -column 1 -sticky w
grid [frame $wmf.refFrame] \
-row 2 -column 2 -sticky ew
tk_optionMenu $wmf.refFrame.list ::NMWiz::strcompRefMol ""
grid [frame $wmf.tarFrame] \
-row 2 -column 3 -sticky ew
tk_optionMenu $wmf.tarFrame.list ::NMWiz::strcompTarMol ""
grid [button $wmf.molUpdate -text "Update" \
-command ::NMWiz::strcompUpdateMolList] \
-row 2 -column 4 -sticky ew
grid [label $wmf.selstrLabel -text "Selection:"] \
-row 5 -column 1 -sticky w
grid [entry $wmf.selstrRefEntry -width 12 -textvariable ::NMWiz::strcompRefSelstr] \
-row 5 -column 2 -sticky ew
grid [entry $wmf.selstrTarEntry -width 12 -textvariable ::NMWiz::strcompTarSelstr] \
-row 5 -column 3 -sticky ew
grid [button $wmf.selUpdate -text "Select" \
-command ::NMWiz::strcompUpdateMolinfo] \
-row 5 -column 4 -sticky ew
grid [label $wmf.frameLabel -text "Frame:"] \
-row 7 -column 1 -sticky w
grid [entry $wmf.frameRefEntry -width 4 -textvariable ::NMWiz::strcompRefFrame] \
-row 7 -column 2 -sticky w
grid [entry $wmf.frameTarEntry -width 4 -textvariable ::NMWiz::strcompTarFrame] \
-row 7 -column 3 -sticky w
grid [label $wmf.selinfoLbl -text "Information:"] \
-row 8 -column 1 -sticky w
grid [label $wmf.selinfoRefLabel -text ""] \
-row 8 -column 2 -sticky w
grid [label $wmf.selinfoTarLabel -text ""] \
-row 8 -column 3 -sticky w
grid [label $wmf.selinfoRMSDLabel -text ""] \
-row 8 -column 4 -sticky w
grid [button $wmf.showHelp -text "Help" \
-command {::NMWiz::showHelp compare}] \
-row 12 -column 1 -sticky we
grid [button $wmf.rmsdUpdate -text "RMSD" \
-command ::NMWiz::strcompRMSD] \
-row 12 -column 2 -sticky ew
grid [button $wmf.align -text "Align" \
-command ::NMWiz::strcompAlign] \
-row 12 -column 3 -sticky ew
grid [button $wmf.prodySubmit -text "Calculate" \
-command ::NMWiz::calcDeform] \
-row 12 -column 4 -sticky we
pack $wmf -side top -fill x -expand 1
::NMWiz::strcompUpdateMolList
::NMWiz::strcompUpdateMolinfo
}
proc initFromMolecule {} {
variable fromolGUI
# If already initialized, just turn on
if [winfo exists .nmwizfromol] {
wm deiconify .nmwizfromol
raise .nmwizfromol
return
}
set fromolGUI [toplevel .nmwizfromol]
wm title $fromolGUI "NMWiz - From Molecule"
wm resizable $fromolGUI 0 0
# Main frame (molecule and selection)
set wmf [labelframe $fromolGUI.mainFrame -text "Molecule Selection" -bd 2]
grid [label $wmf.molLabel -text "Molecule:"] \
-row 2 -column 1 -sticky w
grid [frame $wmf.molFrame] \
-row 2 -column 2 -sticky ew
tk_optionMenu $wmf.molFrame.list ::NMWiz::fromolMolecule ""
grid [button $wmf.molUpdate -text "Update" \
-command ::NMWiz::fromolUpdateMolList] \
-row 2 -column 3 -sticky ew
grid [label $wmf.molinfoLbl -text "Information:"] \
-row 3 -column 1 -sticky w
grid [label $wmf.molinfoLabel -text ""] \
-row 3 -column 2 -columnspan 2 -sticky w
grid [label $wmf.selstrLabel -text "Selection:"] \
-row 5 -column 1 -sticky w
grid [entry $wmf.selstrEntry -width 20 -textvariable ::NMWiz::fromolSelstr] \
-row 5 -column 2 -sticky ew
grid [button $wmf.selUpdate -text "Select" \
-command ::NMWiz::fromolUpdateSelection] \
-row 5 -column 3 -sticky ew
grid [label $wmf.selinfoLbl -text "Information:"] \
-row 6 -column 1 -sticky w
grid [label $wmf.selinfoLabel -text ""] \
-row 6 -column 2 -columnspan 2 -sticky w
grid [label $wmf.frameLabel -text "Coordinate frame:"] \
-row 7 -column 1 -sticky w
grid [entry $wmf.frameEntry -width 4 -textvariable ::NMWiz::fromolFrame] \
-row 7 -column 2 -sticky w
grid [label $wmf.firstLabel -text "First mode frame:"] \
-row 8 -column 1 -sticky w
grid [entry $wmf.firstEntry -width 4 -textvariable ::NMWiz::fromolFirstFrame] \
-row 8 -column 2 -sticky w
grid [label $wmf.lastLabel -text "Last mode frame:"] \
-row 10 -column 1 -sticky w
grid [entry $wmf.lastEntry -width 4 -textvariable ::NMWiz::fromolLastFrame] \
-row 10 -column 2 -sticky w
grid [button $wmf.showHelp -text "Help" \
-command {::NMWiz::showHelp frommolecule}] \
-row 12 -column 1 -sticky we
grid [button $wmf.prodySubmit -text "Load data from molecule" \
-command ::NMWiz::fromMolecule] \
-row 12 -column 2 -columnspan 2 -sticky we
pack $wmf -side top -fill x -expand 1
::NMWiz::fromolUpdateMolList
::NMWiz::fromolUpdateMolinfo
}
proc initProdyGUI {} {
variable prodyGUI
# If already initialized, just turn on
if [winfo exists .nmwizprody] {
wm deiconify .nmwizprody
raise .nmwizprody
return
}
set prodyGUI [toplevel .nmwizprody]
wm title $prodyGUI "NMWiz - ProDy Interface"
wm resizable $prodyGUI 0 0
# Main frame (molecule and selection)
set wmf [labelframe $prodyGUI.mainFrame -text "Atom Selection" -bd 2]
grid [label $wmf.molLabel -text "Molecule:"] \
-row 2 -column 1 -sticky w
grid [frame $wmf.molFrame] \
-row 2 -column 2 -sticky ew
tk_optionMenu $wmf.molFrame.list ::NMWiz::prodyMolecule ""
grid [button $wmf.molUpdate -text "Update" \
-command ::NMWiz::prodyUpdateMolList] \
-row 2 -column 3 -sticky ew
grid [label $wmf.molinfoLbl -text "Information:"] \
-row 3 -column 1 -sticky w
grid [label $wmf.molinfoLabel -text ""] \
-row 3 -column 2 -columnspan 2 -sticky w
grid [label $wmf.selstrLabel -text "Selection:"] \
-row 5 -column 1 -sticky w
grid [entry $wmf.selstrEntry -width 20 -textvariable ::NMWiz::prodySelstr] \
-row 5 -column 2 -sticky ew
grid [button $wmf.selUpdate -text "Select" \
-command ::NMWiz::prodyUpdateSelection] \
-row 5 -column 3 -sticky ew
grid [label $wmf.selinfoLbl -text "Information:"] \
-row 6 -column 1 -sticky w
grid [label $wmf.selinfoLabel -text ""] \
-row 6 -column 2 -columnspan 2 -sticky w
pack $wmf -side top -fill x -expand 1
::NMWiz::prodyUpdateMolList
::NMWiz::prodyUpdateMolinfo
# ProDy job frame
set wf [labelframe $prodyGUI.jobFrame -text "ProDy Job Settings" -bd 2]
grid [label $wf.scriptLabel -text "ProDy job:"] \
-row 7 -column 1 -sticky w
grid [frame $wf.scriptFrame] \
-row 7 -column 2 -columnspan 2 -sticky ew
tk_optionMenu $wf.scriptFrame.list ::NMWiz::prodyTask "ANM calculation"
$wf.scriptFrame.list.menu delete 0 last
foreach script "ANM GNM PCA" {
$wf.scriptFrame.list.menu add radiobutton -label "$script calculation" \
-variable ::NMWiz::prodyTask \
-command "set ::NMWiz::prodyScript $script; ::NMWiz::prodyChangeTask; ::NMWiz::prodyUpdatePrefix"
incr counter
}
pack $wf.scriptFrame.list -side left -anchor w -fill x
variable prodyTask "ANM calculation"
grid [label $wf.outdLabel -text "Output directory:"] \
-row 8 -column 1 -sticky w
grid [entry $wf.outdEntry -width 16 -textvariable ::NMWiz::outputdir] \
-row 8 -column 2 -sticky ew
grid [button $wf.outdBrowse -text "Browse" \
-command {
set tempdir [tk_chooseDirectory -initialdir $::NMWiz::outputdir ]
if {![string equal $tempdir ""]} {set ::NMWiz::outputdir $tempdir}
}] \
-row 8 -column 3 -sticky ew
grid [label $wf.filepLabel -text "Output filename:"] \
-row 9 -column 1 -sticky w
grid [entry $wf.filepEntry -width 20 -textvariable ::NMWiz::prodyPrefix] \
-row 9 -column 2 -columnspan 2 -sticky we
grid [checkbutton $wf.heatmapEntry -text " write and load cross-correlations heatmap" \
-variable ::NMWiz::prodyHeatmap] \
-row 10 -column 1 -columnspan 3 -sticky w
grid [checkbutton $wf.rmfileEntry -text " remove coordinate file upon job completion" \
-variable ::NMWiz::prodyRmCoords] \
-row 11 -column 1 -columnspan 3 -sticky w
pack $wf -side top -fill x -expand 1
# ANM frame
set wf [labelframe $prodyGUI.anmFrame -text "ANM Settings" -bd 2]
grid [label $wf.modesLabel -text "Number of modes:"] \
-row 6 -column 1 -sticky w
grid [entry $wf.modesEntry -width 4 -textvariable ::NMWiz::prodyNModes] \
-row 6 -column 2 -sticky w
pack $wf -side top -fill x -expand 1
grid [label $wf.frameLabel -text "Frame number:"] \
-row 6 -column 3 -sticky w
grid [entry $wf.frameEntry -width 4 -textvariable ::NMWiz::prodyFrame] \
-row 6 -column 4 -sticky w
grid [label $wf.cutoffLabel -text "Cutoff distance (A):"] \
-row 8 -column 1 -sticky w
grid [entry $wf.cutoffEntry -width 4 -textvariable ::NMWiz::prodyCutoff] \
-row 8 -column 2 -sticky w
grid [label $wf.gammaLabel -text "Force constant:"] \
-row 8 -column 3 -sticky w
grid [entry $wf.gammaEntry -width 4 -textvariable ::NMWiz::prodyGamma] \
-row 8 -column 4 -sticky w
grid [label $wf.extendLabel -text "Extend model to:"] \
-row 9 -column 1 -sticky w
grid [frame $wf.extendto] \
-row 9 -column 2 -columnspan 3 -sticky w
radiobutton $wf.extendto.all -text "all atoms" -value "all" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.bb -text "backbone" -value "bb" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.none -text "none" -value "none" -variable ::NMWiz::prodyExtend
pack $wf.extendto.all $wf.extendto.bb $wf.extendto.none -side left
# GNM frame
set wf [labelframe $prodyGUI.gnmFrame -text "GNM Settings" -bd 2]
grid [label $wf.modesLabel -text "Number of modes:"] \
-row 6 -column 1 -sticky w
grid [entry $wf.modesEntry -width 4 -textvariable ::NMWiz::prodyNModes] \
-row 6 -column 2 -sticky w
grid [label $wf.frameLabel -text "Frame number:"] \
-row 6 -column 3 -sticky w
grid [entry $wf.frameEntry -width 4 -textvariable ::NMWiz::prodyFrame] \
-row 6 -column 4 -sticky w
grid [label $wf.cutoffLabel -text "Cutoff distance (A):"] \
-row 8 -column 1 -sticky w
grid [entry $wf.cutoffEntry -width 4 -textvariable ::NMWiz::prodyGNMCutoff] \
-row 8 -column 2 -sticky w
grid [label $wf.gammaLabel -text "Force constant:"] \
-row 8 -column 3 -sticky w
grid [entry $wf.gammaEntry -width 4 -textvariable ::NMWiz::prodyGamma] \
-row 8 -column 4 -sticky w
grid [label $wf.extendLabel -text "Extend model to:"] \
-row 9 -column 1 -sticky w
grid [frame $wf.extendto] \
-row 9 -column 2 -columnspan 3 -sticky w
radiobutton $wf.extendto.all -text "all atoms" -value "all" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.bb -text "backbone" -value "bb" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.none -text "none" -value "none" -variable ::NMWiz::prodyExtend
pack $wf.extendto.all $wf.extendto.bb $wf.extendto.none -side left
# PCA frame
set wf [labelframe $prodyGUI.pcaFrame -text "PCA (EDA) Settings" -bd 2]
grid [label $wf.modesLabel -text "Number of modes:"] \
-row 6 -column 1 -sticky w
grid [entry $wf.modesEntry -width 4 -textvariable ::NMWiz::prodyNModes \
] -row 6 -column 2 -sticky w
grid [label $wf.skipLabel -text "Frame stride:"] \
-row 6 -column 3 -sticky w
grid [entry $wf.skipEntry -width 4 -textvariable ::NMWiz::prodySkipFrame \
-validate all -validatecommand ::NMWiz::calcOutputSize \
] -row 6 -column 4 -sticky w
grid [label $wf.firstLabel -text "First frame:"] \
-row 8 -column 1 -sticky w
grid [entry $wf.firstEntry -width 4 -textvariable ::NMWiz::prodyFirstFrame \
-validate all -validatecommand ::NMWiz::calcOutputSize \
] -row 8 -column 2 -sticky w
grid [label $wf.lastLabel -text "Last frame:"] \
-row 8 -column 3 -sticky w
grid [entry $wf.lastEntry -width 4 -textvariable ::NMWiz::prodyLastFrame \
-validate all -validatecommand ::NMWiz::calcOutputSize \
] -row 8 -column 4 -sticky w
grid [label $wf.filetypeLabel -text "Trajectory type:"] \
-row 10 -column 1 -sticky w
grid [frame $wf.filetypeFrame] \
-row 10 -column 2 -columnspan 3 -sticky ew
tk_optionMenu $wf.filetypeFrame.list ::NMWiz::prodyPCAfile "DCD"
$wf.filetypeFrame.list.menu delete 0 last
foreach script "DCD PDB" {
$wf.filetypeFrame.list.menu add radiobutton -label "$script" \
-variable ::NMWiz::prodyPCAfile \
-command "::NMWiz::calcOutputSize"
incr counter
}
checkbutton $wf.filetypeFrame.alignedEntry -text " aligned" \
-variable ::NMWiz::prodyPCAAligned
pack $wf.filetypeFrame.list $wf.filetypeFrame.alignedEntry -side left \
-anchor w -fill x
variable prodyPCAfiletype "DCD"
grid [label $wf.infolabel -text "Trajectory info:"] \
-row 11 -column 1 -sticky w
grid [label $wf.infoentry -text "" ] \
-row 11 -column 2 -columnspan 3 -sticky w
grid [label $wf.extendLabel -text "Extend model to:"] \
-row 12 -column 1 -sticky w
grid [frame $wf.extendto] \
-row 12 -column 2 -columnspan 3 -sticky w
radiobutton $wf.extendto.all -text "all atoms" -value "all" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.bb -text "backbone" -value "bb" -variable ::NMWiz::prodyExtend
radiobutton $wf.extendto.none -text "none" -value "none" -variable ::NMWiz::prodyExtend
pack $wf.extendto.all $wf.extendto.bb $wf.extendto.none -side left
# Submit button
set wf [frame $prodyGUI.submitFrame -bd 2]
grid [button $wf.showHelp -text "Help" \
-command {::NMWiz::showHelp prody}] \
-row 0 -column 0 -sticky we
grid [button $wf.prodySubmit -text "Submit Job" \
-command ::NMWiz::prodySubmitJob] \
-row 0 -column 1 -sticky we
grid [button $wf.prodyWebsite -text "ProDy Website" \
-command "vmd_open_url http://www.csb.pitt.edu/ProDy"] \
-row 0 -column 2 -sticky we
pack $wf -side top -fill x -expand 1
}
proc prodyUpdateMolList {} {
variable prodyGUI
set wf $prodyGUI.mainFrame
$wf.molFrame.list.menu delete 0 last
set counter 0
variable prodyMolid -1
foreach id [molinfo list] {
if {[molinfo $id get numatoms] > 0 && [molinfo $id get numframes] > 0} {
if {$counter == 0} {
variable prodyMolid $id
}
$wf.molFrame.list.menu add radiobutton -label "[::NMWiz::cleanMolName $id] ($id)" \
-variable ::NMWiz::prodyMolecule \
-command "set ::NMWiz::prodyMolid $id; ::NMWiz::prodyUpdateMolinfo"
incr counter
}
}
pack $wf.molFrame.list -side left -anchor w -fill x
variable prodyMolid
if {$prodyMolid > -1} {
variable prodyMolecule "[::NMWiz::cleanMolName $prodyMolid] ($prodyMolid)"
}
::NMWiz::prodyUpdateMolinfo
::NMWiz::calcOutputSize
}
proc calcOutputSize {} {
variable prodyScript
if {$prodyScript != "PCA"} { return 1}
set numframes [molinfo $::NMWiz::prodyMolid get numframes]
if {!([string is digit $::NMWiz::prodyFirstFrame] && $::NMWiz::prodyFirstFrame >= 0 &&
$::NMWiz::prodyFirstFrame < $numframes)} { return 1}
set first $::NMWiz::prodyFirstFrame
if {!([string is digit $::NMWiz::prodySkipFrame] && $::NMWiz::prodySkipFrame > 0 &&
$::NMWiz::prodySkipFrame < $numframes)} {return 1}
set skip $::NMWiz::prodySkipFrame
if {!($::NMWiz::prodyLastFrame == "end" || ([string is digit $::NMWiz::prodyLastFrame]
&& $::NMWiz::prodyLastFrame > 0 && $::NMWiz::prodyLastFrame < $numframes))} {return 1}
if {$::NMWiz::prodyLastFrame == "end"} {
set last [expr $numframes - 1]
} else {
set last $::NMWiz::prodyLastFrame
}
set count 0
for {set i $first} {$i <= $last} {incr i $skip} {
incr count
}
if {$::NMWiz::prodyPCAfile == "DCD"} {
set size [expr ($count * (56 + ($::NMWiz::prodySelAtoms + 2) * 12. ) + 276.)/ 1048576 ]
} else {
set size [expr ($count * ($::NMWiz::prodySelAtoms * 79. + 4) + 71.) / 1048576]
}
.nmwizprody.pcaFrame.infoentry configure -text [format "$count frames (~%.2f MB)" $size]
return 1
}
proc strcompUpdateMolList {} {
variable strcompGUI
set wf $strcompGUI.mainFrame
$wf.refFrame.list.menu delete 0 last
$wf.tarFrame.list.menu delete 0 last
set counter 0
variable strcompRefid -1
variable strcompTarid -1
foreach id [molinfo list] {
if {[molinfo $id get numatoms] > 0 && [molinfo $id get numframes] > 1} {
if {$counter == 0} {
variable strcompRefid $id
variable strcompTarid $id
}
$wf.refFrame.list.menu add radiobutton -label "[::NMWiz::cleanMolName $id] ($id)" \
-variable ::NMWiz::strcompRefMolecule \
-command "set ::NMWiz::strcompRefid $id; ::NMWiz::strcompUpdateMolinfo"
$wf.tarFrame.list.menu add radiobutton -label "[::NMWiz::cleanMolName $id] ($id)" \
-variable ::NMWiz::strcompTarMolecule \
-command "set ::NMWiz::strcompTarid $id; ::NMWiz::strcompUpdateMolinfo"
incr counter
}
}
pack $wf.refFrame.list -side left -anchor w -fill x
pack $wf.tarFrame.list -side left -anchor w -fill x
if {$strcompTarid > -1} {
variable strcompTarMol "[::NMWiz::cleanMolName $strcompTarid] ($strcompTarid)"
variable strcompRefMol "[::NMWiz::cleanMolName $strcompRefid] ($strcompRefid)"
}
::NMWiz::strcompUpdateMolinfo
}
proc strcompUpdateMolinfo {} {
variable strcompRefid
variable strcompTarid
if {$strcompRefid > -1} {
set ::NMWiz::strcompRefMol "[::NMWiz::cleanMolName $strcompRefid] ($strcompRefid)"
set ref [atomselect $strcompRefid "$::NMWiz::strcompRefSelstr" frame $::NMWiz::strcompRefFrame]
set ::NMWiz::strcompRefN [$ref num]
.nmwizstrcomp.mainFrame.selinfoRefLabel configure \
-text "$::NMWiz::strcompRefN selected"
$ref delete
} else {
set ::NMWiz::strcompRefMol ""
.nmwizstrcomp.mainFrame.selinfoRefLabel configure \
-text "0 selected"
}
if {$strcompTarid > -1} {
set ::NMWiz::strcompTarMol "[::NMWiz::cleanMolName $strcompTarid] ($strcompTarid)"
set tar [atomselect $strcompTarid "$::NMWiz::strcompTarSelstr" frame $::NMWiz::strcompTarFrame]
set ::NMWiz::strcompTarN [$tar num]
.nmwizstrcomp.mainFrame.selinfoTarLabel configure \
-text "$::NMWiz::strcompTarN selected"
$tar delete
} else {
set ::NMWiz::strcompTarMol ""
.nmwizstrcomp.mainFrame.selinfoTarLabel configure \
-text "0 selected"
}
}
proc strcompAlign {} {
set ref [atomselect $::NMWiz::strcompRefid "$::NMWiz::strcompRefSelstr" frame $::NMWiz::strcompRefFrame]
set tar [atomselect $::NMWiz::strcompTarid "$::NMWiz::strcompTarSelstr" frame $::NMWiz::strcompTarFrame]
if {[$ref num] == [$tar num]} {
set all [atomselect $::NMWiz::strcompTarid "all" frame $::NMWiz::strcompTarFrame]
$all move [measure fit $tar $ref]
.nmwizstrcomp.mainFrame.selinfoRMSDLabel configure \
-text "RMSD = [format %.2f [measure rmsd $ref $tar]] A"
$all delete
} else {
.nmwizstrcomp.mainFrame.selinfoRMSDLabel configure \
-text "Length mismatch"
}
$tar delete
$ref delete
}
proc strcompRMSD {} {
set ref [atomselect $::NMWiz::strcompRefid "$::NMWiz::strcompRefSelstr" frame $::NMWiz::strcompRefFrame]
set tar [atomselect $::NMWiz::strcompTarid "$::NMWiz::strcompTarSelstr" frame $::NMWiz::strcompTarFrame]
if {[$ref num] == [$tar num]} {
.nmwizstrcomp.mainFrame.selinfoRMSDLabel configure \
-text "RMSD = [format %.2f [measure rmsd $ref $tar]] A"
} else {
.nmwizstrcomp.mainFrame.selinfoRMSDLabel configure \
-text "Length mismatch"
}
$tar delete
$ref delete
}
proc fromolUpdateMolList {} {
variable fromolGUI
set wf $fromolGUI.mainFrame
$wf.molFrame.list.menu delete 0 last
set counter 0
variable fromolMolid -1
foreach id [molinfo list] {
if {[molinfo $id get numatoms] > 0 && [molinfo $id get numframes] > 1} {
if {$counter == 0} {
variable fromolMolid $id
}
$wf.molFrame.list.menu add radiobutton -label "[::NMWiz::cleanMolName $id] ($id)" \
-variable ::NMWiz::fromolMolecule \
-command "set ::NMWiz::fromolMolid $id; ::NMWiz::fromolUpdateMolinfo"
incr counter
}
}
pack $wf.molFrame.list -side left -anchor w -fill x
variable fromolMolid
if {$fromolMolid > -1} {
variable fromolMolecule "[::NMWiz::cleanMolName $fromolMolid] ($fromolMolid)"
}
::NMWiz::fromolUpdateMolinfo
}
proc prodyCheckMolecule {} {
if {[lsearch [molinfo list] $::NMWiz::prodyMolid] > -1 && [molinfo $::NMWiz::prodyMolid get numframes] > 0} {
return 1
}
::NMWiz::prodyUpdateMolList
return 0
}
proc fromolCheckMolecule {} {
if {[lsearch [molinfo list] $::NMWiz::fromolMolid] > -1 && [molinfo $::NMWiz::fromolMolid get numframes] > 1} {
return 1
}
::NMWiz::fromolUpdateMolList
return 0
}
proc prodyUpdateMolinfo {} {
variable prodyMolid
if {$prodyMolid > -1} {
variable prodyMolecule "[::NMWiz::cleanMolName $prodyMolid] ($prodyMolid)"
set ::NMWiz::prodyNFrames [molinfo $::NMWiz::prodyMolid get numframes]
.nmwizprody.mainFrame.molinfoLabel configure \
-text "[molinfo $::NMWiz::prodyMolid get numatoms] atoms, $::NMWiz::prodyNFrames frames"
::NMWiz::prodyUpdateSelection
::NMWiz::prodyUpdatePrefix
} else {
set ::NMWiz::prodyNFrames 0
variable fromolMolecule ""
.nmwizprody.mainFrame.molinfoLabel configure \
-text "Load a molecule and click Update."
.nmwizprody.mainFrame.selinfoLabel configure \
-text "Load a molecule and click Update."
}
}
proc fromolUpdateMolinfo {} {
variable fromolMolid
if {$fromolMolid > -1} {
variable fromolMolecule "[::NMWiz::cleanMolName $fromolMolid] ($fromolMolid)"
set ::NMWiz::fromolNFrames [molinfo $::NMWiz::fromolMolid get numframes]
.nmwizfromol.mainFrame.molinfoLabel configure \
-text "[molinfo $::NMWiz::fromolMolid get numatoms] atoms, $::NMWiz::fromolNFrames frames"
::NMWiz::fromolUpdateSelection
} else {
set ::NMWiz::fromolMolecule ""
set ::NMWiz::fromolNFrames 0
.nmwizfromol.mainFrame.molinfoLabel configure \
-text "Load a molecule and click Update."
.nmwizfromol.mainFrame.selinfoLabel configure \
-text "Load a molecule and click Update."
}
}