icn3d 3.48.0 → 3.49.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
@@ -58571,6 +58571,34 @@ class ClickMenu {
58571
58571
  thisClass.setLogCmd('symmetry ' + title, true);
58572
58572
  });
58573
58573
 
58574
+ me.myEventCls.onIds("#" + me.pre + "2ddgm_r2dt", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
58575
+ thisClass.SetChainsAdvancedMenu();
58576
+
58577
+ let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein'], true);
58578
+ if($("#" + me.pre + "atomsCustomNucleotide").length && definedAtomsHtml) {
58579
+ $("#" + me.pre + "atomsCustomNucleotide").html(definedAtomsHtml);
58580
+ me.htmlCls.dialogCls.openDlg('dl_2ddgm_r2dt', 'Show R2DT Diagram for Nucleotides');
58581
+ $("#" + me.pre + "atomsCustomNucleotide").resizable();
58582
+ }
58583
+ else {
58584
+ var aaa = 1; //alert("No nucleotide chain is found.");
58585
+ }
58586
+ });
58587
+
58588
+ me.myEventCls.onIds("#" + me.pre + "2ddgm_igdgm", "click", function(e) { let ic = me.icn3d; //e.preventDefault();
58589
+ thisClass.SetChainsAdvancedMenu();
58590
+
58591
+ let definedAtomsHtml = ic.definedSetsCls.setAtomMenu(['protein'], false, true);
58592
+ if($("#" + me.pre + "atomsCustomProtein").length && definedAtomsHtml) {
58593
+ $("#" + me.pre + "atomsCustomProtein").html(definedAtomsHtml);
58594
+ me.htmlCls.dialogCls.openDlg('dl_2ddgm_igdgm', 'Show Ig Diagram for Proteins');
58595
+ $("#" + me.pre + "atomsCustomProtein").resizable();
58596
+ }
58597
+ else {
58598
+ var aaa = 1; //alert("No protein chain is found.");
58599
+ }
58600
+ });
58601
+
58574
58602
  me.myEventCls.onIds(["#" + me.pre + "mn6_hbondsYes", "#" + me.pre + "hbondsYes"], "click", function(e) { let ic = me.icn3d; //e.preventDefault();
58575
58603
  thisClass.SetChainsAdvancedMenu();
58576
58604
 
@@ -60476,9 +60504,15 @@ class SetMenu {
60476
60504
  html += this.getLink('mn2_alignment', 'Aligned Seq. ' + me.htmlCls.wifiStr, 1, 1);
60477
60505
  //}
60478
60506
 
60507
+ html += this.getMenuText('2ddgmwrap', '2D Diagram', undefined, 1, 1);
60508
+ html += "<ul>";
60509
+ html += this.getLink('2ddgm_r2dt', 'for Nucleotides (R2DT)' + me.htmlCls.wifiStr, 1, 2);
60510
+ html += this.getLink('2ddgm_igdgm', 'for Ig Domains' + me.htmlCls.wifiStr, 1, 2);
60479
60511
  if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined || me.cfg.blast_rep_id !== undefined || me.cfg.align !== undefined || me.cfg.chainalign !== undefined) {
60480
- html += this.getLink('mn2_2ddgm', '2D Diagram ' + me.htmlCls.wifiStr, 1, 1);
60512
+ html += this.getLink('mn2_2ddgm', 'for Chains ' + me.htmlCls.wifiStr, 1, 2);
60481
60513
  }
60514
+ html += "</ul>";
60515
+ html += "</li>";
60482
60516
 
60483
60517
  html += this.getMenuText('2dctnwrap', '2D Cartoon', undefined, undefined, 1);
60484
60518
  html += "<ul>";
@@ -60924,6 +60958,7 @@ class Dialog {
60924
60958
  let bHbondplot = $('#' + me.pre + 'dl_hbondplot').hasClass('ui-dialog-content'); // initialized
60925
60959
  let bLigplot = $('#' + me.pre + 'dl_ligplot').hasClass('ui-dialog-content'); // initialized
60926
60960
  let bContactmap = $('#' + me.pre + 'dl_contactmap').hasClass('ui-dialog-content'); // initialized
60961
+ let b2ddiagram = $('#' + me.pre + 'dl_2ddiagram').hasClass('ui-dialog-content'); // initialized
60927
60962
  let bAlignerrormap = $('#' + me.pre + 'dl_alignerrormap').hasClass('ui-dialog-content'); // initialized
60928
60963
  let bTable = $('#' + me.pre + 'dl_interactionsorted').hasClass('ui-dialog-content'); // initialized
60929
60964
  let bAlignmentInit = $('#' + me.pre + 'dl_alignment').hasClass('ui-dialog-content'); // initialized
@@ -60943,6 +60978,7 @@ class Dialog {
60943
60978
  id2flag.dl_hbondplot = 'bHbondplot2';
60944
60979
  id2flag.dl_ligplot = 'bLigplot2';
60945
60980
  id2flag.dl_contactmap = 'bContactmap2';
60981
+ id2flag.dl_2ddiagram = 'b2ddiagram2';
60946
60982
  id2flag.dl_alignerrormap = 'bAlignerrormap2';
60947
60983
  id2flag.dl_interactionsorted = 'bTable2';
60948
60984
  id2flag.dl_alignment = 'bAlignmentInit2';
@@ -60958,6 +60994,7 @@ class Dialog {
60958
60994
  if(bHbondplot) status.bHbondplot2 = $('#' + me.pre + 'dl_hbondplot').dialog( 'isOpen' );
60959
60995
  if(bLigplot) status.bLigplot2 = $('#' + me.pre + 'dl_ligplot').dialog( 'isOpen' );
60960
60996
  if(bContactmap) status.bContactmap2 = $('#' + me.pre + 'dl_contactmap').dialog( 'isOpen' );
60997
+ if(b2ddiagram) status.b2ddiagram2 = $('#' + me.pre + 'dl_2ddiagram').dialog( 'isOpen' );
60961
60998
  if(bAlignerrormap) status.bAlignerror2 = $('#' + me.pre + 'dl_alignerrormap').dialog( 'isOpen' );
60962
60999
  if(bTable) status.bTable2 = $('#' + me.pre + 'dl_interactionsorted').dialog( 'isOpen' );
60963
61000
  if(bAlignmentInit) status.bAlignmentInit2 = $('#' + me.pre + 'dl_alignment').dialog( 'isOpen' );
@@ -61043,7 +61080,7 @@ class Dialog {
61043
61080
 
61044
61081
  d3.select("#" + me.svgid).attr("width", width).attr("height", height);
61045
61082
  }
61046
- else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
61083
+ else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_2ddiagram' || id == me.pre + 'dl_alignerrormap') {
61047
61084
  let oriWidth =(status.bTwoddgmInit2 || status.bSetsInit2) ?(me.htmlCls.WIDTH - twoddgmWidth)/2 : me.htmlCls.WIDTH / 2;
61048
61085
  let ratio = $("#" + id).width() / oriWidth;
61049
61086
 
@@ -61067,6 +61104,10 @@ class Dialog {
61067
61104
  let width = ic.contactmapWidth * ratio;
61068
61105
  $("#" + me.contactmapid).attr("width", width);
61069
61106
  }
61107
+ // else if(id == me.pre + 'dl_2ddiagram') {
61108
+ // let width = ic.twoddiagramWidth * ratio;
61109
+ // $("#" + me.twoddiagramid).attr("width", width);
61110
+ // }
61070
61111
  else if(id == me.pre + 'dl_alignerrormap') {
61071
61112
  let width = ic.alignerrormapWidth * ratio;
61072
61113
  $("#" + me.alignerrormapid).attr("width", width);
@@ -61145,7 +61186,7 @@ class Dialog {
61145
61186
 
61146
61187
  let status = this.getDialogStatus().status;
61147
61188
 
61148
- if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
61189
+ if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_2ddiagram' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
61149
61190
  //var dialogWidth = 0.5 *(me.htmlCls.WIDTH - me.htmlCls.LESSWIDTH) - twoddgmWidth * 0.5;
61150
61191
  let dialogWidth = 0.5 *(me.htmlCls.WIDTH) - twoddgmWidth * 0.5;
61151
61192
 
@@ -61181,16 +61222,17 @@ class Dialog {
61181
61222
  modal: false,
61182
61223
  position: position,
61183
61224
  close: function(e) {
61184
- if((id === me.pre + 'dl_selectannotations' &&(!status.bAlignmentInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61185
- ||(id === me.pre + 'dl_graph' &&(!status.bSelectannotationsInit2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61186
- ||(id === me.pre + 'dl_alignment' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61187
- ||(id === me.pre + 'dl_interactionsorted' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61188
- ||(id === me.pre + 'dl_linegraph' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61189
- ||(id === me.pre + 'dl_scatterplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61190
- ||(id === me.pre + 'dl_ligplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61191
- ||(id === me.pre + 'dl_contactmap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61192
- ||(id === me.pre + 'dl_alignerrormap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bHbondplot2))
61193
- ||(id === me.pre + 'dl_hbondplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2))
61225
+ if((id === me.pre + 'dl_selectannotations' &&(!status.bAlignmentInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61226
+ ||(id === me.pre + 'dl_graph' &&(!status.bSelectannotationsInit2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61227
+ ||(id === me.pre + 'dl_alignment' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61228
+ ||(id === me.pre + 'dl_interactionsorted' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61229
+ ||(id === me.pre + 'dl_linegraph' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61230
+ ||(id === me.pre + 'dl_scatterplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61231
+ ||(id === me.pre + 'dl_ligplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61232
+ ||(id === me.pre + 'dl_contactmap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61233
+ ||(id === me.pre + 'dl_alignerrormap' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bHbondplot2) &&(!status.b2ddiagram2))
61234
+ ||(id === me.pre + 'dl_hbondplot' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.b2ddiagram2))
61235
+ ||(id === me.pre + 'dl_2ddiagram' &&(!status.bSelectannotationsInit2) &&(!status.bGraph2) &&(!status.bAlignmentInit2) &&(!status.bTable2) &&(!status.bLineGraph2) &&(!status.bScatterplot2) &&(!status.bLigplot2) &&(!status.bContactmap2) &&(!status.bAlignerrormap2) &&(!status.bHbondplot2))
61194
61236
  ) {
61195
61237
  if(status.bTwoddgmInit2 || status.bTwodctnInit2 || status.bSetsInit2) {
61196
61238
  let canvasWidth = me.utilsCls.isMobile() ? me.htmlCls.WIDTH : me.htmlCls.WIDTH - twoddgmWidth;
@@ -61216,7 +61258,7 @@ class Dialog {
61216
61258
 
61217
61259
  d3.select("#" + me.svgid).attr("width", width).attr("height", height);
61218
61260
  }
61219
- else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_alignerrormap') {
61261
+ else if(id == me.pre + 'dl_linegraph' || id == me.pre + 'dl_scatterplot' || id == me.pre + 'dl_ligplot' || id == me.pre + 'dl_contactmap' || id == me.pre + 'dl_2ddiagram' || id == me.pre + 'dl_alignerrormap') {
61220
61262
  let oriWidth =(status.bTwoddgmInit2 || status.bSetsInit2) ?(me.htmlCls.WIDTH - twoddgmWidth)/2 : me.htmlCls.WIDTH / 2;
61221
61263
  let ratio = $("#" + id).width() / oriWidth;
61222
61264
 
@@ -61236,6 +61278,10 @@ class Dialog {
61236
61278
  let width = ic.contactmapWidth * ratio;
61237
61279
  $("#" + me.contactmapid).attr("width", width);
61238
61280
  }
61281
+ // else if(id == me.pre + 'dl_2ddiagram') {
61282
+ // let width = ic.twoddiagramWidth * ratio;
61283
+ // $("#" + me.twoddiagramid).attr("width", width);
61284
+ // }
61239
61285
  else if(id == me.pre + 'dl_alignerrormap') {
61240
61286
  let width = ic.alignerrormapWidth * ratio;
61241
61287
  $("#" + me.alignerrormapid).attr("width", width);
@@ -61372,7 +61418,7 @@ class Dialog {
61372
61418
  let width = 400, height = 150;
61373
61419
  let twoddgmWidth = me.htmlCls.width2d + 20;
61374
61420
 
61375
- if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
61421
+ if(id === me.pre + 'dl_selectannotations' || id === me.pre + 'dl_graph' || id === me.pre + 'dl_linegraph' || id === me.pre + 'dl_scatterplot' || id === me.pre + 'dl_rmsdplot' || id === me.pre + 'dl_hbondplot' || id === me.pre + 'dl_ligplot' || id === me.pre + 'dl_contactmap' || id === me.pre + 'dl_2ddiagram' || id === me.pre + 'dl_alignerrormap' || id === me.pre + 'dl_interactionsorted' || id === me.pre + 'dl_alignment') {
61376
61422
  $( "#" + id ).show();
61377
61423
  $( "#" + id + "_nb").show();
61378
61424
  $( "#" + id + "_title").html(title);
@@ -61417,6 +61463,11 @@ class Dialog {
61417
61463
 
61418
61464
  $("#" + me.contactmapid).attr("width", width);
61419
61465
  }
61466
+ // else if(id == me.pre + 'dl_2ddiagram') {
61467
+ // let width = ic.twoddiagramWidth * ratio;
61468
+
61469
+ // $("#" + me.twoddiagramid).attr("width", width);
61470
+ // }
61420
61471
  else if(id == me.pre + 'dl_alignerrormap') {
61421
61472
  let width = ic.alignerrormapWidth * ratio;
61422
61473
 
@@ -62108,6 +62159,22 @@ class SetDialog {
62108
62159
  html += "<span style='white-space:nowrap;'>" + me.htmlCls.buttonStr + "applycontactmap'>Display</button></span><br>";
62109
62160
  html += "</div>";
62110
62161
 
62162
+ html += me.htmlCls.divStr + "dl_2ddgm_r2dt' class='" + dialogClass + "'>";
62163
+ html += this.addNotebookTitle('dl_2ddgm_r2dt', '2D Diagram for Nucleotides (R2DT)');
62164
+ html += "1. Select a nucleotide chain to show R2DT diagram:<br>";
62165
+ html += "<select style='max-width:200px' id='" + me.pre + "atomsCustomNucleotide' size='5' style='min-width:130px;'>";
62166
+ html += "</select><br>";
62167
+ html += me.htmlCls.buttonStr + "applyr2dt'>Show R2DT Diagram</button><br>";
62168
+ html += "</div>";
62169
+
62170
+ html += me.htmlCls.divStr + "dl_2ddgm_igdgm' class='" + dialogClass + "'>";
62171
+ html += this.addNotebookTitle('dl_2ddgm_igdgm', '2D Diagram for Ig Domains (R2DT)');
62172
+ html += "1. Select a protein chain to show Ig diagram. An Excel file containing <br>the Ig diagram will be saved to your computer.<br>";
62173
+ html += "<select style='max-width:200px' id='" + me.pre + "atomsCustomProtein' size='5' style='min-width:130px;'>";
62174
+ html += "</select><br>";
62175
+ html += me.htmlCls.buttonStr + "applyigdgm'>Show Ig Diagram</button><br>";
62176
+ html += "</div>";
62177
+
62111
62178
  html += me.htmlCls.divStr + "dl_hbonds' class='" + dialogClass + "'>";
62112
62179
  html += this.addNotebookTitle('dl_hbonds', 'Interaction Analysis');
62113
62180
  html += "1. Choose interaction types and their thresholds:<br>";
@@ -62435,6 +62502,11 @@ class SetDialog {
62435
62502
 
62436
62503
  html += "</div>";
62437
62504
 
62505
+ html += me.htmlCls.divStr + "dl_2ddiagram' style='background-color:white' class='" + dialogClass + "'>";
62506
+ html += this.addNotebookTitle('dl_2ddiagram', '2D Diagram');
62507
+ html += '<div id="' + me.pre + '2ddiagramDiv"></div>';
62508
+ html += "</div>";
62509
+
62438
62510
  html += me.htmlCls.divStr + "dl_alignerrormap' style='background-color:white' class='" + dialogClass + "'>";
62439
62511
  html += this.addNotebookTitle('dl_alignerrormap', 'PAE Map');
62440
62512
 
@@ -65686,6 +65758,24 @@ class Events {
65686
65758
  await ic.contactMapCls.contactMap(contactdist, contacttype);
65687
65759
  thisClass.setLogCmd('contact map | dist ' + contactdist + ' | type ' + contacttype, true);
65688
65760
  });
65761
+ me.myEventCls.onIds("#" + me.pre + "applyr2dt", "click", async function(e) { let ic = me.icn3d;
65762
+ e.preventDefault();
65763
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
65764
+
65765
+ let chainid = $("#" + ic.pre + "atomsCustomNucleotide").val();
65766
+
65767
+ await ic.diagram2dCls.drawR2dt(chainid);
65768
+ thisClass.setLogCmd('diagram 2d nucleotide | ' + chainid, true);
65769
+ });
65770
+ me.myEventCls.onIds("#" + me.pre + "applyigdgm", "click", async function(e) { let ic = me.icn3d;
65771
+ e.preventDefault();
65772
+ //if(!me.cfg.notebook) dialog.dialog( "close" );
65773
+
65774
+ let chainid = $("#" + ic.pre + "atomsCustomProtein").val();
65775
+
65776
+ await ic.diagram2dCls.drawIgdgm(chainid);
65777
+ thisClass.setLogCmd('diagram 2d ig | ' + chainid, true);
65778
+ });
65689
65779
  me.myEventCls.onIds("#" + me.pre + "hbondWindow", "click", async function(e) { let ic = me.icn3d;
65690
65780
  e.preventDefault();
65691
65781
 
@@ -68037,13 +68127,15 @@ class SetHtml {
68037
68127
 
68038
68128
  this.setCookieForThickness();
68039
68129
 
68040
- if(postfix = bReset) {
68130
+ // if(postfix = '3dprint' && bReset) {
68131
+ if(bReset) {
68041
68132
  let select = "reset thickness";
68042
68133
  me.htmlCls.clickMenuCls.setLogCmd(select, true);
68043
68134
  ic.bSetThickness = false;
68044
68135
  ic.threeDPrintCls.resetAfter3Dprint();
68045
68136
  }
68046
68137
  else {
68138
+ me.htmlCls.clickMenuCls.setLogCmd('set background ' + ic.bkgdcolor, true);
68047
68139
  me.htmlCls.clickMenuCls.setLogCmd('set thickness | linerad ' + ic.lineRadius + ' | coilrad ' + ic.coilWidth + ' | stickrad ' + ic.cylinderRadius + ' | crosslinkrad ' + ic.crosslinkRadius + ' | tracerad ' + ic.traceRadius + ' | ribbonthick ' + ic.ribbonthickness + ' | proteinwidth ' + ic.helixSheetWidth + ' | nucleotidewidth ' + ic.nucleicAcidWidth + ' | ballscale ' + ic.dotSphereScale, true);
68048
68140
 
68049
68141
  me.htmlCls.clickMenuCls.setLogCmd('set glycan ' + ic.bGlycansCartoon, true);
@@ -74593,7 +74685,8 @@ class Scene {
74593
74685
  if(me.htmlCls.setHtmlCls.getCookie('bkgdcolor') != '') {
74594
74686
  let bkgdcolor = me.htmlCls.setHtmlCls.getCookie('bkgdcolor');
74595
74687
 
74596
- if(ic.bkgdcolor != bkgdcolor) {
74688
+ // if(ic.bkgdcolor != bkgdcolor) {
74689
+ if(bkgdcolor != 'black') {
74597
74690
  me.htmlCls.clickMenuCls.setLogCmd('set background ' + bkgdcolor, true);
74598
74691
  }
74599
74692
 
@@ -79510,7 +79603,7 @@ class Strand {
79510
79603
  let bShowArray = [];
79511
79604
  let calphaIdArray = []; // used to store one of the final positions drawn in 3D
79512
79605
  let colors = [];
79513
- let currentChain, currentCA = null, currentO = null, currentColor = null, prevCoorCA = null, prevCoorO = null, prevColor = null;
79606
+ let currentChain, currentStyle, currentCA = null, currentO = null, currentColor = null, prevCoorCA = null, prevCoorO = null, prevColor = null;
79514
79607
  let prevCO = null, ss = null, ssend = false, atomid = null, prevAtomid = null, prevResi = null, calphaid = null, prevCalphaid = null;
79515
79608
  let strandWidth, bSheetSegment = false, bHelixSegment = false;
79516
79609
  let atom, tubeAtoms = {};
@@ -79563,15 +79656,15 @@ class Strand {
79563
79656
  }
79564
79657
  // smoothen each coil, helix and sheet separately. The joint residue has to be included both in the previous and next segment
79565
79658
  let bSameChain = true;
79566
- // if (currentChain !== atom.chain || currentResi + 1 !== atom.resi) {
79659
+
79567
79660
  if (currentChain !== atom.chain) {
79568
79661
  bSameChain = false;
79569
79662
  }
79570
79663
 
79571
- if(atom.ssend && atom.ss === 'sheet') {
79664
+ if((atom.ssend || currentStyle != atom.style)&& atom.ss === 'sheet') {
79572
79665
  bSheetSegment = true;
79573
79666
  }
79574
- else if(atom.ssend && atom.ss === 'helix') {
79667
+ else if((atom.ssend || currentStyle != atom.style) && atom.ss === 'helix') {
79575
79668
  bHelixSegment = true;
79576
79669
  }
79577
79670
 
@@ -79664,7 +79757,7 @@ class Strand {
79664
79757
  // bHelixSegment = true;
79665
79758
  // }
79666
79759
 
79667
- if ((atom.ssbegin || atom.ssend || (drawnResidueCount === totalResidueCount - 1) || bBrokenSs) && pnts[0].length > 0 && bSameChain) {
79760
+ if ((atom.ssbegin || atom.ssend || (drawnResidueCount === totalResidueCount - 1) || bBrokenSs || currentStyle != atom.style) && pnts[0].length > 0 && bSameChain) {
79668
79761
  let atomName = 'CA';
79669
79762
 
79670
79763
  let prevone = [], nexttwo = [];
@@ -79807,9 +79900,7 @@ class Strand {
79807
79900
  } // end if (atom.ssbegin || atom.ssend)
79808
79901
 
79809
79902
  // end of a chain
79810
- // if ((currentChain !== atom.chain || currentResi + 1 !== atom.resi) && pnts[0].length > 0) {
79811
- if ((currentChain !== atom.chain) && pnts[0].length > 0) {
79812
-
79903
+ if ((currentChain !== atom.chain || currentStyle != atom.style) && pnts[0].length > 0) {
79813
79904
  let atomName = 'CA';
79814
79905
 
79815
79906
  let prevone = [], nexttwo = [];
@@ -79861,7 +79952,7 @@ class Strand {
79861
79952
  }
79862
79953
 
79863
79954
  currentChain = atom.chain;
79864
- atom.resi;
79955
+ currentStyle = atom.style;
79865
79956
  ss = atom.ss;
79866
79957
  ssend = atom.ssend;
79867
79958
  prevAtomid = atom.serial;
@@ -88828,6 +88919,9 @@ class SetStyle {
88828
88919
  setBackground(color) {var ic = this.icn3d, me = ic.icn3dui;
88829
88920
 
88830
88921
  ic.setOptionCls.setOption('background', color);
88922
+ let exdays = 3650;
88923
+ me.htmlCls.setHtmlCls.setCookie('bkgdcolor', color, exdays);
88924
+
88831
88925
  me.htmlCls.clickMenuCls.setLogCmd('set background ' + color, true);
88832
88926
  //let titleColor =(color == 'black' || color == 'transparent') ? me.htmlCls.GREYD : 'black';
88833
88927
  let titleColor = (color == 'black') ? me.htmlCls.GREYD : 'black';
@@ -118275,16 +118369,18 @@ class ApplyCommand {
118275
118369
  }
118276
118370
  else if(command.indexOf('set background') == 0) {
118277
118371
  let value = command.substr(command.lastIndexOf(' ') + 1);
118278
- ic.opts['background'] = value;
118372
+ ic.setStyleCls.setBackground(value);
118279
118373
 
118280
- if(value == 'black') {
118281
- $("#" + ic.pre + "title").css("color", me.htmlCls.GREYD);
118282
- $("#" + ic.pre + "titlelink").css("color", me.htmlCls.GREYD);
118283
- }
118284
- else {
118285
- $("#" + ic.pre + "title").css("color", "black");
118286
- $("#" + ic.pre + "titlelink").css("color", "black");
118287
- }
118374
+ // ic.opts['background'] = value;
118375
+
118376
+ // if(value == 'black') {
118377
+ // $("#" + ic.pre + "title").css("color", me.htmlCls.GREYD);
118378
+ // $("#" + ic.pre + "titlelink").css("color", me.htmlCls.GREYD);
118379
+ // }
118380
+ // else {
118381
+ // $("#" + ic.pre + "title").css("color", "black");
118382
+ // $("#" + ic.pre + "titlelink").css("color", "black");
118383
+ // }
118288
118384
  }
118289
118385
  else if(command.indexOf('set label color') == 0) {
118290
118386
  ic.labelcolor = command.substr(command.lastIndexOf(' ') + 1);
@@ -119554,30 +119650,19 @@ class DefinedSets {
119554
119650
  }
119555
119651
 
119556
119652
  //Set the menu of defined sets with an array of defined names "commandnameArray".
119557
- setAtomMenu(commandnameArray) { let ic = this.icn3d; ic.icn3dui;
119653
+ setAtomMenu(commandnameArray, bNucleotide, bProtein) { let ic = this.icn3d; ic.icn3dui;
119558
119654
  let html = "";
119559
119655
  let nameArray1 =(ic.defNames2Residues !== undefined) ? Object.keys(ic.defNames2Residues) : [];
119560
119656
  let nameArray2 =(ic.defNames2Atoms !== undefined) ? Object.keys(ic.defNames2Atoms) : [];
119561
119657
 
119562
119658
  let nameArrayTmp = nameArray1.concat(nameArray2).sort();
119563
119659
  let nameArray = [];
119564
- // $.each(nameArrayTmp, function(i, el){
119565
- // if($.inArray(el, nameArray) === -1) nameArray.push(el);
119566
- // });
119660
+
119567
119661
  nameArrayTmp.forEach(elem => {
119568
119662
  if($.inArray(elem, nameArray) === -1) nameArray.push(elem);
119569
119663
  });
119570
119664
 
119571
- // let structureArray = Object.keys(me.utilsCls.getStructures(ic.dAtoms));
119572
-
119573
- // nameArrayTmp.forEach((elem) => {
119574
- // structureArray.forEach((structure) => {
119575
- // if (ic.defNames2Residues[elem] && ic.defNames2Residues[elem][0] && ic.defNames2Residues[elem][0].split("_")[0].includes(structure.split("_")[0])){
119576
- // if ($.inArray(elem, nameArray) === -1) nameArray.push(elem);
119577
- // }
119578
- // });
119579
- // });
119580
- //for(let i in ic.defNames2Atoms) {
119665
+ let bFoundNucleotide = false, bFoundProtein = false;
119581
119666
  for(let i = 0, il = nameArray.length; i < il; ++i) {
119582
119667
  let name = nameArray[i];
119583
119668
 
@@ -119600,13 +119685,38 @@ class DefinedSets {
119600
119685
  let colorStr =(atom === undefined || atom.color === undefined || atom.color.getHexString().toUpperCase() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
119601
119686
  let color =(atom !== undefined && atom.color !== undefined) ? colorStr : '000000';
119602
119687
 
119603
- if(commandnameArray.indexOf(name) != -1) {
119604
- html += "<option value='" + name + "' style='color:#" + color + "' selected='selected'>" + name + "</option>";
119688
+ if(bNucleotide) {
119689
+ // Handle nucleotide-specific logic
119690
+ if(ic.nucleotides.hasOwnProperty(atom.serial) && name != 'nucleotides' && !ic.structures.hasOwnProperty(name)) {
119691
+ html += "<option value='" + name + "' style='color:#" + color + "'>" + name + "</option>";
119692
+ bFoundNucleotide = true;
119693
+ }
119694
+ }
119695
+ else if(bProtein) {
119696
+ // Handle protein-specific logic
119697
+ if(ic.proteins.hasOwnProperty(atom.serial) && name != 'proteins' && !ic.structures.hasOwnProperty(name)) {
119698
+ html += "<option value='" + name + "' style='color:#" + color + "'>" + name + "</option>";
119699
+ bFoundProtein = true;
119700
+ }
119605
119701
  }
119606
119702
  else {
119607
- html += "<option value='" + name + "' style='color:#" + color + "'>" + name + "</option>";
119703
+ if(commandnameArray.indexOf(name) != -1) {
119704
+ html += "<option value='" + name + "' style='color:#" + color + "' selected='selected'>" + name + "</option>";
119705
+ }
119706
+ else {
119707
+ html += "<option value='" + name + "' style='color:#" + color + "'>" + name + "</option>";
119708
+ }
119608
119709
  }
119609
119710
  }
119711
+
119712
+ if(bNucleotide && !bFoundNucleotide) {
119713
+ html = "";
119714
+ }
119715
+
119716
+ if(bProtein && !bFoundProtein) {
119717
+ html = "";
119718
+ }
119719
+
119610
119720
  return html;
119611
119721
  }
119612
119722
 
@@ -119751,24 +119861,34 @@ class DefinedSets {
119751
119861
  ic.hlUpdateCls.updateHlMenus();
119752
119862
  }
119753
119863
 
119864
+ selectSets(nameArray) { let ic = this.icn3d, me = ic.icn3dui;
119865
+ ic.nameArray = nameArray;
119866
+
119867
+ if(nameArray !== null) {
119868
+ // log the selection
119869
+ //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.toString(), true);
119870
+
119871
+ let bUpdateHlMenus = false;
119872
+ this.changeCustomAtoms(nameArray, bUpdateHlMenus);
119873
+ //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119874
+ me.htmlCls.clickMenuCls.setLogCmd('select sets ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119875
+
119876
+ ic.bSelectResidue = false;
119877
+ }
119878
+ }
119879
+
119754
119880
  clickCustomAtoms() { let ic = this.icn3d, me = ic.icn3dui;
119755
119881
  let thisClass = this;
119756
119882
  //me.myEventCls.onIds("#" + ic.pre + "atomsCustom", "change", function(e) { let ic = thisClass.icn3d;
119757
- $("#" + ic.pre + "atomsCustom").change(function(e) { let ic = thisClass.icn3d;
119883
+ $("#" + ic.pre + "atomsCustom").change(function(e) { thisClass.icn3d;
119758
119884
  let nameArray = $(this).val();
119759
- ic.nameArray = nameArray;
119760
-
119761
- if(nameArray !== null) {
119762
- // log the selection
119763
- //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.toString(), true);
119764
-
119765
- let bUpdateHlMenus = false;
119766
- thisClass.changeCustomAtoms(nameArray, bUpdateHlMenus);
119767
- //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119768
- me.htmlCls.clickMenuCls.setLogCmd('select sets ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119885
+ thisClass.selectSets(nameArray);
119886
+ });
119769
119887
 
119770
- ic.bSelectResidue = false;
119771
- }
119888
+ me.myEventCls.onIds(["#" + ic.pre + "atomsCustomNucleotide", "#" + ic.pre + "atomsCustomProtein"], "change", function(e) { thisClass.icn3d;
119889
+ //$("#" + ic.pre + "atomsCustomNucleotide").change(function(e) { let ic = thisClass.icn3d;
119890
+ let chainid = $(this).val();
119891
+ thisClass.selectSets([chainid]);
119772
119892
  });
119773
119893
 
119774
119894
  me.myEventCls.onIds("#" + ic.pre + "atomsCustom", "focus", function(e) { let ic = thisClass.icn3d;
@@ -120729,6 +120849,22 @@ class LoadScript {
120729
120849
  await ic.cartoon2dCls.draw2Dcartoon(type);
120730
120850
  ic.bRender = false;
120731
120851
  }
120852
+ else if(command.indexOf('diagram 2d nucleotide') == 0) {
120853
+ let paraArray = command.split(' | ');
120854
+ let chainid = paraArray[1];
120855
+
120856
+ ic.bRender = true;
120857
+ await ic.diagram2dCls.drawR2dt(chainid);
120858
+ ic.bRender = false;
120859
+ }
120860
+ else if(command.indexOf('diagram 2d ig') == 0) {
120861
+ let paraArray = command.split(' | ');
120862
+ let chainid = paraArray[1];
120863
+
120864
+ ic.bRender = true;
120865
+ await ic.diagram2dCls.drawIgdgm(chainid);
120866
+ ic.bRender = false;
120867
+ }
120732
120868
  else if(command.indexOf('add msa track') == 0) {
120733
120869
  //add msa track | chainid " + chainid + " | startpos " + startpos + " | type " + type + " | fastaList " + fastaList
120734
120870
  let paraArray = command.split(' | ');
@@ -128262,6 +128398,118 @@ class Diagram2d {
128262
128398
 
128263
128399
  return html;
128264
128400
  }
128401
+
128402
+ async drawR2dt(chainid) { let ic = this.icn3d, me = ic.icn3dui;
128403
+ let url = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi?chainid2rnaid=" + chainid;
128404
+
128405
+ let data = await me.getAjaxPromise(url, 'jsonp');
128406
+
128407
+ let html = '';
128408
+ if(data && data.rnaid) {
128409
+ html += '<r2dt-web search=\'{"urs": "' + data.rnaid + '"}\' />';
128410
+ html += '<script type="text/javascript" src="https://rnacentral.github.io/r2dt-web/dist/r2dt-web.js"></script>';
128411
+ $("#" + me.pre + "2ddiagramDiv").html(html);
128412
+ me.htmlCls.dialogCls.openDlg('dl_2ddiagram', 'Show R2DT Diagram for chain ' + chainid);
128413
+ }
128414
+ else {
128415
+ var aaa = 1; //alert("No R2DT diagram can be found for chain " + chainid);
128416
+ }
128417
+ }
128418
+
128419
+ async drawIgdgm(chainid) { let ic = this.icn3d, me = ic.icn3dui;
128420
+ // select the current chain
128421
+ //ic.hAtoms = me.hashUtilsCls.cloneHash(ic.chains[chainid]);
128422
+
128423
+ // run ig detection
128424
+ ic.bRunRefnumAgain = true;
128425
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
128426
+ await ic.annotationCls.setAnnoTabIg(true);
128427
+ ic.bRunRefnumAgain = false;
128428
+
128429
+ if(!ic.chain2igArray) {
128430
+ var aaa = 1; //alert("No Ig domain was found for chain " + chainid);
128431
+ return;
128432
+ }
128433
+
128434
+ let igArray = ic.chain2igArray[chainid];
128435
+
128436
+ let igType = '', bFound = false;
128437
+ for(let i = 0, il = igArray.length; i < il; ++i) {
128438
+ let domainid = igArray[i].domainid;
128439
+ if(!ic.domainid2info) continue;
128440
+
128441
+ let info = ic.domainid2info[domainid];
128442
+ if(!info) continue;
128443
+
128444
+ igType = ic.ref2igtype[info.refpdbname];
128445
+
128446
+ if(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI') {
128447
+ bFound = true;
128448
+ break;
128449
+ }
128450
+ }
128451
+
128452
+ if(!bFound) {
128453
+ var aaa = 1; //alert("The Ig type for chain " + chainid + " is " + igType + ". Currently only IgV, IgC1, IgC2 and IgI types are supported for drawing Ig diagrams.");
128454
+ return;
128455
+ }
128456
+
128457
+ // get the hash of refnum to resn
128458
+ let refnum2resn = {};
128459
+ for(let resid in ic.resid2refnum) {
128460
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
128461
+ if(!atom) continue;
128462
+
128463
+ // let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
128464
+ let resn = me.utilsCls.residueName2Abbr(atom.resn);
128465
+
128466
+ let refnumStr, refnumLabel = ic.resid2refnum[resid];
128467
+
128468
+ if(refnumLabel) {
128469
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
128470
+ refnum2resn[refnumStr] = resn;
128471
+ }
128472
+ }
128473
+
128474
+ if(ic.bXlsx === undefined) {
128475
+ let urlScript = "/Structure/icn3d/script/exceljs.min.js";
128476
+ await me.getAjaxPromise(urlScript, 'script');
128477
+
128478
+ ic.bXlsx = true;
128479
+ }
128480
+
128481
+ let url = "/Structure/icn3d/template/igstrand_template_" + igType + ".xlsx";
128482
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', 'xlsx');
128483
+
128484
+ const workbook = new ExcelJS.Workbook();
128485
+ // Load the workbook from the buffer
128486
+ await workbook.xlsx.load(arrayBuffer);
128487
+ const worksheet = workbook.getWorksheet(1);
128488
+
128489
+ // Iterate over all rows that have values
128490
+ worksheet.eachRow({ includeEmpty: true }, (row, rowNumber) => {
128491
+ // Iterate over all cells in the row
128492
+ row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
128493
+ //console.log(`Cell [${rowNumber}, ${colNumber}] = ${cell.value}`);
128494
+ if (cell.value && !isNaN(cell.value) && cell.value > 1000 && cell.value < 10000) {
128495
+ if(refnum2resn.hasOwnProperty(cell.value)) {
128496
+ cell.value = refnum2resn[cell.value];
128497
+ }
128498
+ else {
128499
+ cell.value = '';
128500
+ }
128501
+ }
128502
+ });
128503
+ });
128504
+
128505
+ // Generate the workbook as a Buffer
128506
+ const data = await workbook.xlsx.writeBuffer();
128507
+
128508
+ // Access the underlying ArrayBuffer
128509
+ ic.saveFileCls.saveFile(ic.inputid + '_ig_diagram.xlsx', 'xlsx', data);
128510
+
128511
+ ic.drawCls.draw();
128512
+ }
128265
128513
  }
128266
128514
 
128267
128515
  /**
@@ -130221,7 +130469,12 @@ class SaveFile {
130221
130469
  //blob = new Blob([data],{ type: "application/octet-stream"});
130222
130470
  blob = new Blob(data,{ type: "application/octet-stream"});
130223
130471
  }
130472
+ else if(type === 'xlsx') {
130473
+ let data = text; // here text is an array of blobs
130224
130474
 
130475
+ //blob = new Blob([data],{ type: "application/octet-stream"});
130476
+ blob = new Blob([data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"} );
130477
+ }
130225
130478
  if(type !== 'png') {
130226
130479
  //https://github.com/eligrey/FileSaver.js/
130227
130480
  if(!bReturnBlobOnly) saveAs(blob, filename);
@@ -134524,7 +134777,7 @@ class iCn3DUI {
134524
134777
  //even when multiple iCn3D viewers are shown together.
134525
134778
  this.pre = this.cfg.divid + "_";
134526
134779
 
134527
- this.REVISION = '3.48.0';
134780
+ this.REVISION = '3.49.0';
134528
134781
 
134529
134782
  // In nodejs, iCn3D defines "window = {navigator: {}}", and added window = {navigator: {}, "__THREE__":"177"}
134530
134783
  this.bNode = (Object.keys(window).length < 3) ? true : false;