icn3d 3.48.1 → 3.49.1

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
 
@@ -119557,30 +119650,19 @@ class DefinedSets {
119557
119650
  }
119558
119651
 
119559
119652
  //Set the menu of defined sets with an array of defined names "commandnameArray".
119560
- setAtomMenu(commandnameArray) { let ic = this.icn3d; ic.icn3dui;
119653
+ setAtomMenu(commandnameArray, bNucleotide, bProtein) { let ic = this.icn3d; ic.icn3dui;
119561
119654
  let html = "";
119562
119655
  let nameArray1 =(ic.defNames2Residues !== undefined) ? Object.keys(ic.defNames2Residues) : [];
119563
119656
  let nameArray2 =(ic.defNames2Atoms !== undefined) ? Object.keys(ic.defNames2Atoms) : [];
119564
119657
 
119565
119658
  let nameArrayTmp = nameArray1.concat(nameArray2).sort();
119566
119659
  let nameArray = [];
119567
- // $.each(nameArrayTmp, function(i, el){
119568
- // if($.inArray(el, nameArray) === -1) nameArray.push(el);
119569
- // });
119660
+
119570
119661
  nameArrayTmp.forEach(elem => {
119571
119662
  if($.inArray(elem, nameArray) === -1) nameArray.push(elem);
119572
119663
  });
119573
119664
 
119574
- // let structureArray = Object.keys(me.utilsCls.getStructures(ic.dAtoms));
119575
-
119576
- // nameArrayTmp.forEach((elem) => {
119577
- // structureArray.forEach((structure) => {
119578
- // if (ic.defNames2Residues[elem] && ic.defNames2Residues[elem][0] && ic.defNames2Residues[elem][0].split("_")[0].includes(structure.split("_")[0])){
119579
- // if ($.inArray(elem, nameArray) === -1) nameArray.push(elem);
119580
- // }
119581
- // });
119582
- // });
119583
- //for(let i in ic.defNames2Atoms) {
119665
+ let bFoundNucleotide = false, bFoundProtein = false;
119584
119666
  for(let i = 0, il = nameArray.length; i < il; ++i) {
119585
119667
  let name = nameArray[i];
119586
119668
 
@@ -119603,13 +119685,38 @@ class DefinedSets {
119603
119685
  let colorStr =(atom === undefined || atom.color === undefined || atom.color.getHexString().toUpperCase() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
119604
119686
  let color =(atom !== undefined && atom.color !== undefined) ? colorStr : '000000';
119605
119687
 
119606
- if(commandnameArray.indexOf(name) != -1) {
119607
- html += "<option value='" + name + "' style='color:#" + color + "' selected='selected'>" + name + "</option>";
119688
+ if(bNucleotide && atom) {
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 && atom) {
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
+ }
119608
119701
  }
119609
119702
  else {
119610
- 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
+ }
119611
119709
  }
119612
119710
  }
119711
+
119712
+ if(bNucleotide && !bFoundNucleotide) {
119713
+ html = "";
119714
+ }
119715
+
119716
+ if(bProtein && !bFoundProtein) {
119717
+ html = "";
119718
+ }
119719
+
119613
119720
  return html;
119614
119721
  }
119615
119722
 
@@ -119754,24 +119861,34 @@ class DefinedSets {
119754
119861
  ic.hlUpdateCls.updateHlMenus();
119755
119862
  }
119756
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
+
119757
119880
  clickCustomAtoms() { let ic = this.icn3d, me = ic.icn3dui;
119758
119881
  let thisClass = this;
119759
119882
  //me.myEventCls.onIds("#" + ic.pre + "atomsCustom", "change", function(e) { let ic = thisClass.icn3d;
119760
- $("#" + ic.pre + "atomsCustom").change(function(e) { let ic = thisClass.icn3d;
119883
+ $("#" + ic.pre + "atomsCustom").change(function(e) { thisClass.icn3d;
119761
119884
  let nameArray = $(this).val();
119762
- ic.nameArray = nameArray;
119763
-
119764
- if(nameArray !== null) {
119765
- // log the selection
119766
- //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.toString(), true);
119767
-
119768
- let bUpdateHlMenus = false;
119769
- thisClass.changeCustomAtoms(nameArray, bUpdateHlMenus);
119770
- //me.htmlCls.clickMenuCls.setLogCmd('select saved atoms ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119771
- me.htmlCls.clickMenuCls.setLogCmd('select sets ' + nameArray.join(' ' + ic.setOperation + ' '), true);
119885
+ thisClass.selectSets(nameArray);
119886
+ });
119772
119887
 
119773
- ic.bSelectResidue = false;
119774
- }
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]);
119775
119892
  });
119776
119893
 
119777
119894
  me.myEventCls.onIds("#" + ic.pre + "atomsCustom", "focus", function(e) { let ic = thisClass.icn3d;
@@ -120732,6 +120849,22 @@ class LoadScript {
120732
120849
  await ic.cartoon2dCls.draw2Dcartoon(type);
120733
120850
  ic.bRender = false;
120734
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
+ }
120735
120868
  else if(command.indexOf('add msa track') == 0) {
120736
120869
  //add msa track | chainid " + chainid + " | startpos " + startpos + " | type " + type + " | fastaList " + fastaList
120737
120870
  let paraArray = command.split(' | ');
@@ -128265,6 +128398,141 @@ class Diagram2d {
128265
128398
 
128266
128399
  return html;
128267
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 igTypeArray = [], 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
+ let igType = ic.ref2igtype[info.refpdbname];
128445
+
128446
+ if(igType == 'IgV' || igType == 'IgC1' || igType == 'IgC2' || igType == 'IgI') {
128447
+ bFound = true;
128448
+ igTypeArray.push(igType);
128449
+ }
128450
+ else {
128451
+ igTypeArray.push('');
128452
+ }
128453
+ }
128454
+
128455
+ if(!bFound) {
128456
+ 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.");
128457
+ return;
128458
+ }
128459
+
128460
+ // get the hash of refnum to resn
128461
+ let refnum2resn = {};
128462
+ for(let resid in ic.resid2refnum) {
128463
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
128464
+ if(!atom) continue;
128465
+
128466
+ // let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
128467
+ let resn = me.utilsCls.residueName2Abbr(atom.resn);
128468
+
128469
+ let refnumStr, refnumLabel = ic.resid2refnum[resid];
128470
+ let domainid = ic.resid2domainid[resid];
128471
+
128472
+ if(refnumLabel) {
128473
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
128474
+ if(!refnum2resn[domainid]) refnum2resn[domainid] = {};
128475
+ refnum2resn[domainid][refnumStr] = resn;
128476
+ }
128477
+ }
128478
+
128479
+ if(ic.bXlsx === undefined) {
128480
+ let urlScript = "/Structure/icn3d/script/exceljs.min.js";
128481
+ await me.getAjaxPromise(urlScript, 'script');
128482
+
128483
+ ic.bXlsx = true;
128484
+ }
128485
+
128486
+ const mainWorkbook = new ExcelJS.Workbook();
128487
+
128488
+ for(let i = 0, il = igArray.length; i < il; ++i) {
128489
+ let domainid = igArray[i].domainid;
128490
+ let igType = igTypeArray[i];
128491
+ if(!igType) {
128492
+ mainWorkbook.addWorksheet(`Sheet_${i + 1}`);
128493
+ }
128494
+ else {
128495
+ let url = "/Structure/icn3d/template/igstrand_template_" + igType + ".xlsx";
128496
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', 'xlsx');
128497
+
128498
+ const workbook = new ExcelJS.Workbook();
128499
+ // Load the workbook from the buffer
128500
+ await workbook.xlsx.load(arrayBuffer);
128501
+ const worksheet = workbook.getWorksheet(1);
128502
+
128503
+ const newSheet = mainWorkbook.addWorksheet();
128504
+ // Clone the model to transfer styles and data
128505
+ newSheet.model = {
128506
+ ...worksheet.model,
128507
+ name: "Ig Domain " + (i + 1)
128508
+ };
128509
+
128510
+ // Iterate over all rows that have values
128511
+ newSheet.eachRow({ includeEmpty: true }, (row, rowNumber) => {
128512
+ // Iterate over all cells in the row
128513
+ row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
128514
+ //console.log(`Cell [${rowNumber}, ${colNumber}] = ${cell.value}`);
128515
+ if (cell.value && !isNaN(cell.value) && cell.value > 1000 && cell.value < 10000) {
128516
+ if(refnum2resn[domainid].hasOwnProperty(cell.value)) {
128517
+ cell.value = refnum2resn[domainid][cell.value];
128518
+ }
128519
+ else {
128520
+ cell.value = '';
128521
+ }
128522
+ }
128523
+ });
128524
+ });
128525
+ }
128526
+ }
128527
+
128528
+ // Generate the workbook as a Buffer
128529
+ const data = await mainWorkbook.xlsx.writeBuffer();
128530
+
128531
+ // Access the underlying ArrayBuffer
128532
+ ic.saveFileCls.saveFile(ic.inputid + '_ig_diagram.xlsx', 'xlsx', data);
128533
+
128534
+ ic.drawCls.draw();
128535
+ }
128268
128536
  }
