icn3d 3.28.9 → 3.28.11

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
@@ -4161,6 +4161,17 @@ class UtilsCls {
4161
4161
 
4162
4162
  return this.getStructures(atoms);
4163
4163
  }
4164
+
4165
+ getDateDigitStr() { this.icn3dui;
4166
+ let date = new Date();
4167
+ let monthStr =(date.getMonth() + 1).toString();
4168
+ if(date.getMonth() + 1 < 10) monthStr = '0' + monthStr;
4169
+
4170
+ let dateStr = date.getDate().toString();
4171
+ if(date.getDate() < 10) dateStr = '0' + dateStr;
4172
+
4173
+ return date.getFullYear().toString() + monthStr + dateStr;
4174
+ }
4164
4175
  }
4165
4176
 
4166
4177
  /**
@@ -6458,7 +6469,7 @@ class ClickMenu {
6458
6469
  ic.resid2specCls.selectProperty('polar');
6459
6470
  });
6460
6471
  me.myEventCls.onIds("#" + me.pre + "mn2_propBfactor", "click", function(e) { me.icn3d; //e.preventDefault();
6461
- me.htmlCls.dialogCls.openDlg('dl_propbybfactor', 'Select residue based on B-factor');
6472
+ me.htmlCls.dialogCls.openDlg('dl_propbybfactor', 'Select residue based on B-factor/pLDDT');
6462
6473
  });
6463
6474
  me.myEventCls.onIds("#" + me.pre + "mn2_propSolAcc", "click", function(e) { me.icn3d; //e.preventDefault();
6464
6475
  me.htmlCls.dialogCls.openDlg('dl_propbypercentout', 'Select residue based on the percentage of solvent accessilbe surface area');
@@ -7273,24 +7284,24 @@ class ClickMenu {
7273
7284
  thisClass.setLogCmd('setoption phisurface nothing', true);
7274
7285
  });
7275
7286
 
7276
- me.myEventCls.onIds("#" + me.pre + "applymap2fofc", "click", function(e) { let ic = me.icn3d;
7287
+ me.myEventCls.onIds("#" + me.pre + "applymap2fofc", "click", async function(e) { let ic = me.icn3d;
7277
7288
  e.preventDefault();
7278
7289
 
7279
7290
  //if(!me.cfg.notebook) dialog.dialog( "close" );
7280
7291
  let sigma2fofc = parseFloat($("#" + me.pre + "sigma2fofc" ).val());
7281
7292
  let type = '2fofc';
7282
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma2fofc);
7293
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma2fofc);
7283
7294
  //ic.setOptionCls.setOption('map', '2fofc');
7284
7295
  thisClass.setLogCmd('set map 2fofc sigma ' + sigma2fofc, true);
7285
7296
  });
7286
7297
 
7287
- me.myEventCls.onIds("#" + me.pre + "applymapfofc", "click", function(e) { let ic = me.icn3d;
7298
+ me.myEventCls.onIds("#" + me.pre + "applymapfofc", "click", async function(e) { let ic = me.icn3d;
7288
7299
  e.preventDefault();
7289
7300
 
7290
7301
  //if(!me.cfg.notebook) dialog.dialog( "close" );
7291
7302
  let sigmafofc = parseFloat($("#" + me.pre + "sigmafofc" ).val());
7292
7303
  let type = 'fofc';
7293
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigmafofc);
7304
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigmafofc);
7294
7305
  //ic.setOptionCls.setOption('map', 'fofc');
7295
7306
  thisClass.setLogCmd('set map fofc sigma ' + sigmafofc, true);
7296
7307
  });
@@ -7315,7 +7326,7 @@ class ClickMenu {
7315
7326
  thisClass.setLogCmd('setoption emmap nothing', true);
7316
7327
  });
7317
7328
 
7318
- me.myEventCls.onIds("#" + me.pre + "applyemmap", "click", function(e) { let ic = me.icn3d;
7329
+ me.myEventCls.onIds("#" + me.pre + "applyemmap", "click", async function(e) { let ic = me.icn3d;
7319
7330
  e.preventDefault();
7320
7331
 
7321
7332
  //if(!me.cfg.notebook) dialog.dialog( "close" );
@@ -7323,7 +7334,7 @@ class ClickMenu {
7323
7334
  let type = 'em';
7324
7335
  //ic.emd = 'emd-3906';
7325
7336
 
7326
- ic.densityCifParserCls.densityCifParser(ic.inputid, type, empercentage, ic.emd);
7337
+ await ic.densityCifParserCls.densityCifParser(ic.inputid, type, empercentage, ic.emd);
7327
7338
  thisClass.setLogCmd('set emmap percentage ' + empercentage, true);
7328
7339
  });
7329
7340
 
@@ -7371,6 +7382,18 @@ class ClickMenu {
7371
7382
  // }
7372
7383
  });
7373
7384
 
7385
+ me.myEventCls.onIds("#" + me.pre + "mn6_igrefTpl", "click", async function(e) { me.icn3d; //e.preventDefault();
7386
+ me.htmlCls.dialogCls.openDlg('dl_igrefTpl', 'Choose an Ig template');
7387
+ });
7388
+
7389
+ me.myEventCls.onIds("#" + me.pre + "mn6_igrefTpl_apply", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
7390
+ if(!me.cfg.notebook) dialog.dialog( "close" );
7391
+
7392
+ let template = $("#" + me.pre + "igrefTpl").val();
7393
+ thisClass.setLogCmd('ig template ' + template, true);
7394
+ await ic.refnumCls.showIgRefNum(template);
7395
+ });
7396
+
7374
7397
  me.myEventCls.onIds("#" + me.pre + "mn6_igrefNo", "click", async function(e) { let ic = me.icn3d; //e.preventDefault();
7375
7398
  thisClass.setLogCmd('ig refnum off', true);
7376
7399
  await ic.refnumCls.hideIgRefNum();
@@ -7573,7 +7596,8 @@ class ClickMenu {
7573
7596
  // var aaa = 1; //alert("The url is more than 4000 characters and may not work.");
7574
7597
  //}
7575
7598
  //else {
7576
- url = url.replace("full.html", "full2.html");
7599
+ url = url.replace("icn3d/full.html?", "icn3d/full2.html?");
7600
+ url = url.replace("icn3d/?", "icn3d/full2.html?");
7577
7601
  url += '&closepopup=1';
7578
7602
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
7579
7603
  window.open(url, urlTarget);
@@ -7902,6 +7926,14 @@ class ClickMenu {
7902
7926
  let pos = str.indexOf('|||');
7903
7927
  if(pos !== -1) str = str.substr(0, pos);
7904
7928
  let transformation = {};
7929
+
7930
+ if(!ic.quaternion) {
7931
+ // reset parameters
7932
+ ic._zoomFactor = 1.0;
7933
+ ic.mouseChange = new THREE.Vector2(0,0);
7934
+ ic.quaternion = new THREE.Quaternion(0,0,0,1);
7935
+ }
7936
+
7905
7937
  transformation.factor = ic._zoomFactor;
7906
7938
  transformation.mouseChange = ic.mouseChange;
7907
7939
  transformation.quaternion = {};
@@ -8617,21 +8649,23 @@ class SetMenu {
8617
8649
 
8618
8650
  html += this.getLink('mn1_exportPdbRes', 'PDB', 1, 2);
8619
8651
  html += this.getLink('profixpdb', 'PDB with Missing Atoms', undefined, 2);
8620
- html += this.getLink('profixpdbh', 'PDB with Hydrogens', undefined, 2);
8652
+
8653
+ // the quality is not good to add hydrogen
8654
+ //html += this.getLink('profixpdbh', 'PDB with Hydrogens', undefined, 2);
8621
8655
 
8622
8656
  if(me.cfg.cid === undefined) {
8623
8657
  html += this.getLink('mn1_exportSecondary', 'Secondary Structure', undefined, 2);
8624
8658
  }
8625
8659
 
8626
8660
  //!!!
8627
- /*
8661
+ /*
8628
8662
  html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
8629
8663
  html += "<ul>";
8630
8664
  html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
8631
8665
  html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
8632
8666
  html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
8633
8667
  html += "</ul>";
8634
- */
8668
+ */
8635
8669
 
8636
8670
  html += "<li><br/></li>";
8637
8671
 
@@ -9468,7 +9502,7 @@ class SetMenu {
9468
9502
 
9469
9503
  //if(me.cfg.afid) html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'AF Confidence');
9470
9504
  //if(!me.cfg.mmtfid && !me.cfg.pdbid && !me.cfg.opmid && !me.cfg.mmdbid && !me.cfg.gi && !me.cfg.uniprotid && !me.cfg.blast_rep_id && !me.cfg.cid && !me.cfg.mmcifid && !me.cfg.align && !me.cfg.chainalign) {
9471
- html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'AlphaFold<br><span style="padding-left:1.5em;">Confidence</span>', undefined, 1, 1);
9505
+ html += this.getRadio('mn4_clr', 'mn4_clrConfidence', 'pLDDT', undefined, 1, 1);
9472
9506
  //}
9473
9507
 
9474
9508
  //!!!
