icn3d 3.40.5 → 3.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/icn3d.js CHANGED
@@ -8827,9 +8827,9 @@ class ClickMenu {
8827
8827
  }
8828
8828
 
8829
8829
  getHiddenMenusFromCache() { let me = this.icn3dui; me.icn3d;
8830
- // me.htmlCls.shownMenus = {};
8830
+ me.htmlCls.shownMenus = {};
8831
8831
 
8832
- // let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
8832
+ let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
8833
8833
 
8834
8834
  let idArrayStr = (localStorage) ? localStorage.getItem('hiddenmenus') : '';
8835
8835
 
@@ -8838,31 +8838,23 @@ class ClickMenu {
8838
8838
 
8839
8839
  let idArray = JSON.parse(idArrayStr);
8840
8840
 
8841
- // for(let i = 0, il = idArray.length; i < il; ++i) {
8842
- // me.htmlCls.shownMenus[idArray[i]] = 1;
8843
- // }
8844
8841
  for(let menu in me.htmlCls.allMenus) {
8845
8842
  if(idArray.indexOf(menu) == -1) {
8846
8843
  me.htmlCls.shownMenus[menu] = 1;
8847
8844
  }
8848
8845
  }
8849
8846
  }
8850
- //###
8851
8847
  else {
8852
- me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
8848
+ if(mode == 'all') {
8849
+ me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
8850
+ }
8851
+ else if(!mode || mode == 'simple') {
8852
+ me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
8853
+ }
8854
+ else {
8855
+ me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
8856
+ }
8853
8857
  }
8854
-
8855
- // else {
8856
- // if(mode == 'all') {
8857
- // me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
8858
- // }
8859
- // else if(!mode || mode == 'simple') {
8860
- // me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
8861
- // }
8862
- // else {
8863
- // me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
8864
- // }
8865
- // }
8866
8858
  }
8867
8859
 
