icn3d 3.28.8 → 3.28.10

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.module.js CHANGED
@@ -5062,6 +5062,17 @@ class UtilsCls {
5062
5062
 
5063
5063
  return this.getStructures(atoms);
5064
5064
  }
5065
+
5066
+ getDateDigitStr() { this.icn3dui;
5067
+ let date = new Date();
5068
+ let monthStr =(date.getMonth() + 1).toString();
5069
+ if(date.getMonth() + 1 < 10) monthStr = '0' + monthStr;
5070
+
5071
+ let dateStr = date.getDate().toString();
5072
+ if(date.getDate() < 10) dateStr = '0' + dateStr;
5073
+
5074
+ return date.getFullYear().toString() + monthStr + dateStr;
5075
+ }
5065
5076
  }
5066
5077
 
5067
5078
  /**
@@ -8174,24 +8185,24 @@ class ClickMenu {
8174
8185
  thisClass.setLogCmd('setoption phisurface nothing', true);
8175
8186
  });
8176
8187
 
8177
- me.myEventCls.onIds("#" + me.pre + "applymap2fofc", "click", function(e) { let ic = me.icn3d;
8188
+ me.myEventCls.onIds("#" + me.pre + "applymap2fofc", "click", async function(e) { let ic = me.icn3d;
8178
8189
  e.preventDefault();
8179
8190
 
8180
8191
  //if(!me.cfg.notebook) dialog.dialog( "close" );
8181
8192
  let sigma2fofc = parseFloat($("#" + me.pre + "sigma2fofc" ).val());
8182
8193
  let type = '2fofc';
8183
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma2fofc);
8194
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma2fofc);
8184
8195
  //ic.setOptionCls.setOption('map', '2fofc');
8185
8196
  thisClass.setLogCmd('set map 2fofc sigma ' + sigma2fofc, true);
8186
8197
  });
8187
8198
 
8188
- me.myEventCls.onIds("#" + me.pre + "applymapfofc", "click", function(e) { let ic = me.icn3d;
8199
+ me.myEventCls.onIds("#" + me.pre + "applymapfofc", "click", async function(e) { let ic = me.icn3d;
8189
8200
  e.preventDefault();
8190
8201
 
8191
8202
  //if(!me.cfg.notebook) dialog.dialog( "close" );
8192
8203
  let sigmafofc = parseFloat($("#" + me.pre + "sigmafofc" ).val());
8193
8204
  let type = 'fofc';
8194
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigmafofc);
8205
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigmafofc);
8195
8206
  //ic.setOptionCls.setOption('map', 'fofc');
8196
8207
  thisClass.setLogCmd('set map fofc sigma ' + sigmafofc, true);
8197
8208
  });
@@ -8216,7 +8227,7 @@ class ClickMenu {
8216
8227
  thisClass.setLogCmd('setoption emmap nothing', true);
8217
8228
  });
8218
8229
 
8219
- me.myEventCls.onIds("#" + me.pre + "applyemmap", "click", function(e) { let ic = me.icn3d;
8230
+ me.myEventCls.onIds("#" + me.pre + "applyemmap", "click", async function(e) { let ic = me.icn3d;
8220
8231
  e.preventDefault();
8221
8232
 
8222
8233
  //if(!me.cfg.notebook) dialog.dialog( "close" );
@@ -8224,7 +8235,7 @@ class ClickMenu {
8224
8235
  let type = 'em';
8225
8236
  //ic.emd = 'emd-3906';
8226
8237
 
8227
- ic.densityCifParserCls.densityCifParser(ic.inputid, type, empercentage, ic.emd);
8238
+ await ic.densityCifParserCls.densityCifParser(ic.inputid, type, empercentage, ic.emd);
8228
8239
  thisClass.setLogCmd('set emmap percentage ' + empercentage, true);
8229
8240
  });
8230
8241
 
@@ -8272,6 +8283,18 @@ class ClickMenu {
8272
8283
  // }
8273
8284
  });
8274
8285
 
8286
+ me.myEventCls.onIds("#" + me.pre + "mn6_igrefTpl", "click", async function(e) { me.icn3d; //e.preventDefault();
8287
+ me.htmlCls.dialogCls.openDlg('dl_igrefTpl', 'Choose an Ig template');
8288
+ });
8289
+
8290
+ me.myEventCls.onIds("#" + me.pre + "mn6_igrefTpl_apply", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
8291
+ if(!me.cfg.notebook) dialog.dialog( "close" );
8292
+
8293
+ let template = $("#" + me.pre + "igrefTpl").val();
8294
+ thisClass.setLogCmd('ig template ' + template, true);
8295
+ await ic.refnumCls.showIgRefNum(template);
8296
+ });
8297
+
8275
8298
  me.myEventCls.onIds("#" + me.pre + "mn6_igrefNo", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
8276
8299
  thisClass.setLogCmd('ig refnum off', true);
8277
8300
  await ic.refnumCls.hideIgRefNum();
@@ -9525,14 +9548,14 @@ class SetMenu {
9525
9548
  }
9526
9549
 
9527
9550
  //!!!
9528
- /*
9551
+ /*
9529
9552
  html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
9530
9553
  html += "<ul>";
9531
9554
  html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
9532
9555
  html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
9533
9556
  html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
9534
9557
  html += "</ul>";
9535
- */
9558
+ */
9536
9559
 
9537
9560
  html += "<li><br/></li>";
9538
9561
 