@@ -9698,10 +9732,11 @@ class SetMenu {
9698
9732
  //!!!
9699
9733
  /*
9700
9734
  html += this.getLink('mn6_igrefYes', 'Show Ig Ref. Number', undefined, 2);
9735
+ html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
9701
9736
  html += this.getLink('mn6_igrefNo', 'Hide Ig Ref. Number', undefined, 2);
9702
-
9703
- html += this.getMenuSep();
9704
9737
  */
9738
+ html += this.getMenuSep();
9739
+
9705
9740
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
9706
9741
  html += "</ul>";
9707
9742
  html += "</li>";
@@ -11788,10 +11823,10 @@ class SetDialog {
11788
11823
  html += "</div>";
11789
11824
 
11790
11825
  html += me.htmlCls.divStr + "dl_propbybfactor' class='" + dialogClass + "'>";
11791
- html += this.addNotebookTitle('dl_propbybfactor', 'Select residues basen on B-factor');
11792
- html += "<div style='width:400px'>Select residue based on B-factor. The values are in the range of 0-100.</div><br>";
11793
- html += "<b>Min B-factor</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "minbfactor' value='0' size='10'>% <br>";
11794
- html += "<b>Max B-factor</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "maxbfactor' value='100' size='10'>% <br>";
11826
+ html += this.addNotebookTitle('dl_propbybfactor', 'Select residues basen on B-factor/pLDDT');
11827
+ html += "<div style='width:400px'>Select residue based on B-factor/pLDDT. The values are in the range of 0-100.</div><br>";
11828
+ html += "<b>Min B-factor/pLDDT</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "minbfactor' value='0' size='10'>% <br>";
11829
+ html += "<b>Max B-factor/pLDDT</b>: " + me.htmlCls.inputTextStr + "id='" + me.pre + "maxbfactor' value='100' size='10'>% <br>";
11795
11830
  html += "<button style='white-space:nowrap;' id='" + me.pre + "applypropbybfactor'>Apply</button><br/><br/>";
11796
11831
  html += "</div>";
11797
11832
 
@@ -11803,6 +11838,31 @@ class SetDialog {
11803
11838
  html += this.addNotebookTitle('dl_disttable', 'Distance Table', true);
11804
11839
  html += "</div>";
11805
11840
 
11841
+ html += me.htmlCls.divStr + "dl_igrefTpl' class='" + dialogClass + "'>";
11842
+ html += this.addNotebookTitle('dl_igrefTpl', 'Choose an Ig template');
11843
+ html += "<span style='white-space:nowrap;font-weight:bold;'>Choose an Ig template for selected residues:</span> <br><br><select id='" + me.pre + "igrefTpl'>";
11844
+
11845
+ //html += me.htmlCls.setHtmlCls.getOptionHtml(['0', '10', '20', '30', '40', '50', '60', '70', '80', '90', '100'], 3);
11846
+ let group2tpl = {};
11847
+ 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'];
11848
+ 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'];
11849
+ group2tpl['C2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2', 'LAG3_7tzgD_human_C2-n2', 'Contactin1_3s97C_human_C2-n2'];
11850
+ 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'];
11851
+ 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'];
11852
+ 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'];
11853
+
11854
+ for(let group in group2tpl) {
11855
+ html += "<optgroup label='" + group + "'>";
11856
+ for(let i = 0, il = group2tpl[group].length; i < il; ++i) {
11857
+ let template = group2tpl[group][i];
11858
+ html += me.htmlCls.optionStr + "'" + template + "'>" + template + "</option>";
11859
+ }
11860
+ html += "</optgroup>";
11861
+ }
11862
+
11863
+ html += "</select><br><br><span style='white-space:nowrap;'>" + me.htmlCls.buttonStr + "mn6_igrefTpl_apply'>Show Ig Ref. Number</button></span>";
11864
+ html += "</div>";
11865
+
11806
11866
  html += "</div>";
11807
11867
  html += "<!--/form-->";
11808
11868
 
@@ -15407,10 +15467,11 @@ class SetHtml {
15407
15467
 
15408
15468
  let pdbstr = '';
15409
15469
 
15410
- pdbstr += ic.saveFileCls.getAtomPDB(atomHash);
15470
+ let bMergeIntoOne = true;
15471
+ pdbstr += ic.saveFileCls.getAtomPDB(atomHash, undefined, undefined, undefined, undefined, undefined, bMergeIntoOne);
15411
15472
  pdbstr += ic.saveFileCls.getAtomPDB(ionHash, true, undefined, true);
15412
15473
 
15413
- let url = "https://www.ncbi.nlm.nih.gov/Structure/delphi/delphi.fcgi";
15474
+ let url = me.htmlCls.baseUrl + "delphi/delphi.cgi";
15414
15475
 
15415
15476
  let pdbid =(me.cfg.cid) ? me.cfg.cid : Object.keys(ic.structures).toString();
15416
15477
 
@@ -17849,7 +17910,8 @@ function createDefaultMaterial( cache ) {
17849
17910
  roughness: 1,
17850
17911
  transparent: false,
17851
17912
  depthTest: true,
17852
- side: FrontSide
17913
+ side: FrontSide,
17914
+ //needsUpdate: true
17853
17915
  } );
17854
17916
 
17855
17917
  }
@@ -20776,7 +20838,7 @@ function findNodes( motionController, scene ) {
20776
20838
 
20777
20839
  // Attach a touch dot to the touchpad.
20778
20840
  const sphereGeometry = new SphereGeometry( 0.001 );
20779
- const material = new MeshBasicMaterial( { color: 0x0000FF } );
20841
+ const material = new MeshBasicMaterial( {color: 0x0000FF } );
20780
20842
  const sphere = new Mesh( sphereGeometry, material );
20781
20843
  component.touchPointNode.add( sphere );
20782
20844
 
@@ -21398,7 +21460,7 @@ class CanvasUI{
21398
21460
  if ( this.scene ){
21399
21461
  const radius = 0.015;
21400
21462
  const geometry = new THREE.IcosahedronBufferGeometry( radius );
21401
- const material = new THREE.MeshBasicMaterial( { color: 0x0000aa } );
21463
+ const material = new THREE.MeshBasicMaterial( {color: 0x0000aa } );
21402
21464
 
21403
21465
  const mesh1 = new THREE.Mesh( geometry, material );
21404
21466
  mesh1.visible = false;
@@ -23205,7 +23267,7 @@ class Box {
23205
23267
  specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23206
23268
  // }
23207
23269
  // else {
23208
- // mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({
23270
+ // mesh = new THREE.Mesh(ic.boxGeometry, new THREE.MeshPhongMaterial({needsUpdate: true,
23209
23271
  // specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23210
23272
  // }
23211
23273
 
@@ -23666,18 +23728,18 @@ class Cylinder {
23666
23728
  else {
23667
23729
  if(bHighlight === 2) {
23668
23730
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
23669
- { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23731
+ {transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23670
23732
 
23671
23733
  radius *= 1.5;
23672
23734
  }
23673
23735
  //else if(bGlycan) {
23674
23736
  else {
23675
23737
  mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
23676
- { transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23738
+ {transparent: true, opacity: opacity, specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23677
23739
  }
23678
23740
  // else {
23679
23741
  // mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
23680
- // { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23742
+ // {specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23681
23743
  // }
23682
23744
 
23683
23745
  mesh.position.copy(p0).add(p1).multiplyScalar(0.5);
@@ -23744,7 +23806,7 @@ class Cylinder {
23744
23806
  if(me.bNode) return;
23745
23807
 
23746
23808
  let mesh = new THREE.Mesh(ic.cylinderGeometry, new THREE.MeshPhongMaterial(
23747
- { specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23809
+ {specular: ic.frac, shininess: ic.shininess, emissive: ic.emissive, color: color }));
23748
23810
 
23749
23811
  mesh.position.copy(p0).add(p1).multiplyScalar(0.5);
23750
23812
  mesh.matrixAutoUpdate = false;
@@ -23975,7 +24037,7 @@ class Line$1 {
23975
24037
  if(bHighlight === 1) ;
23976
24038
  else {
23977
24039
  line = new THREE.LineSegments(geo, new THREE.LineBasicMaterial(
23978
- { linewidth: ic.linewidth, vertexColors: true }));
24040
+ {linewidth: ic.linewidth, vertexColors: true }));
23979
24041
  ic.mdl.add(line);
23980
24042
  }
23981
24043
 
@@ -24108,7 +24170,7 @@ class Line$1 {
24108
24170
  let p2 = line.position2;
24109
24171
 
24110
24172
  let dashed = (line.dashed) ? line.dashed : false;
24111
- let dashSize = 0.3;
24173
+ let dashSize = (name == 'missingres') ? 0.8 : 0.3;
24112
24174
 
24113
24175
  let radius = (line.radius) ? line.radius : ic.lineRadius;
24114
24176
  let opacity = (line.opacity) ? line.opacity : 1.0;
@@ -26179,7 +26241,8 @@ class TextSprite {
26179
26241
  map: texture,
26180
26242
  //useScreenCoordinates: false,
26181
26243
  depthTest: !frontOfTarget,
26182
- depthWrite: !frontOfTarget
26244
+ depthWrite: !frontOfTarget,
26245
+ //needsUpdate: true
26183
26246
  } );
26184
26247
 
26185
26248
  //https://stackoverflow.com/questions/29421702/threejs-texture
@@ -27478,19 +27541,25 @@ ProteinSurface.prototype.initparm = function(extent, btype, in_bCalcArea, atomli
27478
27541
 
27479
27542
  // 2. If size > 90, change scale
27480
27543
  //var threshbox = 180; // maximum possible boxsize
27481
- if(this.bCalcArea || this.defaultScaleFactor * maxLen > this.threshbox) {
27544
+ //if(this.bCalcArea || this.defaultScaleFactor * maxLen > this.threshbox) {
27545
+ if(this.defaultScaleFactor * maxLen > this.threshbox) {
27482
27546
  boxLength = Math.floor(this.threshbox);
27483
27547
  this.scaleFactor =(this.threshbox - 1.0) / maxLen;
27484
27548
  }
27549
+
27550
+ // 3. use a fixed scaleFactor for surface area calculation
27551
+ if(this.bCalcArea) {
27552
+ this.scaleFactor = this.defaultScaleFactor;
27553
+ }
27485
27554
  // end of surface.js part
27486
27555
 
27487
27556
  this.pLength = Math.ceil(this.scaleFactor *(this.pmaxx - this.pminx)) + 1;
27488
27557
  this.pWidth = Math.ceil(this.scaleFactor *(this.pmaxy - this.pminy)) + 1;
27489
27558
  this.pHeight = Math.ceil(this.scaleFactor *(this.pmaxz - this.pminz)) + 1;
27490
27559
 
27491
- this.finalScaleFactor.x =(this.pLength - 1.0) /(this.pmaxx - this.pminx);
27492
- this.finalScaleFactor.y =(this.pWidth - 1.0) /(this.pmaxy - this.pminy);
27493
- this.finalScaleFactor.z =(this.pHeight - 1.0) /(this.pmaxz - this.pminz);
27560
+ // this.finalScaleFactor.x =(this.pLength - 1.0) /(this.pmaxx - this.pminx);
27561
+ // this.finalScaleFactor.y =(this.pWidth - 1.0) /(this.pmaxy - this.pminy);
27562
+ // this.finalScaleFactor.z =(this.pHeight - 1.0) /(this.pmaxz - this.pminz);
27494
27563
 
27495
27564
  this.boundingatom(btype);
27496
27565
  this.cutRadius = this.probeRadius * this.scaleFactor;
@@ -27604,9 +27673,13 @@ ProteinSurface.prototype.fillvoxels = function(atoms, atomlist) { //(int seqinit
27604
27673
  for(i = 0; i < this.pLength; ++i) {
27605
27674
  for(j = 0; j < this.pWidth; ++j) {
27606
27675
  for(k = 0; k < this.pHeight; ++k) {
27607
- let x = i / this.finalScaleFactor.x - this.ptranx;
27608
- let y = j / this.finalScaleFactor.y - this.ptrany;
27609
- let z = k / this.finalScaleFactor.z - this.ptranz;
27676
+ // let x = i / this.finalScaleFactor.x - this.ptranx;
27677
+ // let y = j / this.finalScaleFactor.y - this.ptrany;
27678
+ // let z = k / this.finalScaleFactor.z - this.ptranz;
27679
+
27680
+ let x = i / this.scaleFactor - this.ptranx;
27681
+ let y = j / this.scaleFactor - this.ptrany;
27682
+ let z = k / this.scaleFactor - this.ptranz;
27610
27683
 
27611
27684
  let r = new THREE.Vector3(x, y, z);
27612
27685
 
@@ -28236,7 +28309,7 @@ ProteinSurface.prototype.marchingcube = function(stype) {
28236
28309
  }
28237
28310
 
28238
28311
  // calculate surface area
28239
- let serial2area, maxScaleFactor, area = 0;
28312
+ let serial2area, area = 0;
28240
28313
  if(this.bCalcArea) {
28241
28314
  let faceHash = {};
28242
28315
  serial2area = {};
@@ -28306,14 +28379,15 @@ ProteinSurface.prototype.marchingcube = function(stype) {
28306
28379
  //}
28307
28380
  } // for loop
28308
28381
 
28309
- maxScaleFactor = Math.max(this.finalScaleFactor.x, this.finalScaleFactor.y, this.finalScaleFactor.z);
28310
- area = area / maxScaleFactor / maxScaleFactor;
28311
- //area = area / this.scaleFactor / this.scaleFactor;
28382
+ //maxScaleFactor = Math.max(this.finalScaleFactor.x, this.finalScaleFactor.y, this.finalScaleFactor.z);
28383
+ //area = area / maxScaleFactor / maxScaleFactor;
28384
+ area = area / this.scaleFactor / this.scaleFactor;
28312
28385
  }
28313
28386
 
28314
28387
  if(!this.bCalcArea) this.marchingCube.laplacianSmooth(1, this.verts, this.faces);
28315
28388
 
28316
- return {"area": area, "serial2area": serial2area, "scaleFactor": maxScaleFactor};
28389
+ //return {"area": area, "serial2area": serial2area, "scaleFactor": maxScaleFactor};
28390
+ return {"area": area, "serial2area": serial2area, "scaleFactor": this.scaleFactor};
28317
28391
  };
28318
28392
 
28319
28393
  /* ProteinSurface4.js
@@ -29293,7 +29367,8 @@ class Surface {
29293
29367
  wireframe: wireframe,
29294
29368
  opacity: opacity,
29295
29369
  transparent: true,
29296
- side: THREE.DoubleSide
29370
+ side: THREE.DoubleSide,
29371
+ //needsUpdate: true
29297
29372
  }));
29298
29373
 
29299
29374
  //http://www.html5gamedevs.com/topic/7288-threejs-transparency-bug-or-limitation-or-what/
@@ -29362,7 +29437,8 @@ class Surface {
29362
29437
  opacity: opacity,
29363
29438
  transparent: true,
29364
29439
  depthWrite: (parseInt(10*opacity) != 10) ? false : true, // important to make the transparency work
29365
- side: THREE.DoubleSide
29440
+ side: THREE.DoubleSide,
29441
+ //needsUpdate: true
29366
29442
  //depthTest: (ic.ic.transparentRenderOrder) ? false : true
29367
29443
  }));
29368
29444
 
@@ -31546,7 +31622,7 @@ class Impostor {
31546
31622
  fragmentShader: this.getShader(shaderName + ".frag"),
31547
31623
  depthTest: true,
31548
31624
  depthWrite: true,
31549
- //needsUpdate: true,
31625
+ //needsUpdate: true,
31550
31626
  lights: true
31551
31627
  });
31552
31628
 
@@ -32313,7 +32389,7 @@ class Instancing {
32313
32389
  fragmentShader: ic.impostorCls.getShader(name + ".frag"),
32314
32390
  depthTest: true,
32315
32391
  depthWrite: true,
32316
- //needsUpdate: true,
32392
+ //needsUpdate: true,
32317
32393
  lights: true
32318
32394
  });
32319
32395
 
@@ -32436,7 +32512,7 @@ class Alternate {
32436
32512
  // change the display atom when alternating
32437
32513
  //Show structures one by one.
32438
32514
  alternateStructures() { let ic = this.icn3d, me = ic.icn3dui;
32439
- ic.bAlernate = true;
32515
+ ic.bAlternate = true;
32440
32516
 
32441
32517
  //ic.transformCls.zoominSelection();
32442
32518
 
@@ -32533,14 +32609,14 @@ class Alternate {
32533
32609
  ic.applyMapCls.removeEmmaps();
32534
32610
  ic.applyMapCls.applyEmmapOptions();
32535
32611
 
32536
- // disallow the alternation of DelPhi map
32612
+ // allow the alternation of DelPhi map
32537
32613
  ic.applyMapCls.removePhimaps();
32538
- // ic.applyMapCls.applyPhimapOptions();
32614
+ ic.applyMapCls.applyPhimapOptions();
32539
32615
  // should recalculate the potential
32540
32616
  //ic.loadDelphiFileBase('delphi');
32541
32617
 
32542
- // ic.applyMapCls.removeSurfaces();
32543
- // ic.applyMapCls.applyphisurfaceOptions();
32618
+ ic.applyMapCls.removeSurfaces();
32619
+ ic.applyMapCls.applyphisurfaceOptions();
32544
32620
  // should recalculate the potential
32545
32621
  //ic.loadDelphiFileBase('delphi2');
32546
32622
 
@@ -32819,6 +32895,7 @@ class Alternate {
32819
32895
  if(ic.scene) {
32820
32896
  // https://github.com/gkjohnson/three-gpu-pathtracer/blob/main/example/basic.js
32821
32897
  ic.renderer.outputEncoding = THREE.sRGBEncoding;
32898
+ //ic.renderer.outputEncoding = THREE.LinearEncoding
32822
32899
 
32823
32900
  ic.renderer.render(ic.scene, cam);
32824
32901
  }
@@ -35669,7 +35746,7 @@ class SetOption {
35669
35746
 
35670
35747
  let colorLabel = colorType.substr(0, 1).toUpperCase() + colorType.substr(1);
35671
35748
  if(colorType == 'confidence') {
35672
- colorLabel = 'AlphaFold Confidence (pLDDT)';
35749
+ colorLabel = 'pLDDT';
35673
35750
  }
35674
35751
  else if(colorType == 'normalized hydrophobic') {
35675
35752
  colorLabel = 'Normalized Hydrophobicity';
@@ -35956,15 +36033,15 @@ class SetOption {
35956
36033
 
35957
36034
  const name2color = {
35958
36035
  //"A- Strand": "FF00FF",
35959
- "A Strand": "663399",
35960
- //"A+ Strand": "663399", //"FFC0CB",
35961
- "A' Strand": "663399", //"9370db",
36036
+ "A Strand": "9400D3", //"663399",
36037
+ //"A+ Strand": "9400D3", //"663399",
36038
+ "A' Strand": "9400D3", //"663399",
35962
36039
  "B Strand": "ba55d3",
35963
36040
  "C Strand": "0000FF",
35964
36041
  "C' Strand": "6495ED",
35965
36042
  "C'' Strand": "006400",
35966
36043
  "D Strand": "00FF00",
35967
- "E Strand": "FFFF00", //"F0E68C",
36044
+ "E Strand": "F7DC6F", //"FFFF00", //"F0E68C",
35968
36045
  "F Strand": "FFA500",
35969
36046
  "G Strand": "FF0000",
35970
36047
  //"G+ Strand": "8B0000",
@@ -35992,14 +36069,14 @@ class SetOption {
35992
36069
  "<b>Protodomain 1</b>": "",
35993
36070
  "A Strand": "0000FF",
35994
36071
  "B Strand": "006400",
35995
- "C Strand": "FFFF00", //"F0E68C",
36072
+ "C Strand": "F7DC6F", //"FFFF00", //"F0E68C",
35996
36073
  "C' Strand": "FFA500",
35997
36074
  "<br><b>Linker</b>": "",
35998
36075
  "C'' Strand": "FF0000",
35999
36076
  "<br><b>Protodomain 2</b>": "",
36000
36077
  "D Strand": "0000FF",
36001
36078
  "E Strand": "006400",
36002
- "F Strand": "FFFF00", //"F0E68C",
36079
+ "F Strand": "F7DC6F", //"FFFF00", //"F0E68C",
36003
36080
  "G Strand": "FFA500",
36004
36081
  "": "",
36005
36082
  "Loop": "CCCCCC"
@@ -42159,7 +42236,7 @@ class ShowAnno {
42159
42236
  let proteinName = fullProteinName;
42160
42237
  //if(proteinName.length > 40) proteinName = proteinName.substr(0, 40) + "...";
42161
42238
  let categoryStr =(index == 0) ? "<span class='icn3d-annoLargeTitle'><b>Proteins</b>: </span><br><br>" : "";
42162
- let geneLink =(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneId) ? "(Gene: <a href='https://www.ncbi.nlm.nih.gov/gene/" + ic.chainsGene[chnid].geneId + "?report=gene_table' target='_blank' title='" + ic.chainsGene[chnid].geneDesc + "'>" + ic.chainsGene[chnid].geneSymbol + "</a>)" : '';
42239
+ let geneLink =(ic.chainsGene[chnid] && ic.chainsGene[chnid].geneId && ic.chainsGene[chnid].geneDesc) ? "(Gene: <a href='https://www.ncbi.nlm.nih.gov/gene/" + ic.chainsGene[chnid].geneId + "?report=gene_table' target='_blank' title='" + ic.chainsGene[chnid].geneDesc + "'>" + ic.chainsGene[chnid].geneSymbol + "</a>)" : '';
42163
42240
  let structure = chnid.substr(0, chnid.indexOf('_'));
42164
42241
  let chainLink = (structure.length > 5) ? '<a href="https://alphafold.ebi.ac.uk/entry/' + structure + '" target="_blank">' + chnid + '</a>' : chnid;
42165
42242
  let chainHtml = "<div id='" + ic.pre + "anno_" + chnid + "' class='icn3d-annotation'>" + categoryStr
@@ -42836,7 +42913,7 @@ class ShowSeq {
42836
42913
  html += '<span>-</span>'; //'<span>-</span>';
42837
42914
  }
42838
42915
  }
42839
-
42916
+
42840
42917
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += this.insertMulGap(ic.seqEndLen[chnid], '-');
42841
42918
 
42842
42919
  html += '<span class="icn3d-residueNum"></span>';
@@ -43055,7 +43132,7 @@ class ShowSeq {
43055
43132
  html += '</div>';
43056
43133
  html2 += '</div>';
43057
43134
  html3 += '</div>';
43058
-
43135
+
43059
43136
  //if(Object.keys(ic.chains[chnid]).length > 10) {
43060
43137
  if(ic.giSeq[chnid].length > 10) {
43061
43138
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.chains[chnid]);
@@ -43103,27 +43180,31 @@ class ShowSeq {
43103
43180
  html += '</div>';
43104
43181
  html3 += '</div></div>';
43105
43182
  }
43106
- else if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
43183
+
43184
+ if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
43107
43185
  let result = this.showAllRefNum(giSeq, chnid);
43186
+
43108
43187
  html += result.html;
43109
43188
  html3 += result.html3;
43110
43189
  }
43111
- else if(ic.bShowCustomRefnum && ic.chainsMapping.hasOwnProperty(chnid)) {
43190
+
43191
+ if(ic.bShowCustomRefnum && ic.chainsMapping.hasOwnProperty(chnid)) {
43112
43192
  let bCustom = true;
43113
43193
  let result = this.showRefNum(giSeq, chnid, undefined, bCustom);
43114
43194
  html += result.html;
43115
43195
  html3 += result.html3;
43116
43196
  }
43117
43197
  }
43118
-
43198
+
43119
43199
  // highlight reference numbers
43120
43200
  if(ic.bShowRefnum) {
43121
- ic.hAtoms = ic.hAtomsRefnum;
43201
+ // comment out so that this process didn't change the selection
43202
+ //ic.hAtoms = ic.hAtomsRefnum;
43122
43203
 
43123
43204
  // commented out because it produced too many commands
43124
43205
  // let name = 'refnum_anchors';
43125
43206
  // ic.selectionCls.saveSelection(name, name);
43126
-
43207
+
43127
43208
  ic.hlUpdateCls.updateHlAll();
43128
43209
  }
43129
43210
 
@@ -43154,9 +43235,10 @@ class ShowSeq {
43154
43235
  //ic.setColorCls.setColorByOptions(ic.opts, ic.atoms);
43155
43236
  ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
43156
43237
 
43157
- ic.selectionCls.selectAll_base();
43238
+ //ic.selectionCls.selectAll_base();
43158
43239
  ic.hlUpdateCls.updateHlAll();
43159
43240
  //ic.drawCls.draw();
43241
+ ic.drawCls.draw();
43160
43242
  }
43161
43243
 
43162
43244
  return {'html': html, 'html3': html3};
@@ -43232,7 +43314,10 @@ class ShowSeq {
43232
43314
 
43233
43315
  if(!bCustom && !kabat_or_imgt && !me.bNode) { // do not overwrite loops in node
43234
43316
  // reset ic.residIgLoop for the current selection, which could be the second round of ref num assignment
43235
- let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
43317
+ // just current chain
43318
+ let atomHash = me.hashUtilsCls.intHash(ic.chains[chnid], ic.hAtoms);
43319
+ let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(atomHash);
43320
+
43236
43321
  for(let resid in residHash) {
43237
43322
  // not in loop any more if you assign ref numbers multiple times
43238
43323
  delete ic.residIgLoop[resid];
@@ -43270,8 +43355,10 @@ class ShowSeq {
43270
43355
 
43271
43356
  postfix = strandPostfix + '_' + index;
43272
43357
 
43358
+ let firstTwo = parseInt(refnum.toString().substr(0, 2)); // A- strand
43359
+
43273
43360
  if(currStrand && currStrand != ' ') {
43274
- if(refnum3c.substr(0,1) != '9') {
43361
+ if(refnum3c.substr(0,1) != '9' || firstTwo == 10) {
43275
43362
  let lastTwo = parseInt(refnum.toString().substr(refnum.toString().length - 2, 2));
43276
43363
 
43277
43364
  if(currStrand != prevStrand) { // reset currCnt
@@ -43298,6 +43385,10 @@ class ShowSeq {
43298
43385
  resCntAtAnchor = 0;
43299
43386
  }
43300
43387
 
43388
+ if(firstTwo == 10) {
43389
+ strandArray[strandCnt].anchorRefnum = 0;
43390
+ }
43391
+
43301
43392
  strandArray[strandCnt].strandPostfix = strandPostfix; // a in A1250a
43302
43393
  strandArray[strandCnt].strand = currStrand; // A in A1250a
43303
43394
 
@@ -43320,6 +43411,10 @@ class ShowSeq {
43320
43411
  resCntAtAnchor = 0;
43321
43412
  }
43322
43413
 
43414
+ if(firstTwo == 10) {
43415
+ strandArray[strandCnt - 1].anchorRefnum = 0;
43416
+ }
43417
+
43323
43418
  strandArray[strandCnt - 1].endResi = currResi;
43324
43419
  strandArray[strandCnt - 1].endRefnum = refnum; // 1250a
43325
43420
  strandArray[strandCnt - 1].resCntAtAnchor = resCntAtAnchor;
@@ -43654,13 +43749,13 @@ class ShowSeq {
43654
43749
 
43655
43750
  let html = '';
43656
43751
 
43657
- if(refnumLabel && lastTwo == 50 && !bLoop) {
43752
+ if(refnumLabel && (lastTwo == 50 || refnum == 1094) && !bLoop) {
43658
43753
  // highlight the anchor residues
43659
43754
  ic.hAtomsRefnum = me.hashUtilsCls.unionHash(ic.hAtomsRefnum, ic.residues[residueid]);
43660
43755
 
43661
43756
  html += '<span ' + colorStr + ' title="' + refnumLabel + '"><b>' + refnumLabel.substr(0, 1) + '</b>' + refnumLabel.substr(1) + '</span>';
43662
43757
  }
43663
- else if(refnumLabel && lastTwo % 2 == 0 && lastTwo != 52 && !bHidelabel) { // don't show label for the first, middle, and last loop residues
43758
+ else if(refnumLabel && lastTwo % 2 == 0 && lastTwo != 52 && refnum != 1096 && !bHidelabel) { // don't show label for the first, middle, and last loop residues
43664
43759
  // e.g., 2152a
43665
43760
  lastTwoStr = isNaN(refnumStr) ? lastTwoStr + refnumStr.substr(refnumStr.length - 1, 1) : lastTwoStr;
43666
43761
  html += '<span ' + colorStr + ' title="' + refnumLabel + '">' + lastTwoStr + '</span>';
@@ -43674,17 +43769,17 @@ class ShowSeq {
43674
43769
 
43675
43770
  getRefnumColor(currStrand, bText) { let ic = this.icn3d, me = ic.icn3dui;
43676
43771
  if(currStrand == "A-") {
43677
- return '#663399';
43772
+ return '#9400D3'; //'#663399';
43678
43773
  }
43679
43774
  else if(currStrand == "A") {
43680
- return '#663399';
43775
+ return '#9400D3'; //'#663399';
43681
43776
  }
43682
43777
  //else if(currStrand == "A*") {
43683
43778
  else if(currStrand == "A+") {
43684
- return '#663399'; //'#FFC0CB';
43779
+ return '#9400D3'; //'#663399';
43685
43780
  }
43686
43781
  else if(currStrand == "A'") {
43687
- return '#663399';
43782
+ return '#9400D3'; //'#663399';
43688
43783
  }
43689
43784
  else if(currStrand == "B") {
43690
43785
  return '#ba55d3';
@@ -43702,7 +43797,8 @@ class ShowSeq {
43702
43797
  return '#00FF00';
43703
43798
  }
43704
43799
  else if(currStrand == "E") {
43705
- return (bText) ? "#F7DC6F" : "#FFFF00";
43800
+ //return (bText) ? "#F7DC6F" : "#FFFF00";
43801
+ return "#F7DC6F";
43706
43802
  }
43707
43803
  else if(currStrand == "F") {
43708
43804
  return '#FFA500';
@@ -43726,7 +43822,7 @@ class ShowSeq {
43726
43822
  return '#006400';
43727
43823
  }
43728
43824
  else if(currStrand == "C" || currStrand == "F") {
43729
- return "#FFFF00"; //'#F0E68C';
43825
+ return "#F7DC6F"; //"#FFFF00"; //'#F0E68C';
43730
43826
  }
43731
43827
  else if(currStrand == "C'" || (currStrand && currStrand.substr(0, 1) == "G")) {
43732
43828
  return '#FFA500';
@@ -45425,31 +45521,31 @@ class LineGraph {
45425
45521
  ic.hlUpdateCls.updateHlAll();
45426
45522
  }
45427
45523
 
45428
- async showIgRefNum() { let ic = this.icn3d, me = ic.icn3dui;
45524
+ async showIgRefNum(template) { let ic = this.icn3d, me = ic.icn3dui;
45429
45525
  let thisClass = this;
45430
45526
 
45431
45527
  // round 1, 16 templates
45432
- ic.refpdbArray = ['1InsulinR_8guyE_human_FN3-n1', '1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', '1CoAtomerGamma1_1r4xA_human', '1C3_2qkiD_human_n1', '1CuZnSuperoxideDismutase_1hl5C_human', '1ASF1A_2iijA_human', '1FAB-LIGHT_5esv_C1-n2', '1CD2_1hnfA_human_C2-n2', '1NaCaExchanger_2fwuA_dog_n2', '1FAB-HEAVY_5esv_V-n1', '1PDL1_4z18B_human_V-n1', '1BTLA_2aw2A_human_Iset', '1LaminAC_1ifrA_human', '1IsdA_2iteA_bacteria', '1TCRa_6jxrm_human_C1-n2', '1CD19_6al5A_human_C2orV-n1', '1CD28_1yjdC_human_V'];
45528
+ ic.refpdbArray = ['1InsulinR_8guyE_human_FN3-n1', '1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', '1CoAtomerGamma1_1r4xA_human', '1C3_2qkiD_human_n1', '1CuZnSuperoxideDismutase_1hl5C_human', '1ASF1A_2iijA_human', '1FAB-LIGHT_5esv_C1-n2', '1CD2_1hnfA_human_C2-n2', '1NaCaExchanger_2fwuA_dog_n2', '1NaKATPaseTransporterBeta_2zxeB_spurdogshark', '1FAB-HEAVY_5esv_V-n1', '1PDL1_4z18B_human_V-n1', '1BTLA_2aw2A_human_Iset', '1LaminAC_1ifrA_human', '1CD3g_6jxrg_human_Iset', '1CD28_1yjdC_human_V', '1CD19_6al5A_human_C2orV-n1'];
45433
45529
 
45434
45530
  // round 2
45435
45531
  ic.refpdbHash = {};
45436
45532
  ic.refpdbHash['1InsulinR_8guyE_human_FN3-n1'] = ['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'];
45437
45533
  ic.refpdbHash['1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'ICOS_6x4gA_human_V'];
45438
- ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
45534
+ ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria'];
45439
45535
  ic.refpdbHash['1C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'BArrestin1_4jqiA_rat_n1', 'RBPJ_6py8C_human_Unk-n1'];
45440
45536
  ic.refpdbHash['1CuZnSuperoxideDismutase_1hl5C_human'] = ['CuZnSuperoxideDismutase_1hl5C_human', 'TEAD1_3kysC_human'];
45441
- ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human', 'MPT63_1lmiA_bacteria'];
45537
+ ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
45442
45538
  ic.refpdbHash['1FAB-LIGHT_5esv_C1-n2'] = ['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'];
45443
45539
  ic.refpdbHash['1CD2_1hnfA_human_C2-n2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2'];
45444
- ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
45540
+ ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2'];
45541
+ ic.refpdbHash['1NaKATPaseTransporterBeta_2zxeB_spurdogshark'] = ['NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
45445
45542
  ic.refpdbHash['1FAB-HEAVY_5esv_V-n1'] = ['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'];
45446
45543
  ic.refpdbHash['1PDL1_4z18B_human_V-n1'] = ['PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1', 'LAG3_7tzgD_human_V-n1'];
45447
45544
  ic.refpdbHash['1BTLA_2aw2A_human_Iset'] = ['BTLA_2aw2A_human_Iset', 'Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152', 'LAG3_7tzgD_human_C2-n2', 'JAM1_1nbqA_human_VorIset-n2', 'Contactin1_3s97C_human_C2-n2'];
45448
- ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human'];
45449
- ic.refpdbHash['1IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria'];
45450
- ic.refpdbHash['1TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
45451
- ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
45452
- ic.refpdbHash['1CD28_1yjdC_human_V'] = ['CD28_1yjdC_human_V'];
45545
+ ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'CD3d_6jxrd_human_Iset'];
45546
+ ic.refpdbHash['1CD3g_6jxrg_human_Iset'] = ['CD3g_6jxrg_human_Iset', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria'];
45547
+ ic.refpdbHash['1CD28_1yjdC_human_V'] = ['CD28_1yjdC_human_V', 'MPT63_1lmiA_bacteria', 'CD3e_6jxrf_human_Iset'];
45548
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
45453
45549
 
45454
45550
  // use known ref structure
45455
45551
  ic.refpdbHash['5ESV_C'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2'];
@@ -45497,11 +45593,14 @@ class LineGraph {
45497
45593
  ic.refpdbHash['6A15_A'] = ['CD19_6al5A_human_C2orV-n1'];
45498
45594
  ic.refpdbHash['2QKI_D'] = ['C3_2qkiD_human_n1'];
45499
45595
  ic.refpdbHash['1YJD_C'] = ['CD28_1yjdC_human_V'];
45596
+ ic.refpdbHash['6JXR_d'] = ['CD3d_6jxrd_human_Iset'];
45597
+ ic.refpdbHash['6JXR_f'] = ['CD3e_6jxrf_human_Iset'];
45598
+ ic.refpdbHash['6JXR_g'] = ['CD3g_6jxrg_human_Iset'];
45500
45599
 
45501
45600
  let pdbAjaxArray = [];
45502
45601
  for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
45503
- //let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
45504
- let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refjsonid=" + ic.refpdbArray[k];
45602
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
45603
+ //let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refjsonid=" + ic.refpdbArray[k];
45505
45604
 
45506
45605
  let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
45507
45606
 
@@ -45509,9 +45608,14 @@ class LineGraph {
45509
45608
  }
45510
45609
 
45511
45610
  // try {
45512
- let allPromise = Promise.allSettled(pdbAjaxArray);
45513
- ic.pdbDataArray = await allPromise;
45514
- await thisClass.parseRefPdbData(ic.pdbDataArray);
45611
+ if(!template) {
45612
+ let allPromise = Promise.allSettled(pdbAjaxArray);
45613
+ ic.pdbDataArray = await allPromise;
45614
+ await thisClass.parseRefPdbData(ic.pdbDataArray, template);
45615
+ }
45616
+ else {
45617
+ await thisClass.parseRefPdbData(undefined, template);
45618
+ }
45515
45619
  // }
45516
45620
  // catch(err) {
45517
45621
  // if(!me.bNode) var aaa = 1; //alert("Error in retrieveing reference PDB data...");
@@ -45519,7 +45623,7 @@ class LineGraph {
45519
45623
  // }
45520
45624
  }
45521
45625
 
45522
- async parseRefPdbData(dataArray) { let ic = this.icn3d, me = ic.icn3dui;
45626
+ async parseRefPdbData(dataArray, template) { let ic = this.icn3d, me = ic.icn3dui;
45523
45627
  let thisClass = this;
45524
45628
 
45525
45629
  let struArray = Object.keys(ic.structures);
@@ -45527,8 +45631,8 @@ class LineGraph {
45527
45631
  let ajaxArray = [];
45528
45632
  let domainidpairArray = [];
45529
45633
 
45530
- me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
45531
- let urlalign = me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
45634
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
45635
+ me.htmlCls.baseUrl + "vastdyn/vastdyn.cgi";
45532
45636
 
45533
45637
  if(!ic.resid2domainid) ic.resid2domainid = {};
45534
45638
  //ic.resid2domainid = {};
@@ -45566,11 +45670,16 @@ class LineGraph {
45566
45670
 
45567
45671
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(currAtoms);
45568
45672
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(currAtoms);
45569
- let resiSum = parseInt(atomFirst.resi) + parseInt(atomLast.resi);
45673
+ let resiSum = atomFirst.resi + ':' + atomLast.resi;
45570
45674
 
45571
45675
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
45572
45676
  let resid = residueArray[n];
45573
45677
  ic.resid2domainid[resid] = chainid + '-0' + '_' + resiSum;
45678
+
45679
+ // clear previous refnum assignment if any
45680
+ if(ic.resid2refnum && ic.resid2refnum[resid]) {
45681
+ delete ic.resid2refnum[resid];
45682
+ }
45574
45683
  }
45575
45684
  }
45576
45685
  else {
@@ -45585,6 +45694,11 @@ class LineGraph {
45585
45694
  let resid = chainid + '_' + pos2resi[n];
45586
45695
  domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
45587
45696
  //ic.resid2domainid[resid] = chainid + '-' + k;
45697
+
45698
+ // clear previous refnum assignment if any
45699
+ if(ic.resid2refnum && ic.resid2refnum[resid]) {
45700
+ delete ic.resid2refnum[resid];
45701
+ }
45588
45702
  }
45589
45703
  }
45590
45704
 
@@ -45592,7 +45706,7 @@ class LineGraph {
45592
45706
 
45593
45707
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtoms);
45594
45708
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtoms);
45595
- let resiSum = parseInt(atomFirst.resi) + parseInt(atomLast.resi);
45709
+ let resiSum = atomFirst.resi + ':' + atomLast.resi;
45596
45710
 
45597
45711
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
45598
45712
  let startResi = segArray[m];
@@ -45606,69 +45720,121 @@ class LineGraph {
45606
45720
  }
45607
45721
  }
45608
45722
 
45723
+ if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
45724
+
45609
45725
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
45610
45726
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
45611
- let bForceOneDomain = true;
45612
- let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(domainAtomsArray[k], bForceOneDomain);
45727
+ //let bForceOneDomain = true;
45728
+ //let jsonStr_t = ic.domain3dCls.getDomainJsonForAlign(domainAtomsArray[k], bForceOneDomain);
45613
45729
 
45614
45730
  // ig strand for any subset will have the same k, use the number of residue to separate them
45615
45731
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtomsArray[k]);
45616
45732
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtomsArray[k]);
45617
- let resiSum = parseInt(atomFirst.resi) + parseInt(atomLast.resi);
45733
+ let resiSum = atomFirst.resi + ':' + atomLast.resi;
45618
45734
  //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
45619
45735
  let domainid = chainid + '-' + k + '_' + resiSum;
45620
45736
  ic.domainid2pdb[domainid] = pdb_target;
45621
45737
 
45622
- for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
45623
- // let struct2 = ic.defaultPdbId + index;
45624
- // let pdb_query = dataArray[index].value; //[0];
45625
- // let header = 'HEADER ' + struct2 + '\n';
45626
- // pdb_query = header + pdb_query;
45627
- let jsonStr_q = dataArray[index].value; //[0];
45738
+ if(!template) {
45739
+ for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
45740
+ let struct2 = ic.defaultPdbId + index;
45741
+ let pdb_query = dataArray[index].value; //[0];
45742
+ let header = 'HEADER ' + struct2 + '\n';
45743
+ pdb_query = header + pdb_query;
45744
+ //let jsonStr_q = dataArray[index].value; //[0];
45628
45745
 
45629
- // TM-align is not good when you align a full structure with the strand-only structure. VAST is better in this case.
45630
- // let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]};
45631
- // let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
45746
+ let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]};
45747
+ let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
45632
45748
 
45633
- let dataObj = {'domains1': jsonStr_q, 'domains2': jsonStr_t};
45634
- let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
45749
+ // let dataObj = {'domains1': jsonStr_q, 'domains2': jsonStr_t};
45750
+ // let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
45635
45751
 
45636
- ajaxArray.push(alignAjax);
45637
-
45638
- domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
45752
+ ajaxArray.push(alignAjax);
45753
+
45754
+ domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
45755
+ }
45756
+ }
45757
+ else {
45758
+ ic.domainid2refpdbname[domainid] = template;
45759
+ domainidpairArray.push(domainid + "|1" + template); // "1" was added for the first round strand-only template
45639
45760
  }
45640
45761
  }
45641
45762
  }
45642
45763
  }
45643
45764
 
45644
45765
  try {
45645
- let dataArray2 = [];
45766
+ if(!template) {
45767
+ let dataArray2 = [];
45646
45768
 
45647
- // let allPromise = Promise.allSettled(ajaxArray);
45648
- // dataArray2 = await allPromise;
45769
+ // let allPromise = Promise.allSettled(ajaxArray);
45770
+ // dataArray2 = await allPromise;
45649
45771
 
45650
- //split arrays into chunks of 96 jobs or me.cfg.maxajax jobs
45651
- let n = (me.cfg.maxajax) ? me.cfg.maxajax : 96;
45772
+ //split arrays into chunks of 48 jobs or me.cfg.maxajax jobs
45773
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : ic.refpdbArray.length * 6;
45652
45774
 
45653
- for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
45654
- let currAjaxArray = [];
45655
- if(i == il - 1) { // last one
45656
- currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
45657
- }
45658
- else {
45659
- currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
45660
- }
45775
+ for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
45776
+ let currAjaxArray = [];
45777
+ if(i == il - 1) { // last one
45778
+ currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
45779
+ }
45780
+ else {
45781
+ currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
45782
+ }
45661
45783
 
45662
- let currPromise = Promise.allSettled(currAjaxArray);
45663
- let currDataArray = await currPromise;
45784
+ let currPromise = Promise.allSettled(currAjaxArray);
45785
+ let currDataArray = await currPromise;
45664
45786
 
45665
- dataArray2 = dataArray2.concat(currDataArray);
45787
+ dataArray2 = dataArray2.concat(currDataArray);
45788
+ }
45789
+
45790
+ let bRound1 = true;
45791
+ await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
45792
+
45793
+ /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
45666
45794
  }
45667
-
45668
- let bRound1 = true;
45669
- await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
45795
+ else {
45796
+ if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
45797
+
45798
+ // start round2
45799
+ let ajaxArray = [];
45800
+ let domainidpairArray3 = [];
45801
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
45802
+
45803
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + template;
45804
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
45805
+ let pdbAjaxArray = [];
45806
+ pdbAjaxArray.push(pdbAjax);
45670
45807
 
45671
- /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
45808
+ let allPromise2 = Promise.allSettled(pdbAjaxArray);
45809
+ ic.pdbDataArray = await allPromise2;
45810
+
45811
+ for(let domainid in ic.domainid2refpdbname) {
45812
+ let refpdbname = ic.domainid2refpdbname[domainid];
45813
+ let chainid = domainid.substr(0, domainid.indexOf('-'));
45814
+
45815
+ let pdb_target = ic.domainid2pdb[domainid];
45816
+ for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
45817
+ let struct2 = ic.defaultPdbId + index;
45818
+ let pdb_query = ic.pdbDataArray[index].value; //[0];
45819
+
45820
+ let header = 'HEADER ' + struct2 + '\n';
45821
+ pdb_query = header + pdb_query;
45822
+
45823
+ let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": template};
45824
+ let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
45825
+ ajaxArray.push(alignAjax);
45826
+
45827
+ //domainidpairArray3.push(domainid + "," + refpdbname);
45828
+ domainidpairArray3.push(domainid + "|" + template);
45829
+ }
45830
+ }
45831
+
45832
+ let dataArray3 = [];
45833
+ let allPromise = Promise.allSettled(ajaxArray);
45834
+ dataArray3 = await allPromise;
45835
+
45836
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3);
45837
+ }
45672
45838
  }
45673
45839
  catch(err) {
45674
45840
  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...";
@@ -45680,7 +45846,7 @@ class LineGraph {
45680
45846
  }
45681
45847
  //console.log("Error in aligning with TM-align...");
45682
45848
  return;
45683
- }
45849
+ }
45684
45850
  }
45685
45851
 
45686
45852
  getTemplateList(chainid) { let ic = this.icn3d; ic.icn3dui;
@@ -45711,7 +45877,6 @@ class LineGraph {
45711
45877
  let thisClass = this;
45712
45878
 
45713
45879
  let tmscoreThreshold = 0.4; // 0.4; //0.5;
45714
- let rmsdThreshold = 10;
45715
45880
 
45716
45881
  // find the best alignment for each chain
45717
45882
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
@@ -45745,7 +45910,10 @@ class LineGraph {
45745
45910
  }
45746
45911
  }
45747
45912
  else {
45748
- if(queryData[0].super_rmsd > rmsdThreshold || queryData[0].num_res < minResidues) {
45913
+ // if(queryData[0].super_rmsd > rmsdThreshold || queryData[0].num_res < minResidues) {
45914
+ // continue;
45915
+ // }
45916
+ if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
45749
45917
  continue;
45750
45918
  }
45751
45919
  }
@@ -45760,7 +45928,8 @@ class LineGraph {
45760
45928
  if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
45761
45929
  }
45762
45930
  else {
45763
- if(!me.bNode) console.log("domainid: " + domainid + " refpdbname " + refpdbname + " RMSD: " + queryData[0].super_rmsd + ", num_res: " + queryData[0].num_res + ", 10/RMSD + num_res/5: " + (10 / queryData[0].super_rmsd + queryData[0].num_seg / 5).toFixed(1));
45931
+ // if(!me.bNode) console.log("domainid: " + domainid + " refpdbname " + refpdbname + " RMSD: " + queryData[0].super_rmsd + ", num_seg: " + queryData[0].num_seg + ", 10/RMSD + num_seg/5: " + (10 / queryData[0].super_rmsd + queryData[0].num_seg / 5).toFixed(1));
45932
+ if(!me.bNode) console.log("domainid: " + domainid + " refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
45764
45933
  }
45765
45934
 
45766
45935
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
@@ -45790,7 +45959,7 @@ class LineGraph {
45790
45959
  //if(!(bBstrand && bCstrand && bEstrand && bFstrand && bGstrand)) continue;
45791
45960
  if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
45792
45961
  if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
45793
- if(ic.domainid2refpdbname[domainid]) delete ic.domainid2refpdbname[domainid];
45962
+ if(ic.domainid2refpdbname[domainid] == refpdbname) delete ic.domainid2refpdbname[domainid];
45794
45963
  continue;
45795
45964
  }
45796
45965
  }
@@ -45808,7 +45977,8 @@ class LineGraph {
45808
45977
  }
45809
45978
  }
45810
45979
  else {
45811
- let mixScore = 10 / queryData[0].super_rmsd + queryData[0].num_seg / 5;
45980
+ //let mixScore = 10 / queryData[0].super_rmsd + queryData[0].num_seg / 5;
45981
+ let mixScore = queryData[0].score;
45812
45982
 
45813
45983
  if(!domainid2score.hasOwnProperty(domainid) || mixScore > domainid2score[domainid]) {
45814
45984
  domainid2score[domainid] = mixScore;
@@ -45876,10 +46046,28 @@ class LineGraph {
45876
46046
  }
45877
46047
 
45878
46048
  let dataArray3 = [];
45879
- let allPromise = Promise.allSettled(ajaxArray);
45880
- dataArray3 = await allPromise;
46049
+ //let allPromise = Promise.allSettled(ajaxArray);
46050
+ //dataArray3 = await allPromise;
46051
+
46052
+ //split arrays into chunks of 48 jobs or me.cfg.maxajax jobs
46053
+ let n = (me.cfg.maxajax) ? me.cfg.maxajax : ic.refpdbArray.length * 6;
46054
+
46055
+ for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
46056
+ let currAjaxArray = [];
46057
+ if(i == il - 1) { // last one
46058
+ currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
46059
+ }
46060
+ else {
46061
+ currAjaxArray = ajaxArray.slice(i * n, (i + 1) * n);
46062
+ }
46063
+
46064
+ let currPromise = Promise.allSettled(currAjaxArray);
46065
+ let currDataArray = await currPromise;
45881
46066
 
45882
- await thisClass.parseAlignData(dataArray3, domainidpairArray3);
46067
+ dataArray3 = dataArray3.concat(currDataArray);
46068
+ }
46069
+
46070
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3, false);
45883
46071
 
45884
46072
  // end of round 2
45885
46073
  return;
@@ -45910,6 +46098,7 @@ class LineGraph {
45910
46098
  if(!ic.chainsMapping) ic.chainsMapping = {};
45911
46099
 
45912
46100
  if(!ic.refPdbList) ic.refPdbList = [];
46101
+
45913
46102
  for(let chainid in chainid2segs) {
45914
46103
  let segArray = chainid2segs[chainid];
45915
46104
 
@@ -45978,7 +46167,7 @@ class LineGraph {
45978
46167
  else {
45979
46168
  await ic.showAnnoCls.showAnnotations();
45980
46169
  }
45981
-
46170
+
45982
46171
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
45983
46172
  }
45984
46173
  else {
@@ -49390,7 +49579,7 @@ class ChainalignParser {
49390
49579
  //hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.chains[chainidArray[0]]);
49391
49580
  //hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.chains[chainidArray[1]]);
49392
49581
  }
49393
-
49582
+
49394
49583
  // set up the view of sequence alignment for each pair
49395
49584
  for(let mmdbidpair in mmdbidpairFinalHash) {
49396
49585
  if(ic.q_rotation !== undefined) {
@@ -49821,7 +50010,11 @@ class ChainalignParser {
49821
50010
  if(me.cfg.aligntool == 'tmalign') logStr += "; TM-score: " + align[0].score.toPrecision(4);
49822
50011
  me.htmlCls.clickMenuCls.setLogCmd(logStr, false);
49823
50012
  let html = "<br><b>Alignment RMSD</b>: " + rmsd.toPrecision(4) + " &#8491;<br>";
49824
- if(me.cfg.aligntool == 'tmalign') html += "<b>TM-score</b>: " + align[0].score.toPrecision(4) + "<br><br>";
50013
+ if(me.cfg.aligntool == 'tmalign') {
50014
+ html += "<b>TM-score</b>: " + align[0].score.toPrecision(4) + "<br><br>";
50015
+ ic.tmscore = align[0].score.toPrecision(4);
50016
+ }
50017
+
49825
50018
  $("#" + ic.pre + "dl_rmsd_html").html(html);
49826
50019
  if(!me.cfg.bSidebyside) me.htmlCls.dialogCls.openDlg('dl_rmsd', 'RMSD of alignment');
49827
50020
 
@@ -50076,15 +50269,15 @@ class Dsn6Parser {
50076
50269
  this.icn3d = icn3d;
50077
50270
  }
50078
50271
 
50079
- dsn6Parser(pdbid, type, sigma) { let ic = this.icn3d; ic.icn3dui;
50272
+ async dsn6Parser(pdbid, type, sigma) { let ic = this.icn3d; ic.icn3dui;
50080
50273
  // https://edmaps.rcsb.org/maps/1kq2_2fofc.dsn6
50081
50274
  // https://edmaps.rcsb.org/maps/1kq2_fofc.dsn6
50082
50275
 
50083
50276
  let url = "https://edmaps.rcsb.org/maps/" + pdbid.toLowerCase() + "_" + type + ".dsn6";
50084
- this.dsn6ParserBase(url, type, sigma);
50277
+ await this.dsn6ParserBase(url, type, sigma);
50085
50278
  }
50086
50279
 
50087
- dsn6ParserBase(url, type, sigma) { let ic = this.icn3d; ic.icn3dui;
50280
+ async dsn6ParserBase(url, type, sigma) { let ic = this.icn3d, me = ic.icn3dui;
50088
50281
  let thisClass = this;
50089
50282
 
50090
50283
  //https://stackoverflow.com/questions/33902299/using-jquery-ajax-to-download-a-binary-file
@@ -50097,37 +50290,17 @@ class Dsn6Parser {
50097
50290
  ic.setOptionCls.setOption('map', type);
50098
50291
  }
50099
50292
  else {
50100
- let oReq = new XMLHttpRequest();
50101
- oReq.open("GET", url, true);
50102
- oReq.responseType = "arraybuffer";
50103
-
50104
- oReq.onreadystatechange = function() {
50105
- if(this.readyState == 4) {
50106
- if(this.status == 200) {
50107
- let arrayBuffer = oReq.response;
50108
- thisClass.loadDsn6Data(arrayBuffer, type, sigma);
50109
-
50110
- if(type == '2fofc') {
50111
- ic.bAjax2fofc = true;
50112
- }
50113
- else if(type == 'fofc') {
50114
- ic.bAjaxfofc = true;
50115
- }
50293
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', 'rcsbEdmaps');
50294
+ thisClass.loadDsn6Data(arrayBuffer, type, sigma);
50116
50295
 
50117
- ic.setOptionCls.setOption('map', type);
50118
- }
50119
- else {
50120
- var aaa = 1; //alert("RCSB server has no corresponding eletron density map for this structure.");
50121
- }
50122
-
50123
- /// if(ic.deferredMap !== undefined) ic.deferredMap.resolve();
50124
- }
50125
- else {
50126
- ic.ParserUtilsCls.showLoading();
50127
- }
50128
- };
50296
+ if(type == '2fofc') {
50297
+ ic.bAjax2fofc = true;
50298
+ }
50299
+ else if(type == 'fofc') {
50300
+ ic.bAjaxfofc = true;
50301
+ }
50129
50302
 
50130
- oReq.send();
50303
+ ic.setOptionCls.setOption('map', type);
50131
50304
  }
50132
50305
  }
50133
50306
 
@@ -50865,6 +51038,11 @@ class MmdbParser {
50865
51038
 
50866
51039
  let color =(molid2rescount[i].color === undefined) ? '#CCCCCC' : '#' +( '000000' + molid2rescount[i].color.toString( 16 ) ).slice( - 6 );
50867
51040
  let chainName =(molid2rescount[i].chain === undefined) ? '' : molid2rescount[i].chain.trim();
51041
+ // remove "_" in chain name
51042
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
51043
+ chainName = chainName.replace(/_/g, '');
51044
+ }
51045
+
50868
51046
  if(chainNameHash[chainName] === undefined) {
50869
51047
  chainNameHash[chainName] = 1;
50870
51048
  }
@@ -51899,7 +52077,7 @@ class PdbParser {
51899
52077
 
51900
52078
  if(me.cfg.rotate !== undefined) ic.resizeCanvasCls.rotStruc(me.cfg.rotate, true);
51901
52079
 
51902
- if(bAppend) {
52080
+ if(bAppend && !me.bNode) {
51903
52081
  // show all
51904
52082
  ic.definedSetsCls.setModeAndDisplay('all');
51905
52083
  }
@@ -53121,7 +53299,7 @@ class DensityCifParser {
53121
53299
  this.icn3d = icn3d;
53122
53300
  }
53123
53301
 
53124
- densityCifParser(pdbid, type, sigma, emd) { let ic = this.icn3d, me = ic.icn3dui;
53302
+ async densityCifParser(pdbid, type, sigma, emd) { let ic = this.icn3d, me = ic.icn3dui;
53125
53303
  let thisClass = this;
53126
53304
 
53127
53305
  let url;
@@ -53151,46 +53329,21 @@ class DensityCifParser {
53151
53329
  ic.setOptionCls.setOption('emmap', type);
53152
53330
  }
53153
53331
  else {
53154
- let oReq = new XMLHttpRequest();
53155
- oReq.open("GET", url, true);
53156
- oReq.responseType = "arraybuffer";
53157
-
53158
- oReq.onreadystatechange = function() {
53159
- if (this.readyState == 4) {
53160
- if(this.status == 200) {
53161
- let arrayBuffer = oReq.response;
53162
-
53163
- thisClass.parseChannels(arrayBuffer, type, sigma);
53164
-
53165
- if(type == '2fofc' || type == 'fofc') {
53166
- ic.bAjax2fofc = true;
53167
- ic.bAjaxfofc = true;
53332
+ let arrayBuffer = await me.getXMLHttpRqstPromise(url, 'GET', 'arraybuffer', type);
53168
53333
 
53169
- ic.setOptionCls.setOption('map', type);
53170
- }
53171
- else if(type == 'em') {
53172
- ic.bAjaxEm = true;
53334
+ thisClass.parseChannels(arrayBuffer, type, sigma);
53173
53335
 
53174
- ic.setOptionCls.setOption('emmap', type);
53175
- }
53176
- }
53177
- else {
53178
- if(type == '2fofc' || type == 'fofc') {
53179
- var aaa = 1; //alert("Density server at EBI has no corresponding electron density map for this structure.");
53180
- }
53181
- else if(type == 'em') {
53182
- var aaa = 1; //alert("Density server at EBI has no corresponding EM density map for this structure.");
53183
- }
53184
- }
53336
+ if(type == '2fofc' || type == 'fofc') {
53337
+ ic.bAjax2fofc = true;
53338
+ ic.bAjaxfofc = true;
53185
53339
 
53186
- /// if(ic.deferredEmmap !== undefined) ic.deferredEmmap.resolve();
53187
- }
53188
- else {
53189
- ic.ParserUtilsCls.showLoading();
53190
- }
53191
- };
53340
+ ic.setOptionCls.setOption('map', type);
53341
+ }
53342
+ else if(type == 'em') {
53343
+ ic.bAjaxEm = true;
53192
53344
 
53193
- oReq.send();
53345
+ ic.setOptionCls.setOption('emmap', type);
53346
+ }
53194
53347
  }
53195
53348
  }
53196
53349
 
@@ -54242,16 +54395,20 @@ class ParserUtils {
54242
54395
 
54243
54396
  getMissingResidues(seqArray, type, chainid) { let ic = this.icn3d, me = ic.icn3dui;
54244
54397
  ic.chainsSeq[chainid] = [];
54398
+
54399
+ // find the offset of MMDB sequence
54400
+ let offset = 0;
54245
54401
  if(type === 'mmdbid' || type === 'align') {
54246
54402
  for(let i = 0, il = seqArray.length; i < il; ++i) {
54247
54403
  if(seqArray[i][0] != 0) {
54248
- seqArray[i][0] - (i + 1);
54404
+ offset = seqArray[i][0] - (i + 1);
54249
54405
  break;
54250
54406
  }
54251
54407
  }
54252
54408
  }
54253
54409
 
54254
- let prevResi = 0;
54410
+ //let prevResi = 0;
54411
+ let prevResi = offset;
54255
54412
  for(let i = 0, il = seqArray.length; i < il; ++i) {
54256
54413
  let seqName, resiPos;
54257
54414
  // mmdbid: ["0","R","ARG"],["502","V","VAL"]; mmcifid: [1, "ARG"]; align: ["0","R","ARG"] //align: [1, "0","R","ARG"]
@@ -55070,6 +55227,12 @@ class LoadAtomData {
55070
55227
  if(Object.keys(data.moleculeInfor[molid]).length === 0) continue;
55071
55228
 
55072
55229
  let chain = data.moleculeInfor[molid].chain.trim();
55230
+
55231
+ // remove "_" in chain name
55232
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
55233
+ chain = chain.replace(/_/g, '');
55234
+ }
55235
+
55073
55236
  let chainid = pdbidTmp + '_' + chain;
55074
55237
 
55075
55238
  if(chainHash.hasOwnProperty(chain)) {
@@ -55134,6 +55297,7 @@ class LoadAtomData {
55134
55297
  let CSerial, prevCSerial, OSerial, prevOSerial;
55135
55298
 
55136
55299
  let biopolymerChainsHash = {};
55300
+
55137
55301
  for(let i in atoms) {
55138
55302
  ++serial;
55139
55303
 
@@ -55163,21 +55327,21 @@ class LoadAtomData {
55163
55327
  atm.chain = ic.molid2chain[molid].substr(pos + 1);
55164
55328
  }
55165
55329
  else {
55166
- let miscName = 'Misc';
55330
+ let miscName = 'Misc';
55167
55331
 
55168
- //if(atm.resn != prevResn || chainid2kind[chainNum] === 'solvent' || atm.resn === 'HOH' || atm.name == atm.elem) {
55169
- if((chainid2kind[chainNum] === 'protein' && chainid2kind[chainNum] === 'nucleotide' && atm.resi != prevResiOri)
55170
- ||(chainid2kind[chainNum] !== 'protein' && chainid2kind[chainNum] !== 'nucleotide'
55171
- &&(atm.resn.substr(0,3) != prevResn.substr(0,3) || atm.resi != prevResiOri || chainid2kind[chainNum] === 'solvent' || atm.resn === 'HOH')) ) {
55172
- ++miscCnt;
55173
- }
55332
+ //if(atm.resn != prevResn || chainid2kind[chainNum] === 'solvent' || atm.resn === 'HOH' || atm.name == atm.elem) {
55333
+ if((chainid2kind[chainNum] === 'protein' && chainid2kind[chainNum] === 'nucleotide' && atm.resi != prevResiOri)
55334
+ ||(chainid2kind[chainNum] !== 'protein' && chainid2kind[chainNum] !== 'nucleotide'
55335
+ &&(atm.resn.substr(0,3) != prevResn.substr(0,3) || atm.resi != prevResiOri || chainid2kind[chainNum] === 'solvent' || atm.resn === 'HOH')) ) {
55336
+ ++miscCnt;
55337
+ }
55174
55338
 
55175
- atm.resi_ori = atm.resi;
55176
- atm.resi = miscCnt;
55177
- bSetResi = true;
55339
+ atm.resi_ori = atm.resi;
55340
+ atm.resi = miscCnt;
55341
+ bSetResi = true;
55178
55342
 
55179
- //if all are defined in the chain section, no "Misc" should appear
55180
- atm.chain = miscName;
55343
+ //if all are defined in the chain section, no "Misc" should appear
55344
+ atm.chain = miscName;
55181
55345
  }
55182
55346
 
55183
55347
  //if(ic.mmdbid_q !== undefined && ic.mmdbid_q === ic.mmdbid_t && alignType === 'query') {
@@ -55215,6 +55379,11 @@ class LoadAtomData {
55215
55379
 
55216
55380
  atm.chain = atm.chain.trim(); //.replace(/_/g, '');
55217
55381
 
55382
+ // remove "_" in chain name
55383
+ if(parseInt(me.cfg.date) >= 20231001 || (!me.cfg.date && parseInt(me.utilsCls.getDateDigitStr()) >= 20231001)) {
55384
+ atm.chain = atm.chain.replace(/_/g, '');
55385
+ }
55386
+
55218
55387
  // mmcif has pre-assigned structure in mmcifparser.cgi output
55219
55388
  if(type === 'mmdbid' || type === 'align') {
55220
55389
  atm.structure = mmdbId;
@@ -57623,10 +57792,7 @@ class LoadPDB {
57623
57792
 
57624
57793
  if(ic.atoms[oriSerial2NewSerial[from]] !== undefined) ic.atoms[oriSerial2NewSerial[from]].bonds.push(oriSerial2NewSerial[to]);
57625
57794
  }
57626
- } else if (record.substr(0,3) === 'TER') {
57627
- // Concatenation of two pdbs will have several atoms for the same serial
57628
- ++serial;
57629
- }
57795
+ } else if (record.substr(0,3) === 'TER') ;
57630
57796
  }
57631
57797
 
57632
57798
  // add the last residue set
@@ -59200,24 +59366,28 @@ class ApplyCommand {
59200
59366
  else if(command == 'rotate left') {
59201
59367
  ic.bStopRotate = false;
59202
59368
  ic.ROT_DIR = 'left';
59369
+ ic.transformCls.rotateCountMax = 6000;
59203
59370
 
59204
59371
  ic.resizeCanvasCls.rotStruc('left');
59205
59372
  }
59206
59373
  else if(command == 'rotate right') {
59207
59374
  ic.bStopRotate = false;
59208
59375
  ic.ROT_DIR = 'right';
59376
+ ic.transformCls.rotateCountMax = 6000;
59209
59377
 
59210
59378
  ic.resizeCanvasCls.rotStruc('right');
59211
59379
  }
59212
59380
  else if(command == 'rotate up') {
59213
59381
  ic.bStopRotate = false;
59214
59382
  ic.ROT_DIR = 'up';
59383
+ ic.transformCls.rotateCountMax = 6000;
59215
59384
 
59216
59385
  ic.resizeCanvasCls.rotStruc('up');
59217
59386
  }
59218
59387
  else if(command == 'rotate down') {
59219
59388
  ic.bStopRotate = false;
59220
59389
  ic.ROT_DIR = 'down';
59390
+ ic.transformCls.rotateCountMax = 6000;
59221
59391
 
59222
59392
  ic.resizeCanvasCls.rotStruc('down');
59223
59393
  }
@@ -61343,10 +61513,14 @@ class LoadScript {
61343
61513
  let bFinalStep =(i === steps - 1) ? true : false;
61344
61514
 
61345
61515
  if(!ic.commands[i].trim()) continue;
61346
- if(!ic.atoms && ic.commands[i].indexOf('load') == -1) continue;
61516
+ let nAtoms = Object.keys(ic.atoms).length;
61517
+
61518
+ if(nAtoms == 0 && ic.commands[i].indexOf('load') == -1) continue;
61347
61519
 
61348
61520
  let strArray = ic.commands[i].split("|||");
61349
61521
  let command = strArray[0].trim();
61522
+
61523
+ if(ic.inputid) ic.bNotLoadStructure = true;
61350
61524
 
61351
61525
  if(command.indexOf('load') !== -1) {
61352
61526
  if(end === 0 && start === end) {
@@ -61435,6 +61609,10 @@ class LoadScript {
61435
61609
  else if(command.indexOf('ig refnum on') == 0 ) {
61436
61610
  await ic.refnumCls.showIgRefNum();
61437
61611
  }
61612
+ else if(command.indexOf('ig template') == 0 ) {
61613
+ let template = command.substr(command.lastIndexOf(' ') + 1);
61614
+ await ic.refnumCls.showIgRefNum(template);
61615
+ }
61438
61616
  else if(command.indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
61439
61617
  if(Object.keys(ic.proteins).length > 0) {
61440
61618
  thisClass.applyCommand3ddomain(strArray[0].trim());
@@ -61608,10 +61786,10 @@ class LoadScript {
61608
61786
  await thisClass.applyCommandLoad(lastCommand);
61609
61787
  }
61610
61788
  else if(lastCommand.indexOf('set map') !== -1 && lastCommand.indexOf('set map wireframe') === -1) {
61611
- thisClass.applyCommandMap(lastCommand);
61789
+ await thisClass.applyCommandMap(lastCommand);
61612
61790
  }
61613
61791
  else if(lastCommand.indexOf('set emmap') !== -1 && lastCommand.indexOf('set emmap wireframe') === -1) {
61614
- thisClass.applyCommandEmmap(lastCommand);
61792
+ await thisClass.applyCommandEmmap(lastCommand);
61615
61793
  }
61616
61794
  else if(lastCommand.indexOf('set phi') !== -1) {
61617
61795
  await ic.delphiCls.applyCommandPhi(lastCommand);
@@ -61881,7 +62059,7 @@ class LoadScript {
61881
62059
  }
61882
62060
 
61883
62061
  //Apply the command to show electron density map.
61884
- applyCommandMap(command) { let ic = this.icn3d; ic.icn3dui;
62062
+ async applyCommandMap(command) { let ic = this.icn3d; ic.icn3dui;
61885
62063
 
61886
62064
  // chain functions together
61887
62065
  // ic.deferredMap = $.Deferred(function() { let ic = thisClass.icn3d;
@@ -61897,10 +62075,10 @@ class LoadScript {
61897
62075
  let type = paraArray[0];
61898
62076
 
61899
62077
  if(urlArray.length == 2) {
61900
- ic.dsn6ParserCls.dsn6ParserBase(urlArray[1], type, sigma);
62078
+ await ic.dsn6ParserCls.dsn6ParserBase(urlArray[1], type, sigma);
61901
62079
  }
61902
62080
  else {
61903
- ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma);
62081
+ await ic.dsn6ParserCls.dsn6Parser(ic.inputid, type, sigma);
61904
62082
  }
61905
62083
  }
61906
62084
  // }); // end of me.deferred = $.Deferred(function() {
@@ -61909,7 +62087,7 @@ class LoadScript {
61909
62087
  }
61910
62088
 
61911
62089
  //Apply the command to show EM density map.
61912
- applyCommandEmmap(command) { let ic = this.icn3d; ic.icn3dui;
62090
+ async applyCommandEmmap(command) { let ic = this.icn3d; ic.icn3dui;
61913
62091
 
61914
62092
  // chain functions together
61915
62093
  // ic.deferredEmmap = $.Deferred(function() { let ic = thisClass.icn3d;
@@ -61920,7 +62098,7 @@ class LoadScript {
61920
62098
  let percentage = paraArray[1];
61921
62099
  let type = 'em';
61922
62100
 
61923
- ic.densityCifParserCls.densityCifParser(ic.inputid, type, percentage, ic.emd);
62101
+ await ic.densityCifParserCls.densityCifParser(ic.inputid, type, percentage, ic.emd);
61924
62102
  }
61925
62103
  // }); // end of me.deferred = $.Deferred(function() {
61926
62104
 
@@ -62252,7 +62430,7 @@ class SelectByCommand {
62252
62430
  // $1,2,3: Structure
62253
62431
  // .A,B,C: chain
62254
62432
  // :5-10,K,chemicals: residues, could be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
62255
- // :ref_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
62433
+ // :ref_1250,ref_anchors,ref_strands,ref_loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
62256
62434
  // @CA,C,C*: atoms
62257
62435
  // wild card * can be used to select all
62258
62436
  //var currHighlightAtoms = {}
@@ -63857,31 +64035,12 @@ class Delphi {
63857
64035
  this.icn3d = icn3d;
63858
64036
  }
63859
64037
 
63860
- CalcPhiUrl(gsize, salt, contour, bSurface, url) { let ic = this.icn3d; ic.icn3dui;
64038
+ async CalcPhiUrl(gsize, salt, contour, bSurface, url) { let ic = this.icn3d, me = ic.icn3dui;
63861
64039
  let thisClass = this;
63862
64040
 
63863
- let oReq = new XMLHttpRequest();
63864
- oReq.open("GET", url, true);
63865
-
63866
- oReq.responseType = "text";
64041
+ let data = await me.getXMLHttpRqstPromise(url, 'GET', 'text', 'PQR');
63867
64042
 
63868
- oReq.onreadystatechange = async function() {
63869
- if(this.readyState == 4) {
63870
- if(this.status == 200) {
63871
- let data = oReq.response;
63872
-
63873
- await thisClass.CalcPhi(gsize, salt, contour, bSurface, data);
63874
- }
63875
- else {
63876
- var aaa = 1; //alert("The PQR file is unavailable...");
63877
- }
63878
- }
63879
- else {
63880
- ic.ParserUtilsCls.showLoading();
63881
- }
63882
- };
63883
-
63884
- oReq.send();
64043
+ await thisClass.CalcPhi(gsize, salt, contour, bSurface, data);
63885
64044
  }
63886
64045
 
63887
64046
  getPdbStr(bNode) { let ic = this.icn3d, me = ic.icn3dui;
@@ -63927,7 +64086,8 @@ class Delphi {
63927
64086
  let pdbstr = '';
63928
64087
  /// pdbstr += ic.saveFileCls.getPDBHeader();
63929
64088
 
63930
- pdbstr +=(me.cfg.cid) ? ic.saveFileCls.getAtomPDB(atomHash, true) : ic.saveFileCls.getAtomPDB(atomHash);
64089
+ let bMergeIntoOne = true;
64090
+ pdbstr +=(me.cfg.cid) ? ic.saveFileCls.getAtomPDB(atomHash, true, undefined, undefined, undefined, undefined, bMergeIntoOne) : ic.saveFileCls.getAtomPDB(atomHash, undefined, undefined, undefined, undefined, undefined, bMergeIntoOne);
63931
64091
  pdbstr += ic.saveFileCls.getAtomPDB(ionHash, true, undefined, true);
63932
64092
 
63933
64093
  return pdbstr;
@@ -63968,7 +64128,7 @@ class Delphi {
63968
64128
  }
63969
64129
 
63970
64130
  return new Promise(function(resolve, reject) {
63971
- // see full_ui.js for ajaxTransport
64131
+ // see icn3dui.js for ajaxTransport
63972
64132
  $.ajax({
63973
64133
  url: url,
63974
64134
  type: 'POST',
@@ -63992,7 +64152,7 @@ class Delphi {
63992
64152
  });
63993
64153
  }
63994
64154
 
63995
- PhiParser(url, type, contour, bSurface) { let ic = this.icn3d; ic.icn3dui;
64155
+ async PhiParser(url, type, contour, bSurface) { let ic = this.icn3d, me = ic.icn3dui;
63996
64156
  let thisClass = this;
63997
64157
  //var dataType;
63998
64158
 
@@ -64010,49 +64170,32 @@ class Delphi {
64010
64170
  }
64011
64171
  else {
64012
64172
  */
64013
- let oReq = new XMLHttpRequest();
64014
- oReq.open("GET", url, true);
64015
64173
 
64174
+ let responseType;
64016
64175
  if(type == 'phiurl' || type == 'phiurl2') {
64017
- oReq.responseType = "arraybuffer";
64176
+ responseType = "arraybuffer";
64018
64177
  }
64019
64178
  else {
64020
- oReq.responseType = "text";
64179
+ responseType = "text";
64021
64180
  }
64022
64181
 
64023
- oReq.onreadystatechange = function() {
64024
- if(this.readyState == 4) {
64025
- if(this.status == 200) {
64026
- let data = oReq.response;
64182
+ let data = await me.getXMLHttpRqstPromise(url, 'GET', responseType, 'potential');
64027
64183
 
64028
- if(type == 'phiurl' || type == 'phiurl2') {
64029
- thisClass.loadPhiData(data, contour, bSurface);
64030
- }
64031
- else {
64032
- thisClass.loadCubeData(data, contour, bSurface);
64033
- }
64034
-
64035
- ic.bAjaxPhi = true;
64036
-
64037
- if(bSurface) {
64038
- ic.setOptionCls.setOption('phisurface', 'phi');
64039
- }
64040
- else {
64041
- ic.setOptionCls.setOption('phimap', 'phi');
64042
- }
64043
- }
64044
- else {
64045
- var aaa = 1; //alert("The potential file is unavailable...");
64046
- }
64184
+ if(type == 'phiurl' || type == 'phiurl2') {
64185
+ thisClass.loadPhiData(data, contour, bSurface);
64186
+ }
64187
+ else {
64188
+ thisClass.loadCubeData(data, contour, bSurface);
64189
+ }
64047
64190
 
64048
- /// if(ic.deferredPhi !== undefined) ic.deferredPhi.resolve();
64049
- }
64050
- else {
64051
- ic.ParserUtilsCls.showLoading();
64052
- }
64053
- };
64191
+ ic.bAjaxPhi = true;
64054
64192
 
64055
- oReq.send();
64193
+ if(bSurface) {
64194
+ ic.setOptionCls.setOption('phisurface', 'phi');
64195
+ }
64196
+ else {
64197
+ ic.setOptionCls.setOption('phimap', 'phi');
64198
+ }
64056
64199
  // }
64057
64200
  }
64058
64201
 
@@ -64230,7 +64373,7 @@ class Delphi {
64230
64373
  await thisClass.CalcPhiUrl(gsize, salt, contour, bSurface, url);
64231
64374
  }
64232
64375
  else {
64233
- thisClass.PhiParser(url, type, contour, bSurface);
64376
+ await thisClass.PhiParser(url, type, contour, bSurface);
64234
64377
  }
64235
64378
  // }); // end of me.deferred = $.Deferred(function() {
64236
64379
 
@@ -64409,7 +64552,7 @@ class Delphi {
64409
64552
  await this.CalcPhiUrl(gsize, salt, contour, bSurface, url);
64410
64553
  }
64411
64554
  else {
64412
- this.PhiParser(url, type, contour, bSurface);
64555
+ await this.PhiParser(url, type, contour, bSurface);
64413
64556
  }
64414
64557
 
64415
64558
  if(bSurface) {
@@ -64917,7 +65060,8 @@ console.log("free energy: " + energy + " kcal/mol");
64917
65060
  }
64918
65061
  else {
64919
65062
  let atoms = me.hashUtilsCls.intHash(ic.dAtoms, ic.hAtoms);
64920
- pdbStr = ic.saveFileCls.getAtomPDB(atoms);
65063
+ let bMergeIntoOne = true;
65064
+ pdbStr = ic.saveFileCls.getAtomPDB(atoms, undefined, undefined, undefined, undefined, undefined, bMergeIntoOne);
64921
65065
  }
64922
65066
 
64923
65067
  let url = me.htmlCls.baseUrl + "scap/scap.cgi";
@@ -68838,7 +68982,7 @@ class SaveFile {
68838
68982
  }
68839
68983
 
68840
68984
  //getAtomPDB: function(atomHash, bPqr, bPdb, bNoChem) { let ic = this.icn3d, me = ic.icn3dui;
68841
- getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid) { let ic = this.icn3d, me = ic.icn3dui;
68985
+ getAtomPDB(atomHash, bPqr, bNoChem, bNoHeader, chainResi2pdb, pdbid, bMergeIntoOne) { let ic = this.icn3d, me = ic.icn3dui;
68842
68986
  let pdbStr = '';
68843
68987
 
68844
68988
  // get all phosphate groups in lipids
@@ -68991,6 +69135,7 @@ class SaveFile {
68991
69135
  let bMulStruc =(struArray.length > 1) ? true : false;
68992
69136
 
68993
69137
  let molNum = 1, prevStru = '', prevChain = '';
69138
+ let chainIndex = 0, fakeChain = '', chainNameArray = 'abcdefghijklmnopqrstuvwxyz0123456789';
68994
69139
 
68995
69140
  let addedChainResiHash = {};
68996
69141
  for(let i in atomHash) {
@@ -69001,20 +69146,22 @@ class SaveFile {
69001
69146
 
69002
69147
  //if(bMulStruc && atom.structure != prevStru) {
69003
69148
  if(atom.structure != prevStru) {
69004
- pdbStr += connStr;
69005
- connStr = '';
69149
+ if(!bMergeIntoOne || !bMulStruc) {
69150
+ pdbStr += connStr;
69151
+ connStr = '';
69006
69152
 
69007
- if(molNum > 1) pdbStr += '\nENDMDL\n';
69153
+ if(molNum > 1) pdbStr += '\nENDMDL\n';
69008
69154
 
69009
- if(bMulStruc) pdbStr += 'MODEL ' + molNum + '\n';
69155
+ if(bMulStruc) pdbStr += 'MODEL ' + molNum + '\n';
69156
+ }
69010
69157
 
69011
69158
  // add header
69012
69159
  let mutantInfo = (chainResi2pdb) ? "Mutated chain_residue " + Object.keys(chainResi2pdb) + '; ' : '';
69013
69160
  if(!bNoHeader) {
69014
69161
  //pdbStr += this.getPDBHeader(molNum - 1, stru2header, mutantInfo, pdbid);
69015
69162
 
69016
- // make sur ethe PDB ID is correct
69017
- pdbStr += this.getPDBHeader(molNum - 1, stru2header, mutantInfo, atom.structure);
69163
+ // make sure the PDB ID is correct
69164
+ if(!bMergeIntoOne || !bMulStruc) pdbStr += this.getPDBHeader(molNum - 1, stru2header, mutantInfo, atom.structure);
69018
69165
 
69019
69166
  //pdbStr += '\n'; // separate from incomplete secondary structures
69020
69167
  }
@@ -69022,6 +69169,7 @@ class SaveFile {
69022
69169
  //prevStru = atom.structure;
69023
69170
  ++molNum;
69024
69171
  }
69172
+
69025
69173
  //else {
69026
69174
  //if(atom.chain != prevChain) {
69027
69175
  if(atom.chain != prevChain && atom.structure == prevStru) {
@@ -69095,17 +69243,28 @@ class SaveFile {
69095
69243
  */
69096
69244
 
69097
69245
  line +=(resn.length <= 3) ? resn.padStart(3, ' ') : resn.substr(0, 3);
69098
- //line += ' ';
69099
- //line +=(atom.chain.length <= 1) ? atom.chain.padStart(1, ' ') : atom.chain.substr(0, 1);
69100
- if(atom.chain.length >= 2) {
69101
- let chainTmp = atom.chain.replace(/_/gi, '').substr(0, 2);
69102
- line += chainTmp;
69103
- }
69104
- else if(atom.chain.length == 1) {
69105
- line += ' ' + atom.chain.substr(0, 1);
69246
+
69247
+ if(bMergeIntoOne && molNum > 2 && (ic.proteins.hasOwnProperty(atom.serial) || ic.nucleotides.hasOwnProperty(atom.serial))) {
69248
+ if(atom.structure != prevStru || atom.chain != prevChain) {
69249
+ fakeChain = (chainIndex < 36) ? chainNameArray[chainIndex] : '?';
69250
+ ++chainIndex;
69251
+ }
69252
+
69253
+ line += ' ' + fakeChain;
69106
69254
  }
69107
- else if(atom.chain.length == 0) {
69108
- line += ' A';
69255
+ else {
69256
+ //line += ' ';
69257
+ //line +=(atom.chain.length <= 1) ? atom.chain.padStart(1, ' ') : atom.chain.substr(0, 1);
69258
+ if(atom.chain.length >= 2) {
69259
+ let chainTmp = atom.chain.replace(/_/gi, '').substr(0, 2);
69260
+ line += chainTmp;
69261
+ }
69262
+ else if(atom.chain.length == 1) {
69263
+ line += ' ' + atom.chain.substr(0, 1);
69264
+ }
69265
+ else if(atom.chain.length == 0) {
69266
+ line += ' A';
69267
+ }
69109
69268
  }
69110
69269
 
69111
69270
  let resi = atom.resi;
@@ -69201,9 +69360,11 @@ class SaveFile {
69201
69360
  prevChain = atom.chain;
69202
69361
  }
69203
69362
 
69204
- pdbStr += connStr;
69205
-
69206
- if(bMulStruc) pdbStr += '\nENDMDL\n';
69363
+ if(!bMergeIntoOne || !bMulStruc) {
69364
+ pdbStr += connStr;
69365
+
69366
+ if(bMulStruc) pdbStr += '\nENDMDL\n';
69367
+ }
69207
69368
 
69208
69369
  return pdbStr;
69209
69370
  }
@@ -69723,14 +69884,7 @@ class ShareLink {
69723
69884
  }
69724
69885
 
69725
69886
  // add time stamp
69726
- let date = new Date();
69727
- let monthStr =(date.getMonth() + 1).toString();
69728
- if(date.getMonth() + 1 < 10) monthStr = '0' + monthStr;
69729
-
69730
- let dateStr = date.getDate().toString();
69731
- if(date.getDate() < 10) dateStr = '0' + dateStr;
69732
-
69733
- let dateAllStr = date.getFullYear().toString() + monthStr + dateStr;
69887
+ let dateAllStr = me.utilsCls.getDateDigitStr();
69734
69888
  if(!bPrevDate) url += 'date=' + dateAllStr + '&';
69735
69889
  url += 'v=' + me.REVISION + '&';
69736
69890
 
@@ -72695,7 +72849,7 @@ class iCn3DUI {
72695
72849
  //even when multiple iCn3D viewers are shown together.
72696
72850
  this.pre = this.cfg.divid + "_";
72697
72851
 
72698
- this.REVISION = '3.28.2';
72852
+ this.REVISION = '3.28.4';
72699
72853
 
72700
72854
  // In nodejs, iCn3D defines "window = {navigator: {}}"
72701
72855
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -72902,16 +73056,17 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
72902
73056
  }
72903
73057
  }
72904
73058
 
72905
- // realign
72906
- ic.chainidArray = [chain_t].concat(chainidArray);
72907
- ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
72908
-
73059
+ // get the matched structures, do not include the template
72909
73060
  let mmdbafid = '';
72910
- for(let i = 0, il = ic.chainidArray.length; i < il; ++i) {
73061
+ for(let i = 0, il = chainidArray.length; i < il; ++i) {
72911
73062
  if(i > 0) mmdbafid += ',';
72912
- mmdbafid += ic.chainidArray[i].substr(0, ic.chainidArray[i].indexOf('_'));
73063
+ mmdbafid += chainidArray[i].substr(0, chainidArray[i].indexOf('_'));
72913
73064
  }
72914
73065
 
73066
+ // realign, include the template
73067
+ ic.chainidArray = [chain_t].concat(chainidArray);
73068
+ ic.chainidArray = ic.chainalignParserCls.addPostfixForChainids(ic.chainidArray);
73069
+
72915
73070
  me.htmlCls.clickMenuCls.setLogCmd('resdef ' + me.cfg.resdef, true);
72916
73071
 
72917
73072
  ic.loadCmd = 'vast_search_chainid ' + ic.chainidArray;
@@ -73127,7 +73282,7 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
73127
73282
  // ic.bNCBI = true;
73128
73283
 
73129
73284
  // remove space
73130
- me.cfg.mmdbafid = me.cfg.mmdbafid.replace(/\s+/g, '');
73285
+ me.cfg.mmdbafid = me.cfg.mmdbafid.replace(/\s+/g, '').toUpperCase();
73131
73286
 
73132
73287
  ic.bMmdbafid = true;
73133
73288
  ic.inputid = me.cfg.mmdbafid;
@@ -73216,6 +73371,44 @@ iCn3DUI.prototype.getMmtfReducedPromise = function(mmtfid) { return new Promi
73216
73371
  });
73217
73372
  };
73218
73373
 
73374
+ iCn3DUI.prototype.getXMLHttpRqstPromise = function(url, dataType, responseType, mapType) { let me = this;
73375
+ return new Promise(function(resolve, reject) {
73376
+ let oReq = new XMLHttpRequest();
73377
+ oReq.open(dataType, url, true);
73378
+ oReq.responseType = responseType;
73379
+
73380
+ oReq.onreadystatechange = function() {
73381
+ if (this.readyState == 4) {
73382
+ if(this.status == 200) {
73383
+ let arrayBuffer = oReq.response;
73384
+ resolve(arrayBuffer);
73385
+ }
73386
+ else {
73387
+ if(mapType == '2fofc' || mapType == 'fofc') {
73388
+ var aaa = 1; //alert("Density server at EBI has no corresponding electron density map for this structure.");
73389
+ }
73390
+ else if(mapType == 'em') {
73391
+ var aaa = 1; //alert("Density server at EBI has no corresponding EM density map for this structure.");
73392
+ }
73393
+ else if(mapType == 'rcsbEdmaps') {
73394
+ var aaa = 1; //alert("RCSB server has no corresponding eletron density map for this structure.");
73395
+ }
73396
+ else {
73397
+ var aaa = 1; //alert("The " + mapType + " file is unavailable...");
73398
+ }
73399
+
73400
+ reject('error');
73401
+ }
73402
+ }
73403
+ else {
73404
+ me.icn3d.ParserUtilsCls.showLoading();
73405
+ }
73406
+ };
73407
+
73408
+ oReq.send();
73409
+ });
73410
+ };
73411
+
73219
73412
  iCn3DUI.prototype.getAjaxPromise = function(url, dataType, beforeSend, alertMess, logMess, complete, bNode) { let me = this;
73220
73413
  // if(!bNode || dataType != 'json') {
73221
73414
  return new Promise(function(resolve, reject) {