-
Notifications
You must be signed in to change notification settings - Fork 43
/
clickMenu.js
2493 lines (2037 loc) · 121 KB
/
clickMenu.js
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
/**
* @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
*/
class ClickMenu {
constructor(icn3dui) {
this.icn3dui = icn3dui;
}
setAlphaFoldLegend() { let me = this.icn3dui, ic = me.icn3d;
let legendHtml;
legendHtml = '<div>';
legendHtml += '<span class="icn3d-square" style="background-color: rgb(0, 83, 204);"> </span> <span>Very high (pLDDT > 90)</span><br>';
legendHtml += '<span class="icn3d-square" style="background-color: rgb(101, 203, 243);"> </span> <span>Confident (90 > pLDDT > 70)</span><br>';
legendHtml += '<span class="icn3d-square" style="background-color: rgb(255, 209, 19);"> </span> <span>Low (70 > pLDDT > 50)</span><br>';
legendHtml += '<span class="icn3d-square" style="background-color: rgb(255, 125, 69);"> </span> <span>Very low (pLDDT < 50)</span><br>';
legendHtml += '</div>';
return legendHtml;
}
setLegendHtml(bAf) { let me = this.icn3dui, ic = me.icn3d;
let legendHtml = "<br>";
if(bAf) {
legendHtml += this.setAlphaFoldLegend();
}
else {
let startColorStr = (ic.startColor == 'red') ? '#F00' : (ic.startColor == 'green') ? '#0F0' : '#00F';
let midColorStr = (ic.midColor == 'white') ? '#FFF' : '#000';
let endColorStr = (ic.endColor == 'red') ? '#F00' : (ic.endColor == 'green') ? '#0F0' : '#00F';
let rangeStr = startColorStr + ' 0%, ' + midColorStr + ' 50%, ' + endColorStr + ' 100%';
legendHtml += "<div style='height: 20px; background: linear-gradient(to right, " + rangeStr + ");'></div><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td width='33%'>" + ic.startValue + "</td><td width='33%' align='center'>" + ic.midValue + "</td><td width='33%' align='right'>" + ic.endValue + "</td></tr></table>";
}
return legendHtml;
}
SetChainsAdvancedMenu() { let me = this.icn3dui, ic = me.icn3d;
if(ic.bSetChainsAdvancedMenu === undefined || !ic.bSetChainsAdvancedMenu) {
let prevHAtoms = me.hashUtilsCls.cloneHash(ic.hAtoms);
ic.definedSetsCls.setPredefinedInMenu();
ic.bSetChainsAdvancedMenu = true;
ic.hAtoms = me.hashUtilsCls.cloneHash(prevHAtoms);
}
}
setSetsMenus(id, bOneset) { let me = this.icn3dui, ic = me.icn3d;
this.SetChainsAdvancedMenu();
let id1 = id;
let id2 = id + '2';
let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein']);
if($("#" + me.pre + id1).length) {
$("#" + me.pre + id1).html(" <option value='selected'>selected</option>" + definedAtomsHtml);
}
if(!bOneset && $("#" + me.pre + id2).length) {
$("#" + me.pre + id2).html(" <option value='selected' selected>selected</option>" + definedAtomsHtml);
}
$("#" + me.pre + id1).resizable();
if(!bOneset) $("#" + me.pre + id2).resizable();
}
applyShownMenus(bNoSave) { let me = this.icn3dui, ic = me.icn3d;
let idArray = [];
for(let id in me.htmlCls.allMenus) {
if(me.htmlCls.shownMenus.hasOwnProperty(id)) {
$("#" + me.pre + id).parent().show();
}
else {
$("#" + me.pre + id).parent().hide();
idArray.push(id);
}
}
if(Object.keys(me.htmlCls.shownMenus).length == Object.keys(me.htmlCls.allMenus).length) {
$(".icn3d-menusep").show();
}
else {
$(".icn3d-menusep").hide();
}
// save to localStorage
if(localStorage && !bNoSave) localStorage.setItem('hiddenmenus', JSON.stringify(idArray));
}
getHiddenMenusFromCache() { let me = this.icn3dui, ic = me.icn3d;
// me.htmlCls.shownMenus = {};
// let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
let idArrayStr = (localStorage) ? localStorage.getItem('hiddenmenus') : '';
if(idArrayStr && idArrayStr != '[]') {
me.htmlCls.shownMenus = {};
let idArray = JSON.parse(idArrayStr);
// for(let i = 0, il = idArray.length; i < il; ++i) {
// me.htmlCls.shownMenus[idArray[i]] = 1;
// }
for(let menu in me.htmlCls.allMenus) {
if(idArray.indexOf(menu) == -1) {
me.htmlCls.shownMenus[menu] = 1;
}
}
}
//###
else {
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
}
// else {
// if(mode == 'all') {
// me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
// }
// else if(!mode || mode == 'simple') {
// me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
// }
// else {
// me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
// }
// }
}
displayShownMenus() { let me = this.icn3dui, ic = me.icn3d;
let html = "<form name='" + me.pre + "selmenu'>";
html += "<table><tr><th>File</th><th>Select</th><th>View</th><th>Style</th><th>Color</th><th>Analysis</th><th>Help</th></tr>";
html += "<tr>";
for(let id in me.htmlCls.allMenusSel) {
// skip all unicolor: too many
if(id.substr(0, 6) == 'uniclr'
|| id.substr(0, 11) == 'mn5_opacity'
|| id.substr(0, 14) == 'mn6_labelscale'
|| id.substr(0, 4) == 'faq_'
|| id.substr(0, 4) == 'dev_') {
continue;
}
if(id == 'mn1_searchgrooup') {
html += "<td valign='top'>";
}
else if(id == 'mn2_definedsets') {
html += "</td><td valign='top'>";
}
else if(id == 'mn2_show_selected') {
html += "</td><td valign='top'>";
}
else if(id == 'mn3_proteinwrap' || (me.cfg.cid && id == 'mn3_ligwrap')) {
html += "</td><td valign='top'>";
}
else if(id == 'mn4_clrwrap') {
html += "</td><td valign='top'>";
}
else if(id == 'mn6_selectannotations') {
html += "</td><td valign='top'>";
}
else if(id == 'abouticn3d') {
html += "</td><td valign='top'>";
}
let checkStr = (me.htmlCls.shownMenus.hasOwnProperty(id)) ? "checked" : "";
let selType = me.htmlCls.allMenusSel[id];
let styleStr = (selType == 3) ? " style='margin-left:30px'" : ((selType == 2) ? " style='margin-left:15px'" : "");
html += "<span style='white-space:nowrap'><input type='checkbox' name='" + id + "' value='" + id + "'" + checkStr + styleStr + ">" + me.htmlCls.allMenus[id] + "</span><br>";
}
html += "</td></tr></table></form>";
$("#" + me.pre + "menulist").html(html);
}
async setIgTemplate(template) { let me = this.icn3dui, ic = me.icn3d;
ic.bRunRefnumAgain = true;
// reset for the selection
let residueArray = ic.resid2specCls.atoms2residues(Object.keys(ic.hAtoms));
for(let i = 0, il = residueArray.length; i < il; ++i) {
let resid = residueArray[i];
if(ic.resid2refnum) delete ic.resid2refnum[resid];
// if(ic.resid2refnum_ori) delete ic.resid2refnum_ori[resid];
if(ic.resid2domainid) delete ic.resid2domainid[resid];
}
let bSelection = true;
// await ic.refnumCls.showIgRefNum(template);
if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
await ic.annotationCls.setAnnoTabIg(bSelection, template);
ic.bRunRefnumAgain = false;
}
setClashedResidues() { let me = this.icn3dui, ic = me.icn3d;
// check contacts between all chains
let chainidArray = Object.keys(ic.chains);
let radius = 4, bSphereCalc = false, bInteraction = true;
for(let i = 0, il = chainidArray.length; i < il; ++i) {
let chainid1 = chainidArray[i];
for(let j = i + 1, jl = chainidArray.length; j < jl; ++j) {
let chainid2 = chainidArray[j];
ic.showInterCls.pickCustomSphere_base(radius, ic.chains[chainid1], ic.chains[chainid2], bSphereCalc, bInteraction);
}
}
// use domains to determine which one to hide
let bNotShowDomain = true;
ic.annoDomainCls.showDomainAll(bNotShowDomain);
}
clickMenu1() { let me = this.icn3dui, ic = me.icn3d;
if(me.bNode) return;
let thisClass = this;
//mn 1
// clkMn1_mmtfid: function() {
me.myEventCls.onIds("#" + me.pre + "mn1_vastplus", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_vastplus', 'Please input PDB ID for VAST+');
});
me.myEventCls.onIds("#" + me.pre + "mn1_vast", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_vast', 'Please input chain or PDB file for VAST');
});
me.myEventCls.onIds("#" + me.pre + "mn1_foldseek", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_foldseek', 'Submit your selection to Foldseek');
});
me.myEventCls.onIds("#" + me.pre + "mn1_mmtfid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mmtfid', 'Please input BCIF/MMTF ID');
});
// clkMn1_pdbid: function() {
me.myEventCls.onIds("#" + me.pre + "mn1_pdbid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_pdbid', 'Please input PDB ID');
});
me.myEventCls.onIds("#" + me.pre + "mn1_afid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_afid', 'Please input AlphaFold UniProt ID');
});
me.myEventCls.onIds("#" + me.pre + "mn1_refseqid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_refseqid', 'Please input NCBI Protein Accession');
});
me.myEventCls.onIds("#" + me.pre + "mn1_opmid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_opmid', 'Please input OPM PDB ID');
});
me.myEventCls.onIds("#" + me.pre + "mn1_align", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_align', 'Align two PDB structures');
});
me.myEventCls.onIds("#" + me.pre + "mn1_alignaf", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_alignaf', 'Align two AlphaFold structures');
});
me.myEventCls.onIds("#" + me.pre + "mn1_chainalign", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_chainalign', 'Align multiple chains by structure alignment');
});
me.myEventCls.onIds("#" + me.pre + "mn1_chainalign2", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_chainalign2', 'Align multiple chains by sequence alignment');
});
me.myEventCls.onIds("#" + me.pre + "mn1_chainalign3", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_chainalign3', 'Align multiple chains residue by residue');
});
me.myEventCls.onIds("#" + me.pre + "mn1_mutation", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mutation', 'Show the mutations in 3D');
});
me.myEventCls.onIds("#" + me.pre + "mn1_pdbfile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
//me = me.setIcn3dui($(this).attr('id'));
me.htmlCls.dialogCls.openDlg('dl_pdbfile', 'Please input PDB File');
});
me.myEventCls.onIds(["#" + me.pre + "mn1_pdbfile_app", "#" + me.pre + "tool_pdbfile"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
//me = me.setIcn3dui($(this).attr('id'));
me.htmlCls.dialogCls.openDlg('dl_pdbfile_app', 'Please append PDB Files');
});
me.myEventCls.onIds("#" + me.pre + "mn1_mol2file", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mol2file', 'Please input Mol2 File');
});
me.myEventCls.onIds("#" + me.pre + "mn1_sdffile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_sdffile', 'Please input SDF File');
});
me.myEventCls.onIds("#" + me.pre + "mn1_xyzfile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_xyzfile', 'Please input XYZ File');
});
me.myEventCls.onIds("#" + me.pre + "mn1_afmapfile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_afmapfile', 'Please input AlphaFold PAE File');
});
me.myEventCls.onIds("#" + me.pre + "mn1_urlfile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_urlfile', 'Load data by URL');
});
me.myEventCls.onIds("#" + me.pre + "mn1_fixedversion", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_fixedversion', 'Open Share Link URL in the archived version of iCn3D');
});
me.myEventCls.onIds("#" + me.pre + "reload_fixedversion", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url = $("#" + me.pre + "sharelinkurl").val();
thisClass.setLogCmd("open " + url, false);
localStorage.setItem('fixedversion', '1');
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
});
me.myEventCls.onIds("#" + me.pre + "mn1_mmciffile", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mmciffile', 'Please append mmCIF File');
});
me.myEventCls.onIds("#" + me.pre + "mn1_mmcifid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mmcifid', 'Please input mmCIF ID');
});
me.myEventCls.onIds("#" + me.pre + "mn1_mmdbid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mmdbid', 'Please input MMDB or PDB ID');
});
me.myEventCls.onIds(["#" + me.pre + "mn1_mmdbafid", , "#" + me.pre + "tool_mmdbafid"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_mmdbafid', 'Please input PDB/MMDB/AlphaFold UniProt IDs');
});
me.myEventCls.onIds("#" + me.pre + "mn1_blast_rep_id", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_blast_rep_id', 'Align sequence to structure');
});
me.myEventCls.onIds("#" + me.pre + "mn1_esmfold", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_esmfold', 'Sequence to structure prediction with ESMFold');
});
me.myEventCls.onIds("#" + me.pre + "mn1_proteinname", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_proteinname', 'Please input protein or gene name');
});
me.myEventCls.onIds("#" + me.pre + "mn1_cid", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_cid', 'Please input PubChem Compound');
});
me.myEventCls.onIds("#" + me.pre + "mn1_smiles", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_smiles', 'Please input a chemical SMILES');
});
me.myEventCls.onIds("#" + me.pre + "mn1_pngimage", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_pngimage', 'Please append PNG images');
});
me.myEventCls.onIds("#" + me.pre + "mn1_state", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_state', 'Please input the state file');
});
me.myEventCls.onIds("#" + me.pre + "mn1_selection", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_selection', 'Please input the selection file');
});
me.myEventCls.onIds("#" + me.pre + "mn1_collection", "click", function (e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg("dl_selectCollections", "Select Collections");
});
me.myEventCls.onIds("#" + me.pre + "mn1_dsn6", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_dsn6', 'Please input the map file to display electron density map');
});
me.myEventCls.onIds(["#" + me.pre + "mn1_delphi", "#" + me.pre + "mn1_delphi2", "#" + me.pre + "tool_delphi"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.loadPhiFrom = 'delphi';
$("#" + me.pre + "dl_delphi_tabs").tabs();
me.htmlCls.dialogCls.openDlg('dl_delphi', 'Please set parameters to display DelPhi potential map');
});
me.myEventCls.onIds("#" + me.pre + "mn1_phi", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.loadPhiFrom = 'phi';
$("#" + me.pre + "dl_phi_tabs").tabs();
$("#" + me.pre + "phitab1_tabs").tabs();
$("#" + me.pre + "phitab2_tabs").tabs();
me.htmlCls.dialogCls.openDlg('dl_phi', 'Please input local phi or cube file to display DelPhi potential map');
});
me.myEventCls.onIds("#" + me.pre + "mn1_phiurl", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.loadPhiFrom = 'phiurl';
$("#" + me.pre + "dl_phiurl_tabs").tabs();
$("#" + me.pre + "phiurltab1_tabs").tabs();
$("#" + me.pre + "phiurltab2_tabs").tabs();
me.htmlCls.dialogCls.openDlg('dl_phiurl', 'Please input URL phi or cube file to display DelPhi potential map');
});
me.myEventCls.onIds("#" + me.pre + "mn1_dsn6url", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_dsn6url', 'Please input the map file to display electron density map');
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportState", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export state file", false);
let file_pref = Object.keys(ic.structures).join(',');
ic.saveFileCls.saveFile(file_pref + '_statefile.txt', 'command');
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportPdbRes", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.setHtmlCls.exportPdb();
thisClass.setLogCmd("export pdb", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportSecondary", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.setHtmlCls.exportSecondary();
thisClass.setLogCmd("export secondary structure", true);
});
me.myEventCls.onIds(["#" + me.pre + "delphipdb", "#" + me.pre + "phipdb"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let pdbStr = ic.saveFileCls.getSelectedResiduePDB();
thisClass.setLogCmd("export PDB of selected residues", false);
//let file_pref = Object.keys(ic.structures).join(',');
let file_pref = Object.keys(ic.structures).join(',');
ic.saveFileCls.saveFile(file_pref + '_icn3d_residues.pdb', 'text', [pdbStr]);
});
me.myEventCls.onIds(["#" + me.pre + "delphipqr", "#" + me.pre + "phipqr", "#" + me.pre + "phiurlpqr"], "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
await me.htmlCls.setHtmlCls.exportPqr();
thisClass.setLogCmd("export pqr", true);
});
// me.myEventCls.onIds("#" + me.pre + "delphipqbh", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
// let bPdb = true;
// await me.htmlCls.setHtmlCls.exportPqr(bPdb);
// thisClass.setLogCmd("export pdbh", false);
// });
me.myEventCls.onIds("#" + me.pre + "profixpdb", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
let bHydrogen = false;
await ic.scapCls.exportPdbProfix(bHydrogen);
thisClass.setLogCmd("export pdb missing atoms", true);
});
me.myEventCls.onIds("#" + me.pre + "profixpdbh", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
let bHydrogen = true;
await ic.scapCls.exportPdbProfix(bHydrogen);
thisClass.setLogCmd("export pdb hydrogen", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportIgstrand", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
ic.refnumCls.exportRefnum('igstrand');
thisClass.setLogCmd("export refnum igstrand", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportKabat", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
ic.refnumCls.exportRefnum('kabat');
thisClass.setLogCmd("export refnum kabat", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportImgt", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
ic.refnumCls.exportRefnum('imgt');
thisClass.setLogCmd("export refnum imgt", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportStl", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export stl file", false);
//ic.threeDPrintCls.hideStabilizer();
ic.export3DCls.exportStlFile('');
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportVrml", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export vrml file", false);
//ic.threeDPrintCls.hideStabilizer();
ic.export3DCls.exportVrmlFile('');
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportStlStab", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export stl stabilizer file", false);
//ic.bRender = false;
ic.threeDPrintCls.hideStabilizer();
ic.threeDPrintCls.resetAfter3Dprint();
ic.threeDPrintCls.addStabilizer();
ic.export3DCls.exportStlFile('_stab');
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportVrmlStab", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export vrml stabilizer file", false);
//ic.bRender = false;
ic.threeDPrintCls.hideStabilizer();
ic.threeDPrintCls.resetAfter3Dprint();
ic.threeDPrintCls.addStabilizer();
ic.export3DCls.exportVrmlFile('_stab');
});
me.myEventCls.onIds("#" + me.pre + "mn6_exportInteraction", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export interactions", false);
if(me.cfg.mmdbid !== undefined) await ic.viewInterPairsCls.retrieveInteractionData();
ic.viewInterPairsCls.exportInteractions();
});
me.myEventCls.onIds(["#" + me.pre + "mn1_exportCanvas", "#" + me.pre + "saveimage"], "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
// do not record the export command
//thisClass.setLogCmd("export canvas", true);
thisClass.setLogCmd("export canvas", false);
//var file_pref =(ic.inputid) ? ic.inputid : "custom";
//ic.saveFileCls.saveFile(file_pref + '_image_icn3d_loadable.png', 'png');
let bPngHtml = true;
await ic.shareLinkCls.shareLink(bPngHtml);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportCanvas1", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export canvas 1", true);
ic.scaleFactor = 1;
await ic.shareLinkCls.shareLink(true, true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportCanvas2", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export canvas 2", true);
ic.scaleFactor = 2;
await ic.shareLinkCls.shareLink(true, true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportCanvas4", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export canvas 4", true);
ic.scaleFactor = 4;
await ic.shareLinkCls.shareLink(true, true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportCanvas8", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export canvas 8", true);
ic.scaleFactor = 8;
await ic.shareLinkCls.shareLink(true, true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportCounts", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export counts", false);
let text = '<html><body><div style="text-align:center"><br><b>Total Count for atoms with coordinates</b>:<br/><table align=center border=1 cellpadding=10 cellspacing=0><tr><th>Structure Count</th><th>Chain Count</th><th>Residue Count</th><th>Atom Count</th></tr>';
text += '<tr><td>' + Object.keys(ic.structures).length + '</td><td>' + Object.keys(ic.chains).length + '</td><td>' + Object.keys(ic.residues).length + '</td><td>' + Object.keys(ic.atoms).length + '</td></tr>';
text += '</table><br/>';
text += '<b>Counts by Chain for atoms with coordinates</b>:<br/><table align=center border=1 cellpadding=10 cellspacing=0><tr><th>Structure</th><th>Chain</th><th>Residue Count</th><th>Atom Count</th></tr>';
let chainArray = Object.keys(ic.chains);
for(let i = 0, il = chainArray.length; i < il; ++i) {
let chainid = chainArray[i];
//if(!chainid) continue;
let pos = chainid.indexOf('_');
let structure = chainid.substr(0, pos);
let chain = chainid.substr(pos + 1);
let residueHash = {}
let atoms = ic.chains[chainid];
for(let j in atoms) {
residueHash[ic.atoms[j].resi] = 1;
}
text += '<tr><td>' + structure + '</td><td>' + chain + '</td><td>' + Object.keys(residueHash).length + '</td><td>' + Object.keys(ic.chains[chainid]).length + '</td></tr>';
}
text += '</table><br/></div></body></html>';
let file_pref = Object.keys(ic.structures).join(',');
ic.saveFileCls.saveFile(file_pref + '_counts.html', 'html', text);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportSelections", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export all selections", false);
thisClass.SetChainsAdvancedMenu();
let text = ic.saveFileCls.exportCustomAtoms();
let file_pref = Object.keys(ic.structures).join(',');
ic.saveFileCls.saveFile(file_pref + '_selections.txt', 'text', [text]);
});
me.myEventCls.onIds("#" + me.pre + "mn1_exportSelDetails", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("export all selections with details", false);
thisClass.SetChainsAdvancedMenu();
let bDetails = true;
let text = ic.saveFileCls.exportCustomAtoms(bDetails);
let file_pref = Object.keys(ic.structures).join(',');
ic.saveFileCls.saveFile(file_pref + '_sel_details.txt', 'text', [text]);
});
me.myEventCls.onIds(["#" + me.pre + "mn1_sharelink", "#" + me.pre + "tool_sharelink"], "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
await ic.shareLinkCls.shareLink();
});
me.myEventCls.onIds("#" + me.pre + "mn1_replayon", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
await ic.resizeCanvasCls.replayon();
thisClass.setLogCmd("replay on", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_replayoff", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
await ic.resizeCanvasCls.replayoff();
thisClass.setLogCmd("replay off", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_menuall", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
thisClass.applyShownMenus();
});
me.myEventCls.onIds("#" + me.pre + "mn1_menusimple", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
thisClass.applyShownMenus();
});
me.myEventCls.onIds("#" + me.pre + "mn1_menupref", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_menupref', 'Select Menus');
thisClass.getHiddenMenusFromCache();
thisClass.displayShownMenus();
});
me.myEventCls.onIds(["#" + me.pre + "apply_menupref", "#" + me.pre + "apply_menupref2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
var checkboxes = document.querySelectorAll('form[name="' + me.pre + 'selmenu"] input:checked');
me.htmlCls.shownMenus = {};
for (var checkbox of checkboxes) {
me.htmlCls.shownMenus[checkbox.value] = 1;
}
me.htmlCls.setHtmlCls.setCookie('menumode', 'custom');
thisClass.applyShownMenus();
});
me.myEventCls.onIds(["#" + me.pre + "reset_menupref", "#" + me.pre + "reset_menupref2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
me.htmlCls.setHtmlCls.setCookie('menumode', 'simple');
thisClass.applyShownMenus();
thisClass.displayShownMenus();
});
me.myEventCls.onIds(["#" + me.pre + "reset_menupref_all", "#" + me.pre + "reset_menupref_all2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
me.htmlCls.setHtmlCls.setCookie('menumode', 'all');
thisClass.applyShownMenus();
thisClass.displayShownMenus();
});
me.myEventCls.onIds(["#" + me.pre + "savepref", "#" + me.pre + "savepref2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let menuStr = '[';
//var checkboxes = document.querySelectorAll('form[name="' + me.pre + 'selmenu"] input:checked');
var checkboxes = document.querySelectorAll('form[name="' + me.pre + 'selmenu"] input:not(:checked)');
let cnt = 0;
for (var checkbox of checkboxes) {
if(cnt > 0) menuStr += ', ';
menuStr += '"' + checkbox.value + '"';
++cnt;
}
menuStr += ']';
ic.saveFileCls.saveFile('icn3d_menus_pref.txt', 'text', [menuStr]);
});
me.myEventCls.onIds("#" + me.pre + "reload_menupreffile", "click", function(e) { let ic = me.icn3d;
e.preventDefault();
if(!me.cfg.notebook) dialog.dialog( "close" );
let file = $("#" + me.pre + "menupreffile")[0].files[0];
if(!file) {
alert("Please select a file before clicking 'Load'");
}
else {
me.htmlCls.setHtmlCls.fileSupport();
let reader = new FileReader();
reader.onload = function(e) {
let dataStr = e.target.result; // or = reader.result;
let idArray = JSON.parse(dataStr);
me.htmlCls.shownMenus = {};
// for(let i = 0, il = idArray.length; i < il; ++i) {
// me.htmlCls.shownMenus[idArray[i]] = 1;
// }
for(let menu in me.htmlCls.allMenus) {
if(idArray.indexOf(menu) == -1) {
me.htmlCls.shownMenus[menu] = 1;
}
}
thisClass.applyShownMenus();
thisClass.displayShownMenus();
me.htmlCls.setHtmlCls.setCookie('menumode', 'custom');
}
reader.readAsText(file);
}
});
me.myEventCls.onIds(["#" + me.pre + "mn1_menuloadpref", "#" + me.pre + "loadpref", "#" + me.pre + "loadpref2"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_menuloadpref', 'Please input the menu preference file');
});
me.myEventCls.onIds("#" + me.pre + "mn1_link_structure", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url = ic.saveFileCls.getLinkToStructureSummary(true);
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
});
me.myEventCls.onIds("#" + me.pre + "mn1_alphafold", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url = 'https://github.com/sokrypton/ColabFold';
window.open(url, '_blank');
});
me.myEventCls.onIds("#" + me.pre + "mn1_link_bind", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_structure&from_uid=" + ic.inputid;
thisClass.setLogCmd("link to 3D protein structures bound to CID " + ic.inputid + ": " + url, false);
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
});
me.myEventCls.onIds("#" + me.pre + "mn1_link_vast", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url;
if(ic.inputid === undefined) {
url = "https://www.ncbi.nlm.nih.gov/pccompound?term=" + ic.molTitle;
thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
}
else {
if(me.cfg.cid !== undefined) {
url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_pccompound_3d&from_uid=" + ic.inputid;
thisClass.setLogCmd("link to compounds with structure similar to CID " + ic.inputid + ": " + url, false);
}
else {
let idArray = ic.inputid.split('_');
if(idArray.length === 1) {
url = me.htmlCls.baseUrl + "vastplus/vastplus.cgi?uid=" + ic.inputid;
thisClass.setLogCmd("link to structures similar to " + ic.inputid + ": " + url, false);
}
else if(idArray.length === 2) {
url = me.htmlCls.baseUrl + "vastplus/vastplus.cgi?uid=" + idArray[0];
thisClass.setLogCmd("link to structures similar to " + idArray[0] + ": " + url, false);
}
}
}
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
});
me.myEventCls.onIds("#" + me.pre + "mn1_link_pubmed", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let url;
if(ic.inputid === undefined) {
url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.molTitle;
thisClass.setLogCmd("link to literature about " + ic.molTitle + ": " + url, false);
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
}
else if(ic.pmid) {
let idArray = ic.pmid.toString().split('_');
if(idArray.length === 1) {
url = "https://www.ncbi.nlm.nih.gov/pubmed/" + ic.pmid;
thisClass.setLogCmd("link to PubMed ID " + ic.pmid + ": " + url, false);
}
else if(idArray.length === 2) {
url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + idArray[0] + " OR " + idArray[1];
thisClass.setLogCmd("link to PubMed IDs " + idArray[0] + ", " + idArray[1] + ": " + url, false);
}
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
}
else if(isNaN(ic.inputid)) {
let idArray = ic.inputid.toString().split('_');
if(idArray.length === 1) {
url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.inputid;
thisClass.setLogCmd("link to literature about PDB " + ic.inputid + ": " + url, false);
}
else if(idArray.length === 2) {
url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + idArray[0] + " OR " + idArray[1];
thisClass.setLogCmd("link to literature about PDB " + idArray[0] + " OR " + idArray[1] + ": " + url, false);
}
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
}
else {
if(me.cfg.cid !== undefined) {
alert("No literature information is available for this compound in the SDF file.");
}
else {
alert("No literature information is available for this structure.");
}
}
});
me.myEventCls.onIds("#" + me.pre + "mn1_link_protein", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
//ic.saveFileCls.setEntrezLinks('protein');
let structArray = Object.keys(ic.structures);
let chainArray = Object.keys(ic.chains);
let text = '';
for(let i = 0, il = chainArray.length; i < il; ++i) {
let firstAtom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.chains[chainArray[i]]);
if(ic.proteins.hasOwnProperty(firstAtom.serial) && chainArray[i].length == 6) {
text += chainArray[i] + '[accession] OR ';
}
}
if(text.length > 0) text = text.substr(0, text.length - 4);
let url = "https://www.ncbi.nlm.nih.gov/protein/?term=" + text;
thisClass.setLogCmd("link to Entrez protein about PDB " + structArray + ": " + url, false);
let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
window.open(url, urlTarget);
});
}
clickMenu2() { let me = this.icn3dui, ic = me.icn3d;
if(me.bNode) return;
let thisClass = this;
me.myEventCls.onIds(["#" + me.pre + "mn6_selectannotations", "#" + me.pre + "tool_selectannotations"], "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
await ic.showAnnoCls.showAnnotations();
thisClass.setLogCmd("view annotations", true);
//thisClass.setLogCmd("window annotations", true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectall", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select all", true);
ic.selectionCls.selectAll();
ic.hlUpdateCls.removeHlAll();
ic.drawCls.draw();
});
me.myEventCls.onIds("#" + me.pre + "clearall", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("clear all", true);
ic.bSelectResidue = false;
ic.selectionCls.selectAll();
ic.hlUpdateCls.removeHlAll();
ic.drawCls.draw();
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectdisplayed", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select displayed set", true);
//ic.hAtoms = me.hashUtilsCls.cloneHash(ic.dAtoms);
ic.hAtoms = me.hashUtilsCls.cloneHash(ic.viewSelectionAtoms);
ic.hlUpdateCls.updateHlAll();
//ic.drawCls.draw();
});
me.myEventCls.onIds("#" + me.pre + "mn2_clashedYes", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.bHideClashed = false;
ic.annoDomainCls.showHideClashedResidues();
ic.drawCls.draw();
thisClass.setLogCmd('clashed residues show', true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_clashedNo", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.bHideClashed = true;
thisClass.setClashedResidues();
ic.annoDomainCls.showHideClashedResidues();
ic.drawCls.draw();
thisClass.setLogCmd('clashed residues hide', true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_fullstru", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("show all", true);
ic.selectionCls.showAll();
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectcomplement", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
if(Object.keys(ic.hAtoms).length < Object.keys(ic.atoms).length) {
thisClass.setLogCmd("select complement", true);
ic.resid2specCls.selectComplement();
}
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectmainchains", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select main chains", true);
ic.selectionCls.selectMainChains();
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectsidechains", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select side chains", true);
ic.selectionCls.selectSideChains();
});
me.myEventCls.onIds("#" + me.pre + "mn2_selectmainsidechains", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select main side chains", true);
ic.selectionCls.selectMainSideChains();
});
me.myEventCls.onIds("#" + me.pre + "mn2_propPos", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select prop positive", true);
ic.resid2specCls.selectProperty('positive');
});
me.myEventCls.onIds("#" + me.pre + "mn2_propNeg", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select prop negative", true);
ic.resid2specCls.selectProperty('negative');
});
me.myEventCls.onIds("#" + me.pre + "mn2_propHydro", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select prop hydrophobic", true);
ic.resid2specCls.selectProperty('hydrophobic');
});
me.myEventCls.onIds("#" + me.pre + "mn2_propPolar", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
thisClass.setLogCmd("select prop polar", true);
ic.resid2specCls.selectProperty('polar');
});
me.myEventCls.onIds("#" + me.pre + "mn2_propBfactor", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_propbybfactor', 'Select residue based on B-factor/pLDDT');
});
me.myEventCls.onIds("#" + me.pre + "mn2_propSolAcc", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_propbypercentout', 'Select residue based on the percentage of solvent accessilbe surface area');
});
me.myEventCls.onIds("#" + me.pre + "applypropbybfactor", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let from = $("#" + me.pre + "minbfactor").val();
let to = $("#" + me.pre + "maxbfactor").val();
thisClass.setLogCmd("select prop b factor | " + from + '_' + to, true);
ic.resid2specCls.selectProperty('b factor', from, to);
});
me.myEventCls.onIds("#" + me.pre + "applypropbypercentout", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
let from = $("#" + me.pre + "minpercentout").val();
let to = $("#" + me.pre + "maxpercentout").val();
thisClass.setLogCmd("select prop percent out | " + from + '_' + to, true);
ic.resid2specCls.selectProperty('percent out', from, to);
});
me.myEventCls.onIds("#" + me.pre + "mn2_alignment", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_alignment', 'Select residues in aligned sequences');
thisClass.setLogCmd("window aligned sequences", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_window_table", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_allinteraction', 'Show interactions');
thisClass.setLogCmd("window interaction table", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_window_linegraph", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_linegraph', 'Show interactions between two lines of residue nodes');
thisClass.setLogCmd("window interaction graph", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_window_scatterplot", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_scatterplot', 'Show interactions as map');
thisClass.setLogCmd("window interaction scatterplot", true);
});
me.myEventCls.onIds("#" + me.pre + "mn1_window_graph", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_graph', 'Force-directed graph');
thisClass.setLogCmd("window force-directed graph", true);
});
me.myEventCls.onIds("#" + me.pre + "mn6_yournote", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_yournote', 'Your note about the current display');
});
me.myEventCls.onIds("#" + me.pre + "applyyournote", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.yournote = $("#" + me.pre + "yournote").val();
if(me.cfg.shownote) document.title = ic.yournote;
if(!me.cfg.notebook) dialog.dialog( "close" );
thisClass.setLogCmd('your note | ' + ic.yournote, true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_command", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
me.htmlCls.dialogCls.openDlg('dl_advanced2', 'Select by specification');
});
me.myEventCls.onIds(["#" + me.pre + "mn2_definedsets", "#" + me.pre + "definedsets", "#" + me.pre + "definedsets2", "#" + me.pre + "tool_definedsets"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.definedSetsCls.showSets();
thisClass.setLogCmd('defined sets', true);
//thisClass.setLogCmd('window defined sets', true);
});
$(document).on("click", "#" + me.pre + "setOr", function(e) { let ic = me.icn3d;
e.stopImmediatePropagation();
ic.setOperation = 'or';
});
$(document).on("click", "#" + me.pre + "setAnd", function(e) { let ic = me.icn3d;
e.stopImmediatePropagation();
ic.setOperation = 'and';
});
$(document).on("click", "#" + me.pre + "setNot", function(e) { let ic = me.icn3d;
e.stopImmediatePropagation();
ic.setOperation = 'not';
});
me.myEventCls.onIds("#" + me.pre + "mn2_pkNo", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.pk = 0;
ic.opts['pk'] = 'no';
thisClass.setLogCmd('set pk off', true);
ic.drawCls.draw();
ic.hlObjectsCls.removeHlObjects();
});
me.myEventCls.onIds("#" + me.pre + "mn2_pkYes", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.pk = 1;
ic.opts['pk'] = 'atom';
thisClass.setLogCmd('set pk atom', true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_pkResidue", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.pk = 2;
ic.opts['pk'] = 'residue';
thisClass.setLogCmd('set pk residue', true);
});
me.myEventCls.onIds("#" + me.pre + "mn2_pkStrand", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
ic.pk = 3;
ic.opts['pk'] = 'strand';
thisClass.setLogCmd('set pk strand', true);
});