8868
8860
  displayShownMenus() { let me = this.icn3dui; me.icn3d;
@@ -11341,7 +11333,7 @@ class SetMenu {
11341
11333
 
11342
11334
  let tdStr = '<td valign="top">';
11343
11335
 
11344
- // html += tdStr + this.setMenuMode() + '</td>';
11336
+ html += tdStr + this.setMenuMode() + '</td>';
11345
11337
 
11346
11338
  html += tdStr + this.setMenu1() + '</td>';
11347
11339
 
@@ -11352,12 +11344,11 @@ class SetMenu {
11352
11344
  html += tdStr + this.setMenu4() + '</td>';
11353
11345
 
11354
11346
  html += tdStr + this.setMenu5() + '</td>';
11355
- //html += tdStr + this.setMenu5b() + '</td>';
11356
11347
  html += tdStr + this.setMenu6() + '</td>';
11357
11348
 
11358
11349
  // reset the menus at the end of the menus
11359
- // let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
11360
- // this.resetMenu(mode);
11350
+ let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
11351
+ this.resetMenu(mode);
11361
11352
 
11362
11353
  // me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
11363
11354
 
@@ -11465,7 +11456,7 @@ class SetMenu {
11465
11456
  }
11466
11457
  html += "<div>";
11467
11458
 
11468
- // html += '<li>' + this.setMenuMode(true);
11459
+ html += '<li>' + this.setMenuMode(true);
11469
11460
 
11470
11461
  let liStr = "<li><span class='icn3d-menu-color'";
11471
11462
 
@@ -11486,8 +11477,8 @@ class SetMenu {
11486
11477
  html += this.setMenu6_base();
11487
11478
 
11488
11479
  // reset the menus at the end of the menus
11489
- // let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
11490
- // this.resetMenu(mode);
11480
+ let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
11481
+ this.resetMenu(mode);
11491
11482
 
11492
11483
  // me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
11493
11484
 
@@ -11577,7 +11568,7 @@ class SetMenu {
11577
11568
 
11578
11569
  html += me.htmlCls.divStr + "selection' style='display:none;'><div style='position:absolute; z-index:555; float:left; display:table-row; margin: 32px 0px 0px 0px;'>";
11579
11570
  //html += "<table style='margin-top: 3px; width:100px;'>";
11580
- html += "<table style='margin-top: 3px; width:770px; background-color:#EEE;'>";
11571
+ html += "<table style='margin: 3px 0px 0px 76px; width:770px; background-color:#EEE;'>";
11581
11572
 
11582
11573
  html += this.setTools_base();
11583
11574
 
@@ -11893,9 +11884,9 @@ class SetMenu {
11893
11884
  html += "</ul>";
11894
11885
  html += "</li>";
11895
11886
 
11896
- html += this.getMenuText('mn1_aligntwostru', 'Protein Complexes', undefined, undefined, 2);
11887
+ html += this.getMenuText('mn1_aligntwostru', 'Protein Complexes', undefined, 1, 2);
11897
11888
  html += "<ul>";
11898
- html += this.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr, undefined, 3);
11889
+ html += this.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr, 1, 3);
11899
11890
  html += this.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr, undefined, 3);
11900
11891
  html += "</ul>";
11901
11892
 
@@ -11949,8 +11940,8 @@ class SetMenu {
11949
11940
  html += "<ul>";
11950
11941
  html += this.getMenuText('mn1_savepngimage', 'iCn3D PNG Image', undefined, 1, 2);
11951
11942
  html += "<ul>";
11952
- html += this.getLink('mn1_exportCanvas', 'Original Size & HTML', 1, 3);
11953
- html += this.getLink('mn1_exportCanvas1', 'Original Size', undefined, 3);
11943
+ html += this.getLink('mn1_exportCanvas', 'Original Size & HTML', undefined, 3);
11944
+ html += this.getLink('mn1_exportCanvas1', 'Original Size', 1, 3);
11954
11945
 
11955
11946
  html += this.getLink('mn1_exportCanvas2', '2X Large', undefined, 3);
11956
11947
  html += this.getLink('mn1_exportCanvas4', '4X Large', undefined, 3);
@@ -12037,7 +12028,7 @@ class SetMenu {
12037
12028
  html += "<ul class='icn3d-mn-item'>";
12038
12029
 
12039
12030
  html += this.getLink('mn2_definedsets', 'Defined Sets', 1, 1);
12040
- html += this.getLink('mn2_selectall', 'All', undefined, 1);
12031
+ html += this.getLink('mn2_selectall', 'All', 1, 1);
12041
12032
  html += this.getLink('mn2_selectdisplayed', 'Displayed Set', undefined, 1);
12042
12033
  html += this.getLink('mn2_aroundsphere', 'by Distance', 1, 1);
12043
12034
 
@@ -12053,10 +12044,10 @@ class SetMenu {
12053
12044
  html += "</li>";
12054
12045
 
12055
12046
  html += this.getLink('mn2_selectcomplement', 'Inverse', undefined, 1);
12056
- html += this.getLink('mn2_selectmainchains', 'Main Chains', undefined, 1);
12057
- html += this.getLink('mn2_selectsidechains', 'Side Chains', undefined, 1);
12047
+ html += this.getLink('mn2_selectmainchains', 'Main Chains', 1, 1);
12048
+ html += this.getLink('mn2_selectsidechains', 'Side Chains', 1, 1);
12058
12049
  html += this.getLink('mn2_selectmainsidechains', 'Main & Side Chains', undefined, 1);
12059
- html += this.getLink('mn2_command', 'Advanced', undefined, 1);
12050
+ html += this.getLink('mn2_command', 'Advanced', 1, 1);
12060
12051
 
12061
12052
  if(me.cfg.cid === undefined) {
12062
12053
  html += this.getMenuText('mn2_selon3d', 'Select on 3D', undefined, 1, 1);
@@ -12089,7 +12080,7 @@ class SetMenu {
12089
12080
  html += this.getMenuSep();
12090
12081
 
12091
12082
  html += this.getLink('mn2_saveselection', 'Save Selection', 1, 1);
12092
- html += this.getLink('clearall', 'Clear Selection', undefined, 1);
12083
+ html += this.getLink('clearall', 'Clear Selection', 1, 1);
12093
12084
  html += this.getLink('mn2_saveresidue', 'Save Res. in Sel.', 1, 1);
12094
12085
 
12095
12086
  html += this.getMenuSep();
@@ -12154,7 +12145,7 @@ class SetMenu {
12154
12145
  html += this.getLinkWrapper('mn2_alternate', 'Alternate(Key "a")', 'mn2_alternateWrap', undefined, 1);
12155
12146
 
12156
12147
  if(me.cfg.opmid !== undefined) {
12157
- html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', undefined, 1);
12148
+ html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', 1, 1);
12158
12149
  }
12159
12150
  //else if(me.cfg.mmdbafid !== undefined || me.cfg.afid !== undefined) {
12160
12151
  else if(me.cfg.cid === undefined) {
@@ -12169,14 +12160,14 @@ class SetMenu {
12169
12160
 
12170
12161
  html += this.getMenuSep();
12171
12162
 
12172
- html += this.getMenuText('mn2_vrarhints', 'VR & AR Hints', undefined, 1, 1);
12163
+ html += this.getMenuText('mn2_vrarhints', 'VR & AR Hints', undefined, undefined, 1);
12173
12164
  html += "<ul>";
12174
- html += this.getMenuUrl("vrhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#vr", "VR: VR Headsets", 1, 2);
12175
- html += this.getMenuUrl("arhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#ar", "AR: Chrome in Android", 1, 2);
12165
+ html += this.getMenuUrl("vrhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#vr", "VR: VR Headsets", undefined, 2);
12166
+ html += this.getMenuUrl("arhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#ar", "AR: Chrome in Android", undefined, 2);
12176
12167
  html += "</ul>";
12177
12168
  html += "</li>";
12178
12169
 
12179
- html += this.getLink('mn6_sidebyside', 'Side by Side', 1, 1);
12170
+ html += this.getLink('mn6_sidebyside', 'Side by Side', undefined, 1);
12180
12171
 
12181
12172
  html += this.getMenuText('mn2_rotate', 'Rotate', undefined, 1, 1);
12182
12173
  html += "<ul>";
@@ -12288,7 +12279,7 @@ class SetMenu {
12288
12279
  html += this.getRadio('mn3_proteins', 'mn3_proteinsRibbon', 'Ribbon', true, 1, 2);
12289
12280
  }
12290
12281
 
12291
- html += this.getRadio('mn3_proteins', 'mn3_proteinsStrand', 'Strand', undefined, undefined, 2);
12282
+ html += this.getRadio('mn3_proteins', 'mn3_proteinsStrand', 'Strand', undefined, 1, 2);
12292
12283
  html += this.getRadio('mn3_proteins', 'mn3_proteinsCylinder', 'Cylinder and Plate', undefined, undefined, 2);
12293
12284
  html += this.getRadio('mn3_proteins', 'mn3_proteinsSchematic', 'Schematic', undefined, 1, 2);
12294
12285
 
@@ -12300,7 +12291,7 @@ class SetMenu {
12300
12291
  }
12301
12292
 
12302
12293
  html += this.getRadio('mn3_proteins', 'mn3_proteinsBackbone', 'Backbone', undefined, undefined, 2);
12303
- html += this.getRadio('mn3_proteins', 'mn3_proteinsBfactor', 'B-factor Tube', undefined, 1, 2);
12294
+ html += this.getRadio('mn3_proteins', 'mn3_proteinsBfactor', 'B-factor Tube', undefined, undefined, 2);
12304
12295
  html += this.getRadio('mn3_proteins', 'mn3_proteinsLines', 'Lines', undefined, 1, 2);
12305
12296
  html += this.getRadio('mn3_proteins', 'mn3_proteinsStick', 'Stick', undefined, 1, 2);
12306
12297
  html += this.getRadio('mn3_proteins', 'mn3_proteinsBallstick', 'Ball and Stick', undefined, 1, 2);
@@ -12364,10 +12355,10 @@ class SetMenu {
12364
12355
  html += "</li>";
12365
12356
 
12366
12357
  //if(me.cfg.cid !== undefined) {
12367
- html += this.getMenuText('mn3_hydrogenswrap', 'Hydrogens', undefined, 1, 1);
12358
+ html += this.getMenuText('mn3_hydrogenswrap', 'Hydrogens', undefined, undefined, 1);
12368
12359
  html += "<ul>";
12369
- html += this.getRadio('mn3_hydrogens', 'mn3_hydrogensYes', 'Show', true, 1, 2);
12370
- html += this.getRadio('mn3_hydrogens', 'mn3_hydrogensNo', 'Hide', undefined, 1, 2);
12360
+ html += this.getRadio('mn3_hydrogens', 'mn3_hydrogensYes', 'Show', true, undefined, 2);
12361
+ html += this.getRadio('mn3_hydrogens', 'mn3_hydrogensNo', 'Hide', undefined, undefined, 2);
12371
12362
  html += "</ul>";
12372
12363
  html += "</li>";
12373
12364
  //}
@@ -12742,7 +12733,7 @@ class SetMenu {
12742
12733
 
12743
12734
  html += "</ul>";
12744
12735
 
12745
- html += this.getRadio('mn4_clr', 'mn4_clrCustom', 'Color Picker', undefined, undefined, 1);
12736
+ html += this.getRadio('mn4_clr', 'mn4_clrCustom', 'Color Picker', undefined, 1, 1);
12746
12737
  html += this.getMenuSep();
12747
12738
 
12748
12739
  if(me.cfg.cid === undefined) {
@@ -12783,7 +12774,7 @@ class SetMenu {
12783
12774
  html += this.getRadio('mn4_clr', 'mn4_clrBfactorNorm', 'Percentile', undefined, 1, 2);
12784
12775
  html += "</ul>";
12785
12776
 
12786
- html += this.getRadio('mn4_clr', 'mn4_clrArea', 'Solvent<br><span style="padding-left:1.5em;">Accessibility</span>', undefined, undefined, 1);
12777
+ html += this.getRadio('mn4_clr', 'mn4_clrArea', 'Solvent<br><span style="padding-left:1.5em;">Accessibility</span>', undefined, 1, 1);
12787
12778
 
12788
12779
  html += this.getRadio('mn4_clr', 'mn4_clrStructure', 'Structure', undefined, 1, 1);
12789
12780
 
@@ -12795,7 +12786,7 @@ class SetMenu {
12795
12786
  }
12796
12787
 
12797
12788
  //if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
12798
- html += this.getRadio('mn4_clr', 'mn4_clrdomain', '3D Domain', undefined, undefined, 1);
12789
+ html += this.getRadio('mn4_clr', 'mn4_clrdomain', '3D Domain', undefined, 1, 1);
12799
12790
  //}
12800
12791
 
12801
12792
  if(me.cfg.cid === undefined) {
@@ -12815,16 +12806,16 @@ class SetMenu {
12815
12806
  html += this.getRadio('mn4_clr', 'mn4_clrAtom', 'Atom', undefined, 1, 1);
12816
12807
 
12817
12808
  if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
12818
- html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', true, undefined, 2);
12819
- html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', undefined, undefined, 2);
12809
+ html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', true, undefined, 1);
12810
+ html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', undefined, undefined, 1);
12820
12811
  }
12821
12812
  else if(me.cfg.blast_rep_id !== undefined) {
12822
- html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', undefined, undefined, 2);
12823
- html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', true, undefined, 2);
12813
+ html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', undefined, undefined, 1);
12814
+ html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', true, undefined, 1);
12824
12815
  }
12825
12816
  else {
12826
- html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', undefined, undefined, 2);
12827
- html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', undefined, undefined, 2);
12817
+ html += this.getRadio('mn4_clr', 'mn4_clrIdentity', 'Identity', undefined, undefined, 1);
12818
+ html += this.getRadio('mn4_clr', 'mn4_clrConserved', 'Conservation', undefined, undefined, 1);
12828
12819
  }
12829
12820
 
12830
12821
  //if(me.cfg.afid) html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'AF Confidence');
@@ -12832,8 +12823,8 @@ class SetMenu {
12832
12823
  html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'pLDDT', undefined, 1, 1);
12833
12824
  //}
12834
12825
 
12835
- html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
12836
- html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
12826
+ html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 1);
12827
+ html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 1);
12837
12828
  }
12838
12829
  else {
12839
12830
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -12886,7 +12877,7 @@ class SetMenu {
12886
12877
  html += this.getLink('mn6_selectannotations', 'Seq. & Annotations ' + me.htmlCls.wifiStr, 1, 1);
12887
12878
 
12888
12879
  //if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined) { // || ic.bRealign || ic.bSymd || ic.bInputfile) {
12889
- html += this.getLink('mn2_alignment', 'Aligned Seq. ' + me.htmlCls.wifiStr, undefined, 1);
12880
+ html += this.getLink('mn2_alignment', 'Aligned Seq. ' + me.htmlCls.wifiStr, 1, 1);
12890
12881
  //}
12891
12882
 
12892
12883
  if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.blast_rep_id !== undefined || me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
@@ -12956,27 +12947,27 @@ class SetMenu {
12956
12947
  html += "</ul>";
12957
12948
  html += "</li>";
12958
12949
 
12959
- html += this.getMenuText('mn6_anglewrap', 'Angle', undefined, 1, 1);
12950
+ html += this.getMenuText('mn6_anglewrap', 'Angle', undefined, undefined, 1);
12960
12951
  html += "<ul>";
12961
- html += this.getRadio('mn6_angle', 'mn6_angleManySets', 'among Many Sets', undefined, 1, 2);
12952
+ html += this.getRadio('mn6_angle', 'mn6_angleManySets', 'among Many Sets', undefined, undefined, 2);
12962
12953
  html += this.getRadio('mn6_angle', 'mn6_angleTwoSets', 'b/w Two Vectors', undefined, undefined, 2);
12963
12954
  html += "</ul>";
12964
12955
  html += "</li>";
12965
12956
 
12966
- html += this.getLink('mn6_area', 'Surface Area', 1, 1);
12957
+ html += this.getLink('mn6_area', 'Surface Area', undefined, 1);
12967
12958
 
12968
12959
  html += this.getMenuText('mn6_addlabelwrap', 'Label', undefined, 1, 1);
12969
12960
  html += "<ul>";
12970
12961
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelYes', 'by Picking Atoms', undefined, undefined, 2);
12971
12962
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelSelection', 'per Selection', undefined, undefined, 2);
12972
12963
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelAtoms', 'per Atom', undefined, undefined, 2);
12973
- html += this.getRadio('mn6_addlabel', 'mn6_addlabelElements', 'per Atom Element', undefined, 1, 2);
12964
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelElements', 'per Atom Element', undefined, undefined, 2);
12974
12965
  if(me.cfg.cid === undefined) {
12975
12966
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
12976
12967
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
12977
12968
 
12978
- html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
12979
- html += this.getRadio('mn6_addlabel', 'mn6_addlabelIg', 'per Ig Domain', undefined, 1, 2);
12969
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, undefined, 2);
12970
+ html += this.getRadio('mn6_addlabel', 'mn6_addlabelIg', 'per Ig Domain', undefined, undefined, 2);
12980
12971
 
12981
12972
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
12982
12973
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
@@ -13013,10 +13004,10 @@ class SetMenu {
13013
13004
  html += this.getMenuSep();
13014
13005
 
13015
13006
  if(me.cfg.cid === undefined) {
13016
- html += this.getMenuText('mn6_chemicalbindingwrap', 'Chem. Binding', undefined, undefined, 1);
13007
+ html += this.getMenuText('mn6_chemicalbindingwrap', 'Chem. Binding', undefined, 1, 1);
13017
13008
  html += "<ul>";
13018
- html += this.getRadio('mn6_chemicalbinding', 'mn6_chemicalbindingshow', 'Show', undefined, undefined, 2);
13019
- html += this.getRadio('mn6_chemicalbinding', 'mn6_chemicalbindinghide', 'Hide', true, undefined, 2);
13009
+ html += this.getRadio('mn6_chemicalbinding', 'mn6_chemicalbindingshow', 'Show', undefined, 1, 2);
13010
+ html += this.getRadio('mn6_chemicalbinding', 'mn6_chemicalbindinghide', 'Hide', true, 1, 2);
13020
13011
  html += "</ul>";
13021
13012
  html += "</li>";
13022
13013
 
@@ -13175,7 +13166,7 @@ class SetMenu {
13175
13166
 
13176
13167
  //html += liStr + "https://www.ncbi.nlm.nih.gov/structure' target='_blank'>Search Structure " + me.htmlCls.wifiStr + "</a></li>";
13177
13168
  //html += liStr + me.htmlCls.baseUrl + "icn3d/icn3d.html#citing' target='_blank'>Citing iCn3D</a></li>";
13178
- html += this.getMenuUrl('citing', me.htmlCls.baseUrl + "icn3d/icn3d.html#citing", "Citing iCn3D", undefined, 1);
13169
+ html += this.getMenuUrl('citing', me.htmlCls.baseUrl + "icn3d/icn3d.html#citing", "Citing iCn3D", 1, 1);
13179
13170
 
13180
13171
  html += this.getMenuText('mn6_source', 'Source Code', undefined, 1, 1);
13181
13172
  html += "<ul>";
@@ -15737,6 +15728,13 @@ class Events {
15737
15728
  $("#" + me.pre + id).resizable();
15738
15729
  }
15739
15730
 
15731
+ exportMsa(type) { let me = this.icn3dui, ic = me.icn3d;
15732
+ let text = ic.msa[type].join('\n\n');
15733
+ let fileType = (type == 'fasta') ? '.fasta' : (type == 'clustal') ? '.aln' : '.txt';
15734
+
15735
+ ic.saveFileCls.saveFile(ic.inputid + '_align' + fileType, 'text', [text]);
15736
+ }
15737
+
15740
15738
  async launchMmdb(ids, bBiounit, hostUrl, bAppend) { let me = this.icn3dui, ic = me.icn3d, thisClass = this;
15741
15739
  if(!me.cfg.notebook) dialog.dialog( "close" );
15742
15740
 
@@ -18487,6 +18485,24 @@ class Events {
18487
18485
  ic.selectionCls.saveSelection(name, name);
18488
18486
  });
18489
18487
 
18488
+ me.myEventCls.onIds("#" + me.pre + "saveFasta", "click", function(e) { me.icn3d;
18489
+ e.stopImmediatePropagation();
18490
+ thisClass.exportMsa('fasta');
18491
+ thisClass.setLogCmd('Save alignment in FASTA format', false);
18492
+ });
18493
+
18494
+ me.myEventCls.onIds("#" + me.pre + "saveClustal", "click", function(e) { me.icn3d;
18495
+ e.stopImmediatePropagation();
18496
+ thisClass.exportMsa('clustal');
18497
+ thisClass.setLogCmd('Save alignment in CLUSTALW format', false);
18498
+ });
18499
+
18500
+ me.myEventCls.onIds("#" + me.pre + "saveResbyres", "click", function(e) { me.icn3d;
18501
+ e.stopImmediatePropagation();
18502
+ thisClass.exportMsa('resbyres');
18503
+ thisClass.setLogCmd('Save alignment in Residue by Residue format to be used in File > Align (or Realign) > Multiple Chain > Residue by Residue', false);
18504
+ });
18505
+
18490
18506
  $(document).on("click", "." + me.pre + "outputselection", function(e) { let ic = me.icn3d;
18491
18507
  e.stopImmediatePropagation();
18492
18508
  ic.bSelectResidue = false;
@@ -19346,7 +19362,9 @@ class SetHtml {
19346
19362
 
19347
19363
  sequencesHtml += '<div style="width:20px; margin-left:3px; display:inline-block;"><span id="' + me.pre + 'alignseqguide' + suffix + '_expand" class="ui-icon ui-icon-plus icn3d-expand icn3d-link" style="width:15px;" title="Expand"></span><span id="' + me.pre + 'alignseqguide' + suffix + '_shrink" class="ui-icon ui-icon-minus icn3d-shrink icn3d-link" style="display:none; width:15px;" title="Shrink"></span></div> ';
19348
19364
 
19349
- sequencesHtml += "<div style='min-width:200px; display:inline-block;''><b>Selection:</b> Name: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignseq_command_name' value='alseq_" + index + "' size='10'> " + me.htmlCls.space2 + "<button style='white-space:nowrap;' id='" + me.pre + "alignseq_saveselection'>Save</button> <button style='white-space:nowrap; margin-left:20px;' id='" + me.pre + "alignseq_clearselection'>Clear</button></div><br/>";
19365
+ sequencesHtml += "<div style='min-width:200px; display:inline-block;'><b>Selection:</b> Name: " + me.htmlCls.inputTextStr + "id='" + me.pre + "alignseq_command_name' value='alseq_" + index + "' size='10'> " + me.htmlCls.space2 + "<button style='white-space:nowrap;' id='" + me.pre + "alignseq_saveselection'>Save</button> <button style='white-space:nowrap; margin-left:20px;' id='" + me.pre + "alignseq_clearselection'>Clear</button></div><br/>";
19366
+
19367
+ sequencesHtml += "<div style='min-width:200px; display:inline-block; margin-top:3px'><b>Save Alignment</b>: " + "<button style='white-space:nowrap;' id='" + me.pre + "saveFasta'>FASTA</button> <button style='white-space:nowrap; margin-left:20px;' id='" + me.pre + "saveClustal'>CLUSTAL</button> <button style='white-space:nowrap; margin-left:20px;' id='" + me.pre + "saveResbyres'>Residue by Residue</button></div><br/>";
19350
19368
 
19351
19369
  sequencesHtml += me.htmlCls.divStr + "alignseqguide" + suffix + "' style='display:none; white-space:normal;' class='icn3d-box'>";
19352
19370
 
@@ -19355,7 +19373,9 @@ class SetHtml {
19355
19373
  let resCategories = "<b>Residue labeling:</b> aligned residue with coordinates: UPPER case letter; non-aligned residue with coordinates: lower case letter which can be highlighted; residue missing coordinates: lower case letter which can NOT be highlighted.";
19356
19374
  let scroll =(me.utilsCls.isMac() && !me.utilsCls.isMobile()) ? "<br/><br/><b>Turn on scroll bar:</b> System preferences -> General -> show scroll bars -> check Always" : "";
19357
19375
 
19358
- sequencesHtml += resCategories + scroll + "<br/></div>";
19376
+ sequencesHtml += resCategories + scroll + "<br/>";
19377
+
19378
+ sequencesHtml += "</div>";
19359
19379
 
19360
19380
  return sequencesHtml;
19361
19381
  }
@@ -62270,6 +62290,7 @@ class SetSeqAlign {
62270
62290
  setSeqAlign(seqalign, alignedStructures) { let ic = this.icn3d, me = ic.icn3dui;
62271
62291
  let mmdbid1 = alignedStructures[0][0].pdbId;
62272
62292
  let mmdbid2 = alignedStructures[0][1].pdbId;
62293
+ let chainid1, chainid2;
62273
62294
 
62274
62295
  ic.conservedName1 = mmdbid1 + '_cons';
62275
62296
  ic.nonConservedName1 = mmdbid1 + '_ncons';
@@ -62293,7 +62314,7 @@ class SetSeqAlign {
62293
62314
  let molid1 = alignData.moleculeId;
62294
62315
 
62295
62316
  let chain1 = ic.pdbid_molid2chain[mmdbid1 + '_' + molid1];
62296
- let chainid1 = mmdbid1 + '_' + chain1;
62317
+ chainid1 = mmdbid1 + '_' + chain1;
62297
62318
 
62298
62319
  let id2aligninfo = {};
62299
62320
  let start = alignData.sequence.length, end = -1;
@@ -62325,7 +62346,7 @@ class SetSeqAlign {
62325
62346
  let molid2 = alignData.moleculeId;
62326
62347
 
62327
62348
  let chain2 = ic.pdbid_molid2chain[mmdbid2 + '_' + molid2];
62328
- let chainid2 = mmdbid2 + '_' + chain2;
62349
+ chainid2 = mmdbid2 + '_' + chain2;
62329
62350
 
62330
62351
  // annotation title for the master seq only
62331
62352
  if(ic.alnChainsAnTtl[chainid1] === undefined ) ic.alnChainsAnTtl[chainid1] = [];
@@ -62493,7 +62514,9 @@ class SetSeqAlign {
62493
62514
  ic.alnChainsAnno[chainid1][3].push(numberStr); // symbol: 10, 20, etc, empty for rest
62494
62515
 
62495
62516
  ++alignIndex;
62496
- } // end for(let j
62517
+ } // end for(let j
62518
+
62519
+ this.setMsaFormat([chainid1, chainid2]);
62497
62520
  } // end for(let i
62498
62521
 
62499
62522
  seqalign = {};
@@ -62573,7 +62596,7 @@ class SetSeqAlign {
62573
62596
  }
62574
62597
 
62575
62598
  setSeqAlignChain(chainid, chainIndex, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
62576
- let hAtoms = {};
62599
+ let hAtoms = {};
62577
62600
 
62578
62601
  let bRealign = (chainidArray) ? true : false;
62579
62602
  let mmdbid1, mmdbid2, chain1, chain2, chainid1, chainid2, pos1, pos2;
@@ -62794,23 +62817,6 @@ class SetSeqAlign {
62794
62817
  ///if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid2] === undefined) break;
62795
62818
 
62796
62819
  let resi1, resi2, resn1, resn2;
62797
- /*
62798
- if(bRealign) { // tmalign: just one residue in this for loop
62799
- if(me.cfg.aligntool == 'tmalign') {
62800
- resi1 = ic.qt_start_end[chainIndex][i].t_start;
62801
- resi2 = ic.qt_start_end[chainIndex][i].q_start;
62802
- }
62803
- else {
62804
- resi1 = j + start1;
62805
- resi2 = j + start2;
62806
- }
62807
-
62808
- resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
62809
- resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
62810
-
62811
- if(resn1 == '?' || resn2 == '?') continue;
62812
- }
62813
- */
62814
62820
  if(bRealign && me.cfg.aligntool == 'tmalign') { // tmalign: just one residue in this for loop
62815
62821
  resi1 = ic.qt_start_end[chainIndex][i].t_start;
62816
62822
  resi2 = ic.qt_start_end[chainIndex][i].q_start;
@@ -62821,15 +62827,6 @@ class SetSeqAlign {
62821
62827
  if(resn1 == '?' || resn2 == '?') continue;
62822
62828
  }
62823
62829
  else {
62824
- ///if(ic.chainsSeq[chainid1][j + start1] === undefined || ic.chainsSeq[chainid2][j + start2] === undefined) continue;
62825
-
62826
- // resi1 = ic.chainsSeq[chainid1][j + start1].resi;
62827
- // resi2 = ic.chainsSeq[chainid2][j + start2].resi;
62828
- // resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
62829
- // resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
62830
-
62831
- // resi1 = this.getResiAferAlign(chainid1, bRealign, j + start1 + 1);
62832
- // resi2 = this.getResiAferAlign(chainid2, bRealign, j + start2 + 1);
62833
62830
  resi1 = this.getResiAferAlign(chainid1, bRealign, j + start1);
62834
62831
  resi2 = this.getResiAferAlign(chainid2, bRealign, j + start2);
62835
62832
  resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
@@ -62869,14 +62866,15 @@ class SetSeqAlign {
62869
62866
 
62870
62867
  prevIndex1 = end1;
62871
62868
  prevIndex2 = end2;
62872
- } // end for(let i
62869
+ } // end for(let i
62870
+
62871
+ this.setMsaFormat([chainid1, chainid2]);
62873
62872
 
62874
62873
  return hAtoms;
62875
62874
  }
62876
62875
 
62877
62876
  setSeqAlignChainForAll(chainidArray, index_alignLen, bRealign) { let ic = this.icn3d, me = ic.icn3dui;
62878
62877
  let hAtoms = {};
62879
-
62880
62878
  let chainid1 = chainidArray[0];
62881
62879
 
62882
62880
  ic.alnChainsAnno[chainid1] = [];
@@ -63030,7 +63028,8 @@ class SetSeqAlign {
63030
63028
  resObject.aligned = (resid2range_t[resid]) ? true : false;
63031
63029
  resObject.color = (resid2range_t[resid]) ? '#FF0000' : me.htmlCls.GREYC; // color by identity
63032
63030
  resObject.color2 = (resid2range_t[resid]) ? '#FF0000' : me.htmlCls.GREYC; // color by conservation
63033
- resObject.class = (resid2range_t[resid]) ? 'icn3d-align' : 'icn3d-nalign';
63031
+ // resObject.class = (resid2range_t[resid]) ? 'icn3d-align' : 'icn3d-nalign';
63032
+ resObject.class = (resid2range_t[resid]) ? 'icn3d-cons' : 'icn3d-nalign';
63034
63033
 
63035
63034
  ic.alnChainsSeq[chainid1].push(resObject);
63036
63035
 
@@ -63049,7 +63048,9 @@ class SetSeqAlign {
63049
63048
  let hAtomsTmp = this.mergeTwoSeqForAll(chainidArray, index, alignedChainIndice, resid2range_t, start_t, end_t, bRealign);
63050
63049
 
63051
63050
  hAtoms = me.hashUtilsCls.unionHash(hAtoms, hAtomsTmp);
63052
- }
63051
+ }
63052
+
63053
+ this.setMsaFormat(chainidArray);
63053
63054
 
63054
63055
  // 3. assign the variable ic.alnChainsAnno
63055
63056
  for(let i = 0; i < 3 + 2*n; ++i) {
@@ -63120,7 +63121,7 @@ class SetSeqAlign {
63120
63121
  resObject.aligned = (bGap) ? false : bAligned;
63121
63122
  resObject.color = (bGap || !bAligned) ? me.htmlCls.GREYC : ((resn == resn_t) ? "#FF0000" : "#0000FF"); // color by identity
63122
63123
  resObject.color2 = (bGap || !bAligned) ? me.htmlCls.GREYC : '#' + ic.showAnnoCls.getColorhexFromBlosum62(resn, resn_t); // color by conservation
63123
- resObject.class = (bGap || !bAligned) ? 'icn3d-nalign' : 'icn3d-align';
63124
+ resObject.class = (bGap || !bAligned) ? 'icn3d-nalign' : ((resn == resn_t) ? "icn3d-cons" : "icn3d-ncons");
63124
63125
 
63125
63126
  return resObject;
63126
63127
  }
@@ -63394,7 +63395,7 @@ class SetSeqAlign {
63394
63395
  pos2 = result.pos2;
63395
63396
  for(let i = pos1; i < pos2; ++i) {
63396
63397
  //for(let i = pos1; i <= pos2; ++i) {
63397
- ic.alnChainsSeq[chainid2].push(gapResObject2);
63398
+ ic.alnChainsSeq[chainid2].push(gapResObject2);
63398
63399
  }
63399
63400
 
63400
63401
  return hAtoms;
@@ -63721,6 +63722,107 @@ class SetSeqAlign {
63721
63722
  }
63722
63723
  }
63723
63724
  }
63725
+
63726
+ setMsaFormat(chainidArray) { let ic = this.icn3d; ic.icn3dui;
63727
+ //set MSA
63728
+ let fastaFormat = '', clustalFormat = 'CLUSTALW\n\n', resbyresFormat = '';
63729
+ let chainArrayClustal = [];
63730
+
63731
+ let consArray = [], resiArrayTemplate = [];
63732
+ let chainidTemplate = chainidArray[0];
63733
+ for(let i = 0, il = chainidArray.length; i < il; ++i) {
63734
+ let chainid = chainidArray[i];
63735
+ fastaFormat += '>' + chainid + '\n';
63736
+
63737
+ let clustalArray = [];
63738
+ let clustalLine = chainid.padEnd(20, ' ');
63739
+ let consLine = ''.padEnd(20, ' ');
63740
+
63741
+ let resiArrayTarget = [], resiArrayQuery = [];
63742
+
63743
+ let cnt = 0;
63744
+ for(let j = 0, jl = ic.alnChainsSeq[chainid].length; j < jl; ++j) {
63745
+ let resn = ic.alnChainsSeq[chainid][j].resn;
63746
+ fastaFormat += resn;
63747
+ clustalLine += resn;
63748
+ if(i == il - 1) {
63749
+ let alignedClass = ic.alnChainsSeq[chainid][j].class;
63750
+ if(alignedClass == 'icn3d-cons') {
63751
+ consLine += '*';
63752
+ }
63753
+ else if(alignedClass == 'icn3d-ncons') {
63754
+ consLine += '.';
63755
+ }
63756
+ else {
63757
+ consLine += ' ';
63758
+ }
63759
+ }
63760
+
63761
+ // residue by residue
63762
+ if(i == 0) {
63763
+ resiArrayTemplate.push(ic.alnChainsSeq[chainid][j].resi);
63764
+ }
63765
+ else {
63766
+ if(ic.alnChainsSeq[chainid][j].aligned) {
63767
+ resiArrayTarget.push(ic.alnChainsSeq[chainidTemplate][j].resi);
63768
+ resiArrayQuery.push(ic.alnChainsSeq[chainid][j].resi);
63769
+ }
63770
+ }
63771
+
63772
+ ++cnt;
63773
+
63774
+ if(cnt % 60 == 0) {
63775
+ fastaFormat += '\n';
63776
+ clustalLine += ' ' + String(parseInt(cnt / 60) * 60);
63777
+ clustalArray.push(clustalLine);
63778
+ clustalLine = chainid.padEnd(20, ' ');
63779
+
63780
+ if(i == il - 1) {
63781
+ consArray.push(consLine);
63782
+ consLine = ''.padEnd(20, ' ');
63783
+ }
63784
+ }
63785
+ }
63786
+
63787
+ // add last line
63788
+ if(cnt % 60 != 0) {
63789
+ clustalArray.push(clustalLine);
63790
+ if(i == il - 1) {
63791
+ consArray.push(consLine);
63792
+ }
63793
+ }
63794
+
63795
+ fastaFormat += '\n';
63796
+
63797
+ chainArrayClustal.push(clustalArray);
63798
+ if(i == il - 1) chainArrayClustal.push(consArray);
63799
+
63800
+ // residue by residue
63801
+ let resiRangeStr1 = ic.resid2specCls.resi2range(resiArrayTarget, true);
63802
+ let resiRangeStr2 = ic.resid2specCls.resi2range(resiArrayQuery, true);
63803
+
63804
+ if(i > 0) resbyresFormat += resiRangeStr1 + ' | ' + resiRangeStr2 + '\n';
63805
+ }
63806
+
63807
+ // CLUSTALW
63808
+ for(let j = 0, jl = chainArrayClustal[0].length; j < jl; ++j) {
63809
+ for(let i = 0, il = chainArrayClustal.length; i < il; ++i) {
63810
+ clustalFormat += chainArrayClustal[i][j] + '\n';
63811
+ }
63812
+ clustalFormat += '\n';
63813
+ }
63814
+
63815
+ // seq MSA
63816
+ if(!ic.msa) ic.msa = {};
63817
+
63818
+ if(!ic.msa['fasta']) ic.msa['fasta'] = [];
63819
+ if(!ic.msa['clustal']) ic.msa['clustal'] = [];
63820
+ if(!ic.msa['resbyres']) ic.msa['resbyres'] = [];
63821
+
63822
+ ic.msa['fasta'].push(fastaFormat);
63823
+ ic.msa['clustal'].push(clustalFormat);
63824
+ ic.msa['resbyres'].push(resbyresFormat);
63825
+ }
63724
63826
  }
63725
63827
 
63726
63828
  /**
@@ -71345,8 +71447,8 @@ class Resid2spec {
71345
71447
  return spec;
71346
71448
  }
71347
71449
 
71348
- resi2range(resiArray) {var ic = this.icn3d; ic.icn3dui;
71349
- let range = [];
71450
+ resi2range(resiArray, bString) {var ic = this.icn3d; ic.icn3dui;
71451
+ let range = [], rangeStr = '';
71350
71452
 
71351
71453
  let resiArraySorted = resiArray.sort(function(a, b) {
71352
71454
  return parseInt(a) - parseInt(b);
@@ -71357,9 +71459,14 @@ class Resid2spec {
71357
71459
  for(let j = 0, jl = resiArraySorted.length; j < jl; ++j) {
71358
71460
  resi = resiArraySorted[j];
71359
71461
 
71360
- if(j != 0 && resi != prevResi + 1) {
71462
+ if(j != 0 && parseInt(resi) != parseInt(prevResi) + 1) {
71361
71463
  range.push(startResi);
71362
71464
  range.push(prevResi);
71465
+
71466
+ if(rangeStr) rangeStr += ',';
71467
+ if(startResi == prevResi) rangeStr += startResi;
71468
+ else rangeStr += startResi + '-' + prevResi;
71469
+
71363
71470
  startResi = resi;
71364
71471
  }
71365
71472
 
@@ -71369,8 +71476,13 @@ class Resid2spec {
71369
71476
  // last residue
71370
71477
  range.push(startResi);
71371
71478
  range.push(prevResi);
71372
-
71373
- return range;
71479
+
71480
+ if(rangeStr) rangeStr += ',';
71481
+ if(startResi == prevResi) rangeStr += startResi;
71482
+ else rangeStr += startResi + '-' + prevResi;
71483
+
71484
+ if(bString) return rangeStr;
71485
+ else return range;
71374
71486
  }
71375
71487
 
71376
71488
  atoms2spec(atomHash) {var ic = this.icn3d; ic.icn3dui;
@@ -82965,7 +83077,7 @@ class iCn3DUI {
82965
83077
  //even when multiple iCn3D viewers are shown together.
82966
83078
  this.pre = this.cfg.divid + "_";
82967
83079
 
82968
- this.REVISION = '3.40.5';
83080
+ this.REVISION = '3.41.0';
82969
83081
 
82970
83082
  // In nodejs, iCn3D defines "window = {navigator: {}}"
82971
83083
  this.bNode = (Object.keys(window).length < 2) ? true : false;