128269
128537
 
128270
128538
  /**
@@ -130224,7 +130492,12 @@ class SaveFile {
130224
130492
  //blob = new Blob([data],{ type: "application/octet-stream"});
130225
130493
  blob = new Blob(data,{ type: "application/octet-stream"});
130226
130494
  }
130495
+ else if(type === 'xlsx') {
130496
+ let data = text; // here text is an array of blobs
130227
130497
 
130498
+ //blob = new Blob([data],{ type: "application/octet-stream"});
130499
+ blob = new Blob([data], {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"} );
130500
+ }
130228
130501
  if(type !== 'png') {
130229
130502
  //https://github.com/eligrey/FileSaver.js/
130230
130503
  if(!bReturnBlobOnly) saveAs(blob, filename);
@@ -134527,7 +134800,7 @@ class iCn3DUI {
134527
134800
  //even when multiple iCn3D viewers are shown together.
134528
134801
  this.pre = this.cfg.divid + "_";
134529
134802
 
134530
- this.REVISION = '3.48.1';
134803
+ this.REVISION = '1';
134531
134804
 
134532
134805
  // In nodejs, iCn3D defines "window = {navigator: {}}", and added window = {navigator: {}, "__THREE__":"177"}
134533
134806
  this.bNode = (Object.keys(window).length < 3) ? true : false;