@@ -10599,10 +10622,11 @@ class SetMenu {
10599
10622
  //!!!
10600
10623
  /*
10601
10624
  html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
10625
+ html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
10602
10626
  html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
10603
-
10604
- html += this.getMenuSep();
10605
10627
  */
10628
+ html += this.getMenuSep();
10629
+
10606
10630
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
10607
10631
  html += "</ul>";
10608
10632
  html += "</li>";
@@ -12704,6 +12728,31 @@ class SetDialog {
12704
12728
  html += this.addNotebookTitle('dl_disttable', 'Distance Table', true);
12705
12729
  html += "</div>";
12706
12730
 
12731
+ html += me.htmlCls.divStr + "dl_igrefTpl' class='" + dialogClass + "'>";
12732
+ html += this.addNotebookTitle('dl_igrefTpl', 'Choose an Ig template');
12733
+ html += "<span style='white-space:nowrap;font-weight:bold;'>Choose an Ig template for selected residues:</span> <br><br><select id='" + me.pre + "igrefTpl'>";
12734
+
12735
+ //html += me.htmlCls.setHtmlCls.getOptionHtml(['0', '10', '20', '30', '40', '50', '60', '70', '80', '90', '100'], 3);
12736
+ let group2tpl = {};
12737
+ group2tpl['V'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1', 'VNAR_1t6vN_shark_V', 'TCRa_6jxrm_human_V-n1', 'VISTA_6oilA_human_V', 'CD8a_1cd8A_human_V', 'PD1_4zqkB_human_V', 'ICOS_6x4gA_human_V', 'CD28_1yjdC_human_V', 'PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1', 'LAG3_7tzgD_human_V-n1'];
12738
+ group2tpl['C1'] = ['FAB-LIGHT_5esv_C1-n2', 'GHR_1axiB_human_FN3-n1', 'VTCN1_Q7Z7D3_human_V-n2', 'B2Microglobulin_7phrL_human_C1', 'FAB-HEAVY_5esv_C1-n2', 'MHCIa_7phrH_human_C1', 'TCRa_6jxrm_human_C1-n2'];
12739
+ group2tpl['C2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2', 'LAG3_7tzgD_human_C2-n2', 'Contactin1_3s97C_human_C2-n2'];
12740
+ group2tpl['Iset'] = ['BTLA_2aw2A_human_Iset', 'Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152', 'JAM1_1nbqA_human_VorIset-n2', 'CD19_6al5A_human_C2orV-n1'];
12741
+ group2tpl['FN3'] = ['InsulinR_8guyE_human_FN3-n1', 'IL6Rb_1bquB_human_FN3-n3', 'Sidekick2_1wf5A_human_FN3-n7', 'InsulinR_8guyE_human_FN3-n2', 'Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n2'];
12742
+ group2tpl['Other'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria', 'C3_2qkiD_human_n1', 'BArrestin1_4jqiA_rat_n1', 'RBPJ_6py8C_human_Unk-n1', 'CuZnSuperoxideDismutase_1hl5C_human', 'TEAD1_3kysC_human', 'ASF1A_2iijA_human', 'MPT63_1lmiA_bacteria', 'NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'LaminAC_1ifrA_human', 'IsdA_2iteA_bacteria'];
12743
+
12744
+ for(let group in group2tpl) {
12745
+ html += "<optgroup label='" + group + "'>";
12746
+ for(let i = 0, il = group2tpl[group].length; i < il; ++i) {
12747
+ let template = group2tpl[group][i];
12748
+ html += me.htmlCls.optionStr + "'" + template + "'>" + template + "</option>";
12749
+ }
12750
+ html += "</optgroup>";
12751
+ }
12752
+
12753
+ html += "</select><br><br><span style='white-space:nowrap;'>" + me.htmlCls.buttonStr + "mn6_igrefTpl_apply'>Show Ig Ref. Number</button></span>";
12754
+ html += "</div>";
12755
+
12707
12756
  html += "</div>";
12708
12757
  html += "<!--/form-->";
12709
12758
 
@@ -16523,7 +16572,7 @@ class SetHtml {
16523
16572
  if(postfix == 'style') {
16524
16573
  if(bReset) {
16525
16574
  $("#" + me.pre + "shininess").val('40');
16526
- $("#" + me.pre + "light1").val('0.6');
16575
+ $("#" + me.pre + "light1").val('0.8');
16527
16576
  $("#" + me.pre + "light2").val('0.4');
16528
16577
  $("#" + me.pre + "light3").val('0.2');
16529
16578
  $("#" + me.pre + "glycan").val('0');
@@ -18750,7 +18799,8 @@ function createDefaultMaterial( cache ) {
18750
18799
  roughness: 1,
18751
18800
  transparent: false,
18752
18801
  depthTest: true,
18753
- side: FrontSide
18802
+ side: FrontSide,
18803
+ //needsUpdate: true
18754
18804
  } );
18755
18805
 
18756
18806
  }
@@ -21677,7 +21727,7 @@ function findNodes( motionController, scene ) {
21677
21727
 
21678
21728
  // Attach a touch dot to the touchpad.
21679
21729
  const sphereGeometry = new SphereGeometry( 0.001 );
21680
- const material = new MeshBasicMaterial( { color: 0x0000FF } );
21730
+ const material = new MeshBasicMaterial( {color: 0x0000FF } );
21681
21731
  const sphere = new Mesh( sphereGeometry, material );
21682
21732
  component.touchPointNode.add( sphere );
21683
21733
 
@@ -22299,7 +22349,7 @@ class CanvasUI{
22299
22349
  if ( this.scene ){
22300
22350
  const radius = 0.015;
22301
22351
  const geometry = new THREE.IcosahedronBufferGeometry( radius );
22302
- const material = new THREE.MeshBasicMaterial( { color: 0x0000aa } );
22352
+ const material = new THREE.MeshBasicMaterial( {color: 0x0000aa } );
22303
22353
 
22304
22354
  const mesh1 = new THREE.Mesh( geometry, material );
22305
22355
  mesh1.visible = false;
@@ -24106,7 +24156,7 @@ class Box {
24106
24156
  specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24107
24157
  // }
24108
24158
  // else {
24109
- // mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({
24159
+ // mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({needsUpdate: true,
24110
24160
  // specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24111
24161
  // }
24112
24162
 
@@ -24567,18 +24617,18 @@ class Cylinder {
24567
24617
  else {
24568
24618
  if(bHighlight === 2) {
24569
24619
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
24570
- { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24620
+ {transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24571
24621
 
24572
24622
  radius *= 1.5;
24573
24623
  }
24574
24624
  //else if(bGlycan) {
24575
24625
  else {
24576
24626
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
24577
- { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24627
+ {transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24578
24628
  }
24579
24629
  // else {
24580
24630
  // mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
24581
- // { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24631
+ // {specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24582
24632
  // }
24583
24633
 
24584
24634
  mesh.position.copy(p0).add(p1).multiplyScalar(0.5);
@@ -24645,7 +24695,7 @@ class Cylinder {
24645
24695
  if(me.bNode) return;
24646
24696
 
24647
24697
  let mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
24648
- { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24698
+ {specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
24649
24699
 
24650
24700
  mesh.position.copy(p0).add(p1).multiplyScalar(0.5);
24651
24701
  mesh.matrixAutoUpdate = false;
@@ -24876,7 +24926,7 @@ class Line$1 {
24876
24926
  if(bHighlight === 1) ;
24877
24927
  else {
24878
24928
  line = new THREE.LineSegments(geo, new THREE.LineBasicMaterial(
24879
- { linewidth: ic.linewidth, vertexColors: true }));
24929
+ {linewidth: ic.linewidth, vertexColors: true }));
24880
24930
  ic.mdl.add(line);
24881
24931
  }
24882
24932
 
@@ -25009,7 +25059,7 @@ class Line$1 {
25009
25059
  let p2 = line.position2;
25010
25060
 
25011
25061
  let dashed = (line.dashed) ? line.dashed : false;
25012
- let dashSize = 0.3;
25062
+ let dashSize = (name == 'missingres') ? 0.8 : 0.3;
25013
25063
 
25014
25064
  let radius = (line.radius) ? line.radius : ic.lineRadius;
25015
25065
  let opacity = (line.opacity) ? line.opacity : 1.0;
@@ -27080,7 +27130,8 @@ class TextSprite {
27080
27130
  map: texture,
27081
27131
  //useScreenCoordinates: false,
27082
27132
  depthTest: !frontOfTarget,
27083
- depthWrite: !frontOfTarget
27133
+ depthWrite: !frontOfTarget,
27134
+ //needsUpdate: true
27084
27135
  } );
27085
27136
 
27086
27137
  //https://stackoverflow.com/questions/29421702/threejs-texture
@@ -28379,19 +28430,25 @@ ProteinSurface.prototype.initparm = function(extent, btype, in_bCalcArea, atomli
28379
28430
 
28380
28431
  // 2. If size > 90, change scale
28381
28432
  //var threshbox = 180; // maximum possible boxsize
28382
- if(this.bCalcArea || this.defaultScaleFactor * maxLen > this.threshbox) {
28433
+ //if(this.bCalcArea || this.defaultScaleFactor * maxLen > this.threshbox) {
28434
+ if(this.defaultScaleFactor * maxLen > this.threshbox) {
28383
28435
  boxLength = Math.floor(this.threshbox);
28384
28436
  this.scaleFactor =(this.threshbox - 1.0) / maxLen;
28385
28437
  }
28438
+
28439
+ // 3. use a fixed scaleFactor for surface area calculation
28440
+ if(this.bCalcArea) {
28441
+ this.scaleFactor = this.defaultScaleFactor;
28442
+ }
28386
28443
  // end of surface.js part
28387
28444
 
28388
28445
  this.pLength = Math.ceil(this.scaleFactor *(this.pmaxx - this.pminx)) + 1;
28389
28446
  this.pWidth = Math.ceil(this.scaleFactor *(this.pmaxy - this.pminy)) + 1;
28390
28447
  this.pHeight = Math.ceil(this.scaleFactor *(this.pmaxz - this.pminz)) + 1;
28391
28448
 
28392
- this.finalScaleFactor.x =(this.pLength - 1.0) /(this.pmaxx - this.pminx);
28393
- this.finalScaleFactor.y =(this.pWidth - 1.0) /(this.pmaxy - this.pminy);
28394
- this.finalScaleFactor.z =(this.pHeight - 1.0) /(this.pmaxz - this.pminz);
28449
+ // this.finalScaleFactor.x =(this.pLength - 1.0) /(this.pmaxx - this.pminx);
28450
+ // this.finalScaleFactor.y =(this.pWidth - 1.0) /(this.pmaxy - this.pminy);
28451
+ // this.finalScaleFactor.z =(this.pHeight - 1.0) /(this.pmaxz - this.pminz);
28395
28452
 
28396
28453
  this.boundingatom(btype);
28397
28454
  this.cutRadius = this.probeRadius * this.scaleFactor;
@@ -28505,9 +28562,13 @@ ProteinSurface.prototype.fillvoxels = function(atoms, atomlist) { //(int seqinit
28505
28562
  for(i = 0; i < this.pLength; ++i) {
28506
28563
  for(j = 0; j < this.pWidth; ++j) {
28507
28564
  for(k = 0; k < this.pHeight; ++k) {
28508
- let x = i / this.finalScaleFactor.x - this.ptranx;
28509
- let y = j / this.finalScaleFactor.y - this.ptrany;
28510
- let z = k / this.finalScaleFactor.z - this.ptranz;
28565
+ // let x = i / this.finalScaleFactor.x - this.ptranx;
28566
+ // let y = j / this.finalScaleFactor.y - this.ptrany;
28567
+ // let z = k / this.finalScaleFactor.z - this.ptranz;
28568
+
28569
+ let x = i / this.scaleFactor - this.ptranx;
28570
+ let y = j / this.scaleFactor - this.ptrany;
28571
+ let z = k / this.scaleFactor - this.ptranz;
28511
28572
 
28512
28573
  let r = new THREE.Vector3(x, y, z);
28513
28574
 
@@ -29137,7 +29198,7 @@ ProteinSurface.prototype.marchingcube = function(stype) {
29137
29198
  }
29138
29199
 
29139
29200
  // calculate surface area
29140
- let serial2area, maxScaleFactor, area = 0;
29201
+ let serial2area, area = 0;
29141
29202
  if(this.bCalcArea) {
29142
29203
  let faceHash = {};
29143
29204
  serial2area = {};
@@ -29207,14 +29268,15 @@ ProteinSurface.prototype.marchingcube = function(stype) {
29207
29268
  //}
29208
29269
  } // for loop
29209
29270
 
29210
- maxScaleFactor = Math.max(this.finalScaleFactor.x, this.finalScaleFactor.y, this.finalScaleFactor.z);
29211
- area = area / maxScaleFactor / maxScaleFactor;
29212
- //area = area / this.scaleFactor / this.scaleFactor;
29271
+ //maxScaleFactor = Math.max(this.finalScaleFactor.x, this.finalScaleFactor.y, this.finalScaleFactor.z);
29272
+ //area = area / maxScaleFactor / maxScaleFactor;
29273
+ area = area / this.scaleFactor / this.scaleFactor;
29213
29274
  }
29214
29275
 
29215
29276
  if(!this.bCalcArea) this.marchingCube.laplacianSmooth(1, this.verts, this.faces);
29216
29277
 
29217
- return {"area": area, "serial2area": serial2area, "scaleFactor": maxScaleFactor};
29278
+ //return {"area": area, "serial2area": serial2area, "scaleFactor": maxScaleFactor};
29279
+ return {"area": area, "serial2area": serial2area, "scaleFactor": this.scaleFactor};
29218
29280
  };
29219
29281
 
29220
29282
  /* ProteinSurface4.js
@@ -30194,7 +30256,8 @@ class Surface {
30194
30256
  wireframe: wireframe,
30195
30257
  opacity: opacity,
30196
30258
  transparent: true,
30197
- side: THREE.DoubleSide
30259
+ side: THREE.DoubleSide,
30260
+ //needsUpdate: true
30198
30261
  }));
30199
30262
 
30200
30263
  //http://www.html5gamedevs.com/topic/7288-threejs-transparency-bug-or-limitation-or-what/
@@ -30263,7 +30326,8 @@ class Surface {
30263
30326
  opacity: opacity,
30264
30327
  transparent: true,
30265
30328
  depthWrite: (parseInt(10*opacity) != 10) ? false : true, // important to make the transparency work
30266
- side: THREE.DoubleSide
30329
+ side: THREE.DoubleSide,
30330
+ //needsUpdate: true
30267
30331
  //depthTest: (ic.ic.transparentRenderOrder) ? false : true
30268
30332
  }));
30269
30333
 
@@ -32447,7 +32511,7 @@ class Impostor {
32447
32511
  fragmentShader: this.getShader(shaderName + ".frag"),
32448
32512
  depthTest: true,
32449
32513
  depthWrite: true,
32450
- //needsUpdate: true,
32514
+ //needsUpdate: true,
32451
32515
  lights: true
32452
32516
  });
32453
32517
 
@@ -33214,7 +33278,7 @@ class Instancing {
33214
33278
  fragmentShader: ic.impostorCls.getShader(name + ".frag"),
33215
33279
  depthTest: true,
33216
33280
  depthWrite: true,
33217
- //needsUpdate: true,
33281
+ //needsUpdate: true,
33218
33282
  lights: true
33219
33283
  });
33220
33284
 
@@ -33720,6 +33784,7 @@ class Alternate {
33720
33784
  if(ic.scene) {
33721
33785
  // https://github.com/gkjohnson/three-gpu-pathtracer/blob/main/example/basic.js
33722
33786
  ic.renderer.outputEncoding = THREE.sRGBEncoding;
33787
+ //ic.renderer.outputEncoding = THREE.LinearEncoding
33723
33788
 
33724
33789
  ic.renderer.render(ic.scene, cam);
33725
33790
  }
@@ -36857,9 +36922,9 @@ class SetOption {
36857
36922
 
36858
36923
  const name2color = {
36859
36924
  //"A- Strand": "FF00FF",
36860
- "A Strand": "663399",
36861
- //"A+ Strand": "663399", //"FFC0CB",
36862
- "A' Strand": "663399", //"9370db",
36925
+ "A Strand": "9400D3", //"663399",
36926
+ //"A+ Strand": "9400D3", //"663399",
36927
+ "A' Strand": "9400D3", //"663399",
36863
36928
  "B Strand": "ba55d3",
36864
36929
  "C Strand": "0000FF",
36865
36930
  "C' Strand": "6495ED",
@@ -44004,12 +44069,14 @@ class ShowSeq {
44004
44069
  html += '</div>';
44005
44070
  html3 += '</div></div>';
44006
44071
  }
44007
- else if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
44072
+
44073
+ if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
44008
44074
  let result = this.showAllRefNum(giSeq, chnid);
44009
44075
  html += result.html;
44010
44076
  html3 += result.html3;
44011
44077
  }
44012
- else if(ic.bShowCustomRefnum && ic.chainsMapping.hasOwnProperty(chnid)) {
44078
+
44079
+ if(ic.bShowCustomRefnum && ic.chainsMapping.hasOwnProperty(chnid)) {
44013
44080
  let bCustom = true;
44014
44081
  let result = this.showRefNum(giSeq, chnid, undefined, bCustom);
44015
44082
  html += result.html;
@@ -44019,7 +44086,8 @@ class ShowSeq {
44019
44086
 
44020
44087
  // highlight reference numbers
44021
44088
  if(ic.bShowRefnum) {
44022
- ic.hAtoms = ic.hAtomsRefnum;
44089
+ // comment out so that this process didn't change the selection
44090
+ //ic.hAtoms = ic.hAtomsRefnum;
44023
44091
 
44024
44092
  // commented out because it produced too many commands
44025
44093
  // let name = 'refnum_anchors';
@@ -44058,6 +44126,7 @@ class ShowSeq {
44058
44126
  ic.selectionCls.selectAll_base();
44059
44127
  ic.hlUpdateCls.updateHlAll();
44060
44128
  //ic.drawCls.draw();
44129
+ ic.drawCls.draw();
44061
44130
  }
44062
44131
 
44063
44132
  return {'html': html, 'html3': html3};
@@ -44133,7 +44202,10 @@ class ShowSeq {
44133
44202
 
44134
44203
  if(!bCustom && !kabat_or_imgt && !me.bNode) { // do not overwrite loops in node
44135
44204
  // reset ic.residIgLoop for the current selection, which could be the second round of ref num assignment
44136
- let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
44205
+ // just current chain
44206
+ let atomHash = me.hashUtilsCls.intHash(ic.chains[chnid], ic.hAtoms);
44207
+ let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(atomHash);
44208
+
44137
44209
  for(let resid in residHash) {
44138
44210
  // not in loop any more if you assign ref numbers multiple times
44139
44211
  delete ic.residIgLoop[resid];
@@ -44575,17 +44647,17 @@ class ShowSeq {
44575
44647
 
44576
44648
  getRefnumColor(currStrand, bText) { let ic = this.icn3d, me = ic.icn3dui;
44577
44649
  if(currStrand == "A-") {
44578
- return '#663399';
44650
+ return '#9400D3'; //'#663399';
44579
44651
  }
44580
44652
  else if(currStrand == "A") {
44581
- return '#663399';
44653
+ return '#9400D3'; //'#663399';
44582
44654
  }
44583
44655
  //else if(currStrand == "A*") {
44584
44656
  else if(currStrand == "A+") {
44585
- return '#663399'; //'#FFC0CB';
44657
+ return '#9400D3'; //'#663399';
44586
44658
  }
44587
44659
  else if(currStrand == "A'") {
44588
- return '#663399';
44660
+ return '#9400D3'; //'#663399';
44589
44661
  }
44590
44662
  else if(currStrand == "B") {
44591
44663
  return '#ba55d3';
@@ -46326,7 +46398,7 @@ class LineGraph {
46326
46398
  ic.hlUpdateCls.updateHlAll();
46327
46399
  }
46328
46400
 
46329
- async showIgRefNum() { let ic = this.icn3d, me = ic.icn3dui;
46401
+ async showIgRefNum(template) { let ic = this.icn3d, me = ic.icn3dui;
46330
46402
  let thisClass = this;
46331
46403
 
46332
46404
  // round 1, 16 templates
@@ -46410,9 +46482,14 @@ class LineGraph {
46410
46482
  }
46411
46483
 
46412
46484
  // try {
46413
- let allPromise = Promise.allSettled(pdbAjaxArray);
46414
- ic.pdbDataArray = await allPromise;
46415
- await thisClass.parseRefPdbData(ic.pdbDataArray);
46485
+ if(!template) {
46486
+ let allPromise = Promise.allSettled(pdbAjaxArray);
46487
+ ic.pdbDataArray = await allPromise;
46488
+ await thisClass.parseRefPdbData(ic.pdbDataArray, template);
46489
+ }
46490
+ else {
46491
+ await thisClass.parseRefPdbData(undefined, template);
46492
+ }
46416
46493
  // }
46417
46494
  // catch(err) {
46418
46495
  // if(!me.bNode) alert("Error in retrieveing reference PDB data...");
@@ -46420,7 +46497,7 @@ class LineGraph {
46420
46497
  // }
46421
46498
  }
46422
46499
 
46423
- async parseRefPdbData(dataArray) { let ic = this.icn3d, me = ic.icn3dui;
46500
+ async parseRefPdbData(dataArray, template) { let ic = this.icn3d, me = ic.icn3dui;
46424
46501
  let thisClass = this;
46425
46502
 
46426
46503
  let struArray = Object.keys(ic.structures);
@@ -46472,6 +46549,11 @@ class LineGraph {
46472
46549
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
46473
46550
  let resid = residueArray[n];
46474
46551
  ic.resid2domainid[resid] = chainid + '-0' + '_' + resiSum;
46552
+
46553
+ // clear previous refnum assignment if any
46554
+ if(ic.resid2refnum && ic.resid2refnum[resid]) {
46555
+ delete ic.resid2refnum[resid];
46556
+ }
46475
46557
  }
46476
46558
  }
46477
46559
  else {
@@ -46486,6 +46568,11 @@ class LineGraph {
46486
46568
  let resid = chainid + '_' + pos2resi[n];
46487
46569
  domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
46488
46570
  //ic.resid2domainid[resid] = chainid + '-' + k;
46571
+
46572
+ // clear previous refnum assignment if any
46573
+ if(ic.resid2refnum && ic.resid2refnum[resid]) {
46574
+ delete ic.resid2refnum[resid];
46575
+ }
46489
46576
  }
46490
46577
  }
46491
46578
 
@@ -46507,6 +46594,8 @@ class LineGraph {
46507
46594
  }
46508
46595
  }
46509
46596
 
46597
+ if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
46598
+
46510
46599
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
46511
46600
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
46512
46601
  let bForceOneDomain = true;
@@ -46520,56 +46609,107 @@ class LineGraph {
46520
46609
  let domainid = chainid + '-' + k + '_' + resiSum;
46521
46610
  ic.domainid2pdb[domainid] = pdb_target;
46522
46611
 
46523
- for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
46524
- // let struct2 = ic.defaultPdbId + index;
46525
- // let pdb_query = dataArray[index].value; //[0];
46526
- // let header = 'HEADER ' + struct2 + '\n';
46527
- // pdb_query = header + pdb_query;
46528
- let jsonStr_q = dataArray[index].value; //[0];
46612
+ if(!template) {
46613
+ for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
46614
+ // let struct2 = ic.defaultPdbId + index;
46615
+ // let pdb_query = dataArray[index].value; //[0];
46616
+ // let header = 'HEADER ' + struct2 + '\n';
46617
+ // pdb_query = header + pdb_query;
46618
+ let jsonStr_q = dataArray[index].value; //[0];
46529
46619
 
46530
- // TM-align is not good when you align a full structure with the strand-only structure. VAST is better in this case.
46531
- // let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]};
46532
- // let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
46620
+ // TM-align is not good when you align a full structure with the strand-only structure. VAST is better in this case.
46621
+ // let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]};
46622
+ // let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
46533
46623
 
46534
- let dataObj = {'domains1': jsonStr_q, 'domains2': jsonStr_t};
46535
- let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
46624
+ let dataObj = {'domains1': jsonStr_q, 'domains2': jsonStr_t};
46625
+ let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
46536
46626
 
46537
- ajaxArray.push(alignAjax);
46538
-
46539
- domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
46627
+ ajaxArray.push(alignAjax);
46628
+
46629
+ domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
46630
+ }
46631
+ }
46632
+ else {
46633
+ ic.domainid2refpdbname[domainid] = template;
46634
+ domainidpairArray.push(domainid + "|1" + template); // "1" was added for the first round strand-only template
46540
46635
  }
46541
46636
  }
46542
46637
  }
46543
46638
  }
46544
46639
 
46545
46640
  try {
46546
- let dataArray2 = [];
46641
+ if(!template) {
46642
+ let dataArray2 = [];
46547
46643
 
46548
- // let allPromise = Promise.allSettled(ajaxArray);
46549
- // dataArray2 = await allPromise;
46644
+ // let allPromise = Promise.allSettled(ajaxArray);
46645
+ // dataArray2 = await allPromise;
46550
46646
 
46551
- //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
46552
- let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
46647
+ //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
46648
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
46553
46649
 
46554
- for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
46555
- let currAjaxArray = [];
46556
- if(i == il - 1) { // last one
46557
- currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
46558
- }
46559
- else {
46560
- currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
46561
- }
46650
+ for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
46651
+ let currAjaxArray = [];
46652
+ if(i == il - 1) { // last one
46653
+ currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
46654
+ }
46655
+ else {
46656
+ currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
46657
+ }
46562
46658
 
46563
- let currPromise = Promise.allSettled(currAjaxArray);
46564
- let currDataArray = await currPromise;
46659
+ let currPromise = Promise.allSettled(currAjaxArray);
46660
+ let currDataArray = await currPromise;
46565
46661
 
46566
- dataArray2 = dataArray2.concat(currDataArray);
46662
+ dataArray2 = dataArray2.concat(currDataArray);
46663
+ }
46664
+
46665
+ let bRound1 = true;
46666
+ await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
46667
+
46668
+ /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
46567
46669
  }
46568
-
46569
- let bRound1 = true;
46570
- await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
46670
+ else {
46671
+ if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
46672
+
46673
+ // start round2
46674
+ let ajaxArray = [];
46675
+ let domainidpairArray3 = [];
46676
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
46677
+
46678
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + template;
46679
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
46680
+ let pdbAjaxArray = [];
46681
+ pdbAjaxArray.push(pdbAjax);
46571
46682
 
46572
- /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
46683
+ let allPromise2 = Promise.allSettled(pdbAjaxArray);
46684
+ ic.pdbDataArray = await allPromise2;
46685
+
46686
+ for(let domainid in ic.domainid2refpdbname) {
46687
+ let refpdbname = ic.domainid2refpdbname[domainid];
46688
+ let chainid = domainid.substr(0, domainid.indexOf('-'));
46689
+
46690
+ let pdb_target = ic.domainid2pdb[domainid];
46691
+ for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
46692
+ let struct2 = ic.defaultPdbId + index;
46693
+ let pdb_query = ic.pdbDataArray[index].value; //[0];
46694
+
46695
+ let header = 'HEADER ' + struct2 + '\n';
46696
+ pdb_query = header + pdb_query;
46697
+
46698
+ let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": template};
46699
+ let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
46700
+ ajaxArray.push(alignAjax);
46701
+
46702
+ //domainidpairArray3.push(domainid + "," + refpdbname);
46703
+ domainidpairArray3.push(domainid + "|" + template);
46704
+ }
46705
+ }
46706
+
46707
+ let dataArray3 = [];
46708
+ let allPromise = Promise.allSettled(ajaxArray);
46709
+ dataArray3 = await allPromise;
46710
+
46711
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3);
46712
+ }
46573
46713
  }
46574
46714
  catch(err) {
46575
46715
  let mess = "Some of " + ajaxArray.length + " TM-align alignments failed. Please select a chain or a subset to assing reference numbers to avoid overloading the server...";
@@ -46581,7 +46721,7 @@ class LineGraph {
46581
46721
  }
46582
46722
  //console.log("Error in aligning with TM-align...");
46583
46723
  return;
46584
- }
46724
+ }
46585
46725
  }
46586
46726
 
46587
46727
  getTemplateList(chainid) { let ic = this.icn3d; ic.icn3dui;
@@ -46691,7 +46831,7 @@ class LineGraph {
46691
46831
  //if(!(bBstrand && bCstrand && bEstrand && bFstrand && bGstrand)) continue;
46692
46832
  if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
46693
46833
  if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
46694
- if(ic.domainid2refpdbname[domainid]) delete ic.domainid2refpdbname[domainid];
46834
+ if(ic.domainid2refpdbname[domainid] == refpdbname) delete ic.domainid2refpdbname[domainid];
46695
46835
  continue;
46696
46836
  }
46697
46837
  }
@@ -46777,10 +46917,28 @@ class LineGraph {
46777
46917
  }
46778
46918
 
46779
46919
  let dataArray3 = [];
46780
- let allPromise = Promise.allSettled(ajaxArray);
46781
- dataArray3 = await allPromise;
46920
+ //let allPromise = Promise.allSettled(ajaxArray);
46921
+ //dataArray3 = await allPromise;
46922
+
46923
+ //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
46924
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
46925
+
46926
+ for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
46927
+ let currAjaxArray = [];
46928
+ if(i == il - 1) { // last one
46929
+ currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
46930
+ }
46931
+ else {
46932
+ currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
46933
+ }
46934
+
46935
+ let currPromise = Promise.allSettled(currAjaxArray);
46936
+ let currDataArray = await currPromise;
46937
+
46938
+ dataArray3 = dataArray3.concat(currDataArray);
46939
+ }
46782
46940
 
46783
- await thisClass.parseAlignData(dataArray3, domainidpairArray3);
46941
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3, false);
46784
46942
 
46785
46943
  // end of round 2
46786
46944
  return;
@@ -46811,6 +46969,7 @@ class LineGraph {
46811
46969
  if(!ic.chainsMapping) ic.chainsMapping = {};
46812
46970
 
46813
46971
  if(!ic.refPdbList) ic.refPdbList = [];
46972
+
46814
46973
  for(let chainid in chainid2segs) {
46815
46974
  let segArray = chainid2segs[chainid];
46816
46975
 
@@ -50977,15 +51136,15 @@ class Dsn6Parser {
50977
51136
  this.icn3d = icn3d;
50978
51137
  }
50979
51138
 
50980
- dsn6Parser(pdbid, type, sigma) { let ic = this.icn3d; ic.icn3dui;
51139
+ async dsn6Parser(pdbid, type, sigma) { let ic = this.icn3d; ic.icn3dui;
50981
51140
  // https://edmaps.rcsb.org/maps/1kq2_2fofc.dsn6
50982
51141
  // https://edmaps.rcsb.org/maps/1kq2_fofc.dsn6
50983
51142
 
50984
51143
  let url = "https://edmaps.rcsb.org/maps/" + pdbid.toLowerCase() + "_" + type + ".dsn6";
50985
- this.dsn6ParserBase(url, type, sigma);
51144
+ await this.dsn6ParserBase(url, type, sigma);
50986
51145
  }
50987
51146
 
50988
- dsn6ParserBase(url, type, sigma) { let ic = this.icn3d; ic.icn3dui;
51147
+ async dsn6ParserBase(url, type, sigma) { let ic = this.icn3d, me = ic.icn3dui;
50989
51148
  let thisClass = this;
50990
51149
 
50991
51150
  //https://stackoverflow.com/questions/33902299/using-jquery-ajax-to-download-a-binary-file
@@ -50998,37 +51157,17 @@ class Dsn6Parser {
50998
51157
  ic.setOptionCls.setOption('map', type);
50999
51158
  }
51000
51159
  else {
51001
- let oReq = new XMLHttpRequest();
51002
- oReq.open("GET", url, true);
51003
- oReq.responseType = "arraybuffer";
51004
-
51005
- oReq.onreadystatechange = function() {
51006
- if(this.readyState == 4) {
51007
- if(this.status == 200) {
51008
- let arrayBuffer = oReq.response;
51009
- thisClass.loadDsn6Data(arrayBuffer, type, sigma);
51010
-
51011
- if(type == '2fofc') {
51012
- ic.bAjax2fofc = true;
51013
- }
51014
- else if(type == 'fofc') {
51015
- ic.bAjaxfofc = true;
51016
- }
51017
-
51018
- ic.setOptionCls.setOption('map', type);
51019
- }
51020
- else {
51021
- alert("RCSB server has no corresponding eletron density map for this structure.");
51022
- }
51160
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', 'rcsbEdmaps');
51161
+ thisClass.loadDsn6Data(arrayBuffer, type, sigma);
51023
51162
 
51024
- /// if(ic.deferredMap !== undefined) ic.deferredMap.resolve();
51025
- }
51026
- else {
51027
- ic.ParserUtilsCls.showLoading();
51028
- }
51029
- };
51163
+ if(type == '2fofc') {
51164
+ ic.bAjax2fofc = true;
51165
+ }
51166
+ else if(type == 'fofc') {
51167
+ ic.bAjaxfofc = true;
51168
+ }
51030
51169
 
51031
- oReq.send();
51170
+ ic.setOptionCls.setOption('map', type);
51032
51171
  }
51033
51172
  }
51034
51173
 
@@ -51766,6 +51905,11 @@ class MmdbParser {
51766
51905
 
51767
51906
  let color =(molid2rescount[i].color === undefined) ? '#CCCCCC' : '#' +( '000000' + molid2rescount[i].color.toString( 16 ) ).slice( - 6 );
51768
51907
  let chainName =(molid2rescount[i].chain === undefined) ? '' : molid2rescount[i].chain.trim();
51908
+ // remove "_" in chain name
51909
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
51910
+ chainName = chainName.replace(/_/g, '');
51911
+ }
51912
+
51769
51913
  if(chainNameHash[chainName] === undefined) {
51770
51914
  chainNameHash[chainName] = 1;
51771
51915
  }
@@ -54022,7 +54166,7 @@ class DensityCifParser {
54022
54166
  this.icn3d = icn3d;
54023
54167
  }
54024
54168
 
54025
- densityCifParser(pdbid, type, sigma, emd) { let ic = this.icn3d, me = ic.icn3dui;
54169
+ async densityCifParser(pdbid, type, sigma, emd) { let ic = this.icn3d, me = ic.icn3dui;
54026
54170
  let thisClass = this;
54027
54171
 
54028
54172
  let url;
@@ -54052,46 +54196,21 @@ class DensityCifParser {
54052
54196
  ic.setOptionCls.setOption('emmap', type);
54053
54197
  }
54054
54198
  else {
54055
- let oReq = new XMLHttpRequest();
54056
- oReq.open("GET", url, true);
54057
- oReq.responseType = "arraybuffer";
54058
-
54059
- oReq.onreadystatechange = function() {
54060
- if (this.readyState == 4) {
54061
- if(this.status == 200) {
54062
- let arrayBuffer = oReq.response;
54199
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', type);
54063
54200
 
54064
- thisClass.parseChannels(arrayBuffer, type, sigma);
54065
-
54066
- if(type == '2fofc' || type == 'fofc') {
54067
- ic.bAjax2fofc = true;
54068
- ic.bAjaxfofc = true;
54069
-
54070
- ic.setOptionCls.setOption('map', type);
54071
- }
54072
- else if(type == 'em') {
54073
- ic.bAjaxEm = true;
54201
+ thisClass.parseChannels(arrayBuffer, type, sigma);
54074
54202
 
54075
- ic.setOptionCls.setOption('emmap', type);
54076
- }
54077
- }
54078
- else {
54079
- if(type == '2fofc' || type == 'fofc') {
54080
- alert("Density server at EBI has no corresponding electron density map for this structure.");
54081
- }
54082
- else if(type == 'em') {
54083
- alert("Density server at EBI has no corresponding EM density map for this structure.");
54084
- }
54085
- }
54203
+ if(type == '2fofc' || type == 'fofc') {
54204
+ ic.bAjax2fofc = true;
54205
+ ic.bAjaxfofc = true;
54086
54206
 
54087
- /// if(ic.deferredEmmap !== undefined) ic.deferredEmmap.resolve();
54088
- }
54089
- else {
54090
- ic.ParserUtilsCls.showLoading();
54091
- }
54092
- };
54207
+ ic.setOptionCls.setOption('map', type);
54208
+ }
54209
+ else if(type == 'em') {
54210
+ ic.bAjaxEm = true;
54093
54211
 
54094
- oReq.send();
54212
+ ic.setOptionCls.setOption('emmap', type);
54213
+ }
54095
54214
  }
54096
54215
  }
54097
54216
 
@@ -55143,13 +55262,10 @@ class ParserUtils {
55143
55262
 
55144
55263
  getMissingResidues(seqArray, type, chainid) { let ic = this.icn3d, me = ic.icn3dui;
55145
55264
  ic.chainsSeq[chainid] = [];
55146
-
55147
- // find the offset of MMDB sequence
55148
- let offset = 0;
55149
55265
  if(type === 'mmdbid' || type === 'align') {
55150
55266
  for(let i = 0, il = seqArray.length; i < il; ++i) {
55151
55267
  if(seqArray[i][0] != 0) {
55152
- offset = seqArray[i][0] - (i + 1);
55268
+ seqArray[i][0] - (i + 1);
55153
55269
  break;
55154
55270
  }
55155
55271
  }
@@ -55184,14 +55300,12 @@ class ParserUtils {
55184
55300
  resObject.resi = i + 1;
55185
55301
  }
55186
55302
  else {
55187
- //let offset =(ic.chainid2offset[chainid]) ? ic.chainid2offset[chainid] : 0;
55188
-
55189
- if(type === 'mmdbid' || type === 'align') {
55190
- resObject.resi =(seqArray[i][resiPos] == '0') ? i + 1 + offset : seqArray[i][resiPos];
55191
- }
55192
- else {
55303
+ //if(type === 'mmdbid' || type === 'align') {
55304
+ // resObject.resi =(seqArray[i][resiPos] == '0') ? i + 1 + offset : seqArray[i][resiPos];
55305
+ //}
55306
+ //else {
55193
55307
  resObject.resi =(seqArray[i][resiPos] == '0') ? parseInt(prevResi) + 1 : seqArray[i][resiPos];
55194
- }
55308
+ //}
55195
55309
  }
55196
55310
 
55197
55311
  //resObject.resi =(seqArray[i][resiPos] == '0') ? i + 1 + offset : seqArray[i][resiPos];
@@ -55976,6 +56090,12 @@ class LoadAtomData {
55976
56090
  if(Object.keys(data.moleculeInfor[molid]).length === 0) continue;
55977
56091
 
55978
56092
  let chain = data.moleculeInfor[molid].chain.trim();
56093
+
56094
+ // remove "_" in chain name
56095
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56096
+ chain = chain.replace(/_/g, '');
56097
+ }
56098
+
55979
56099
  let chainid = pdbidTmp + '_' + chain;
55980
56100
 
55981
56101
  if(chainHash.hasOwnProperty(chain)) {
@@ -56121,6 +56241,11 @@ class LoadAtomData {
56121
56241
 
56122
56242
  atm.chain = atm.chain.trim(); //.replace(/_/g, '');
56123
56243
 
56244
+ // remove "_" in chain name
56245
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
56246
+ atm.chain = atm.chain.replace(/_/g, '');
56247
+ }
56248
+
56124
56249
  // mmcif has pre-assigned structure in mmcifparser.cgi output
56125
56250
  if(type === 'mmdbid' || type === 'align') {
56126
56251
  atm.structure = mmdbId;
@@ -62249,10 +62374,14 @@ class LoadScript {
62249
62374
  let bFinalStep =(i === steps - 1) ? true : false;
62250
62375
 
62251
62376
  if(!ic.commands[i].trim()) continue;
62252
- if(!ic.atoms && ic.commands[i].indexOf('load') == -1) continue;
62377
+ let nAtoms = Object.keys(ic.atoms).length;
62378
+
62379
+ if(nAtoms == 0 && ic.commands[i].indexOf('load') == -1) continue;
62253
62380
 
62254
62381
  let strArray = ic.commands[i].split("|||");
62255
62382
  let command = strArray[0].trim();
62383
+
62384
+ if(ic.inputid) ic.bNotLoadStructure = true;
62256
62385
 
62257
62386
  if(command.indexOf('load') !== -1) {
62258
62387
  if(end === 0 && start === end) {
@@ -62341,6 +62470,10 @@ class LoadScript {
62341
62470
  else if(command.indexOf('ig refnum on') == 0 ) {
62342
62471
  await ic.refnumCls.showIgRefNum();
62343
62472
  }
62473
+ else if(command.indexOf('ig template') == 0 ) {
62474
+ let template = command.substr(command.lastIndexOf(' ') + 1);
62475
+ await ic.refnumCls.showIgRefNum(template);
62476
+ }
62344
62477
  else if(command.indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
62345
62478
  if(Object.keys(ic.proteins).length > 0) {
62346
62479
  thisClass.applyCommand3ddomain(strArray[0].trim());
@@ -62514,10 +62647,10 @@ class LoadScript {
62514
62647
  await thisClass.applyCommandLoad(lastCommand);
62515
62648
  }
62516
62649
  else if(lastCommand.indexOf('set map') !== -1 && lastCommand.indexOf('set map wireframe') === -1) {
62517
- thisClass.applyCommandMap(lastCommand);
62650
+ await thisClass.applyCommandMap(lastCommand);
62518
62651
  }
62519
62652
  else if(lastCommand.indexOf('set emmap') !== -1 && lastCommand.indexOf('set emmap wireframe') === -1) {
62520
- thisClass.applyCommandEmmap(lastCommand);
62653
+ await thisClass.applyCommandEmmap(lastCommand);
62521
62654
  }
62522
62655
  else if(lastCommand.indexOf('set phi') !== -1) {
62523
62656
  await ic.delphiCls.applyCommandPhi(lastCommand);
@@ -62787,7 +62920,7 @@ class LoadScript {
62787
62920
  }
62788
62921
 
62789
62922
  //Apply the command to show electron density map.
62790
- applyCommandMap(command) { let ic = this.icn3d; ic.icn3dui;
62923
+ async applyCommandMap(command) { let ic = this.icn3d; ic.icn3dui;
62791
62924
 
62792
62925
  // chain functions together
62793
62926
  // ic.deferredMap = $.Deferred(function() { let ic = thisClass.icn3d;
@@ -62803,10 +62936,10 @@ class LoadScript {
62803
62936
  let type = paraArray[0];
62804
62937
 
62805
62938
  if(urlArray.length == 2) {
62806
- ic.dsn6ParserCls.dsn6ParserBase(urlArray[1], type, sigma);
62939
+ await ic.dsn6ParserCls.dsn6ParserBase(urlArray[1], type, sigma);
62807
62940
  }
62808
62941
  else {
62809
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma);
62942
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma);
62810
62943
  }
62811
62944
  }
62812
62945
  // }); // end of me.deferred = $.Deferred(function() {
@@ -62815,7 +62948,7 @@ class LoadScript {
62815
62948
  }
62816
62949
 
62817
62950
  //Apply the command to show EM density map.
62818
- applyCommandEmmap(command) { let ic = this.icn3d; ic.icn3dui;
62951
+ async applyCommandEmmap(command) { let ic = this.icn3d; ic.icn3dui;
62819
62952
 
62820
62953
  // chain functions together
62821
62954
  // ic.deferredEmmap = $.Deferred(function() { let ic = thisClass.icn3d;
@@ -62826,7 +62959,7 @@ class LoadScript {
62826
62959
  let percentage = paraArray[1];
62827
62960
  let type = 'em';
62828
62961
 
62829
- ic.densityCifParserCls.densityCifParser(ic.inputid, type, percentage, ic.emd);
62962
+ await ic.densityCifParserCls.densityCifParser(ic.inputid, type, percentage, ic.emd);
62830
62963
  }
62831
62964
  // }); // end of me.deferred = $.Deferred(function() {
62832
62965
 
@@ -63158,7 +63291,7 @@ class SelectByCommand {
63158
63291
  // $1,2,3: Structure
63159
63292
  // .A,B,C: chain
63160
63293
  // :5-10,K,chemicals: residues, could be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
63161
- // :ref_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
63294
+ // :ref_1250,ref_anchors,ref_strands,ref_loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
63162
63295
  // @CA,C,C*: atoms
63163
63296
  // wild card * can be used to select all
63164
63297
  //var currHighlightAtoms = {}
@@ -64763,31 +64896,12 @@ class Delphi {
64763
64896
  this.icn3d = icn3d;
64764
64897
  }
64765
64898
 
64766
- CalcPhiUrl(gsize, salt, contour, bSurface, url) { let ic = this.icn3d; ic.icn3dui;
64899
+ async CalcPhiUrl(gsize, salt, contour, bSurface, url) { let ic = this.icn3d, me = ic.icn3dui;
64767
64900
  let thisClass = this;
64768
64901
 
64769
- let oReq = new XMLHttpRequest();
64770
- oReq.open("GET", url, true);
64771
-
64772
- oReq.responseType = "text";
64773
-
64774
- oReq.onreadystatechange = async function() {
64775
- if(this.readyState == 4) {
64776
- if(this.status == 200) {
64777
- let data = oReq.response;
64902
+ let data = await me.getXMLHttpRqstPromise(url, 'GET', 'text', 'PQR');
64778
64903
 
64779
- await thisClass.CalcPhi(gsize, salt, contour, bSurface, data);
64780
- }
64781
- else {
64782
- alert("The PQR file is unavailable...");
64783
- }
64784
- }
64785
- else {
64786
- ic.ParserUtilsCls.showLoading();
64787
- }
64788
- };
64789
-
64790
- oReq.send();
64904
+ await thisClass.CalcPhi(gsize, salt, contour, bSurface, data);
64791
64905
  }
64792
64906
 
64793
64907
  getPdbStr(bNode) { let ic = this.icn3d, me = ic.icn3dui;
@@ -64874,7 +64988,7 @@ class Delphi {
64874
64988
  }
64875
64989
 
64876
64990
  return new Promise(function(resolve, reject) {
64877
- // see full_ui.js for ajaxTransport
64991
+ // see icn3dui.js for ajaxTransport
64878
64992
  $.ajax({
64879
64993
  url: url,
64880
64994
  type: 'POST',
@@ -64898,7 +65012,7 @@ class Delphi {
64898
65012
  });
64899
65013
  }
64900
65014
 
64901
- PhiParser(url, type, contour, bSurface) { let ic = this.icn3d; ic.icn3dui;
65015
+ async PhiParser(url, type, contour, bSurface) { let ic = this.icn3d, me = ic.icn3dui;
64902
65016
  let thisClass = this;
64903
65017
  //var dataType;
64904
65018
 
@@ -64916,49 +65030,32 @@ class Delphi {
64916
65030
  }
64917
65031
  else {
64918
65032
  */
64919
- let oReq = new XMLHttpRequest();
64920
- oReq.open("GET", url, true);
64921
65033
 
65034
+ let responseType;
64922
65035
  if(type == 'phiurl' || type == 'phiurl2') {
64923
- oReq.responseType = "arraybuffer";
65036
+ responseType = "arraybuffer";
64924
65037
  }
64925
65038
  else {
64926
- oReq.responseType = "text";
65039
+ responseType = "text";
64927
65040
  }
64928
65041
 
64929
- oReq.onreadystatechange = function() {
64930
- if(this.readyState == 4) {
64931
- if(this.status == 200) {
64932
- let data = oReq.response;
65042
+ let data = await me.getXMLHttpRqstPromise(url, 'GET', responseType, 'potential');
64933
65043
 
64934
- if(type == 'phiurl' || type == 'phiurl2') {
64935
- thisClass.loadPhiData(data, contour, bSurface);
64936
- }
64937
- else {
64938
- thisClass.loadCubeData(data, contour, bSurface);
64939
- }
64940
-
64941
- ic.bAjaxPhi = true;
64942
-
64943
- if(bSurface) {
64944
- ic.setOptionCls.setOption('phisurface', 'phi');
64945
- }
64946
- else {
64947
- ic.setOptionCls.setOption('phimap', 'phi');
64948
- }
64949
- }
64950
- else {
64951
- alert("The potential file is unavailable...");
64952
- }
65044
+ if(type == 'phiurl' || type == 'phiurl2') {
65045
+ thisClass.loadPhiData(data, contour, bSurface);
65046
+ }
65047
+ else {
65048
+ thisClass.loadCubeData(data, contour, bSurface);
65049
+ }
64953
65050
 
64954
- /// if(ic.deferredPhi !== undefined) ic.deferredPhi.resolve();
64955
- }
64956
- else {
64957
- ic.ParserUtilsCls.showLoading();
64958
- }
64959
- };
65051
+ ic.bAjaxPhi = true;
64960
65052
 
64961
- oReq.send();
65053
+ if(bSurface) {
65054
+ ic.setOptionCls.setOption('phisurface', 'phi');
65055
+ }
65056
+ else {
65057
+ ic.setOptionCls.setOption('phimap', 'phi');
65058
+ }
64962
65059
  // }
64963
65060
  }
64964
65061
 
@@ -65136,7 +65233,7 @@ class Delphi {
65136
65233
  await thisClass.CalcPhiUrl(gsize, salt, contour, bSurface, url);
65137
65234
  }
65138
65235
  else {
65139
- thisClass.PhiParser(url, type, contour, bSurface);
65236
+ await thisClass.PhiParser(url, type, contour, bSurface);
65140
65237
  }
65141
65238
  // }); // end of me.deferred = $.Deferred(function() {
65142
65239
 
@@ -65315,7 +65412,7 @@ class Delphi {
65315
65412
  await this.CalcPhiUrl(gsize, salt, contour, bSurface, url);
65316
65413
  }
65317
65414
  else {
65318
- this.PhiParser(url, type, contour, bSurface);
65415
+ await this.PhiParser(url, type, contour, bSurface);
65319
65416
  }
65320
65417
 
65321
65418
  if(bSurface) {
@@ -70629,14 +70726,7 @@ class ShareLink {
70629
70726
  }
70630
70727
 
70631
70728
  // add time stamp
70632
- let date = new Date();
70633
- let monthStr =(date.getMonth() + 1).toString();
70634
- if(date.getMonth() + 1 < 10) monthStr = '0' + monthStr;
70635
-
70636
- let dateStr = date.getDate().toString();
70637
- if(date.getDate() < 10) dateStr = '0' + dateStr;
70638
-
70639
- let dateAllStr = date.getFullYear().toString() + monthStr + dateStr;
70729
+ let dateAllStr = me.utilsCls.getDateDigitStr();
70640
70730
  if(!bPrevDate) url += 'date=' + dateAllStr + '&';
70641
70731
  url += 'v=' + me.REVISION + '&';
70642
70732
 
@@ -73601,7 +73691,7 @@ class iCn3DUI {
73601
73691
  //even when multiple iCn3D viewers are shown together.
73602
73692
  this.pre = this.cfg.divid + "_";
73603
73693
 
73604
- this.REVISION = '3.28.2';
73694
+ this.REVISION = '3.28.3';
73605
73695
 
73606
73696
  // In nodejs, iCn3D defines "window = {navigator: {}}"
73607
73697
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -74122,6 +74212,44 @@ iCn3DUI.prototype.getMmtfReducedPromise = function(mmtfid) { return new Promi
74122
74212
  });
74123
74213
  };
74124
74214
 
74215
+ iCn3DUI.prototype.getXMLHttpRqstPromise = function(url, dataType, responseType, mapType) { let me = this;
74216
+ return new Promise(function(resolve, reject) {
74217
+ let oReq = new XMLHttpRequest();
74218
+ oReq.open(dataType, url, true);
74219
+ oReq.responseType = responseType;
74220
+
74221
+ oReq.onreadystatechange = function() {
74222
+ if (this.readyState == 4) {
74223
+ if(this.status == 200) {
74224
+ let arrayBuffer = oReq.response;
74225
+ resolve(arrayBuffer);
74226
+ }
74227
+ else {
74228
+ if(mapType == '2fofc' || mapType == 'fofc') {
74229
+ alert("Density server at EBI has no corresponding electron density map for this structure.");
74230
+ }
74231
+ else if(mapType == 'em') {
74232
+ alert("Density server at EBI has no corresponding EM density map for this structure.");
74233
+ }
74234
+ else if(mapType == 'rcsbEdmaps') {
74235
+ alert("RCSB server has no corresponding eletron density map for this structure.");
74236
+ }
74237
+ else {
74238
+ alert("The " + mapType + " file is unavailable...");
74239
+ }
74240
+
74241
+ reject('error');
74242
+ }
74243
+ }
74244
+ else {
74245
+ me.icn3d.ParserUtilsCls.showLoading();
74246
+ }
74247
+ };
74248
+
74249
+ oReq.send();
74250
+ });
74251
+ };
74252
+
74125
74253
  iCn3DUI.prototype.getAjaxPromise = function(url, dataType, beforeSend, alertMess, logMess, complete, bNode) { let me = this;
74126
74254
  // if(!bNode || dataType != 'json') {
74127
74255
  return new Promise(function(resolve, reject) {