icn3d 3.19.3 → 3.19.4

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
@@ -29029,6 +29029,7 @@ class LoadScript {
29029
29029
  if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
29030
29030
 
29031
29031
  if(me.deferred !== undefined) me.deferred.resolve(); if(ic.deferred2 !== undefined) ic.deferred2.resolve();
29032
+ if(me.deferredMmdbaf !== undefined) me.deferredMmdbaf.resolve();
29032
29033
  }
29033
29034
 
29034
29035
  replayFirstStep(currentNumber) { let ic = this.icn3d, me = ic.icn3dui;
@@ -29738,7 +29739,7 @@ class Domain3d {
29738
29739
  //list< pair< pair< int, let >, let > >
29739
29740
  //c2b_AlphaContacts(let n0, let* x0, let* y0, let* z0,
29740
29741
  // const let incr = 4, const let dcut = 8.0) { let ic = this.icn3d, me = ic.icn3dui;
29741
- c2b_AlphaContacts(n0, x0, y0, z0, dcut) { let ic = this.icn3d; ic.icn3dui;
29742
+ c2b_AlphaContacts(n0, x0, y0, z0, dcut, resiArray) { let ic = this.icn3d; ic.icn3dui;
29742
29743
  //if(!incr) incr = 4;
29743
29744
  if(!dcut) dcut = this.dcut;
29744
29745
 
@@ -29752,7 +29753,8 @@ class Domain3d {
29752
29753
 
29753
29754
  //ResRec rr0;
29754
29755
  let rr0 = {};
29755
- rr0.rnum = i + 1;
29756
+ //rr0.rnum = i + 1;
29757
+ rr0.rnum = resiArray[i];
29756
29758
  rr0.x = x0[i];
29757
29759
  rr0.y = y0[i];
29758
29760
  rr0.z = z0[i];
@@ -29780,7 +29782,7 @@ class Domain3d {
29780
29782
  for (j = i + 1; j < len; ++j) {
29781
29783
  //ResRec rr2 = *rrit2;
29782
29784
  let rr2 = list_rr[j];
29783
- if ((rr1.rnum - rr2.rnum <= 3) && (rr2.rnum - rr1.rnum <= 3)) continue;
29785
+ if ((parseInt(rr1.rnum) - parseInt(rr2.rnum) <= 3) && (parseInt(rr2.rnum) - parseInt(rr1.rnum) <= 3)) continue;
29784
29786
  let x2 = rr2.x;
29785
29787
  let y2 = rr2.y;
29786
29788
  let z2 = rr2.z;
@@ -29798,7 +29800,7 @@ class Domain3d {
29798
29800
  //pair< int, let > rpair;
29799
29801
  let lpair = {}, rpair = {};
29800
29802
 
29801
- if (rr1.rnum < rr2.rnum) {
29803
+ if (parseInt(rr1.rnum) < parseInt(rr2.rnum)) {
29802
29804
  rpair.first = rr1.rnum;
29803
29805
  rpair.second = rr2.rnum;
29804
29806
  }
@@ -29888,7 +29890,7 @@ class Domain3d {
29888
29890
  // x0, y0, z0: array of x,y,z coordinates of C-alpha atoms
29889
29891
  //c2b_NewSplitChain(chnid, dcut) { let ic = this.icn3d, me = ic.icn3dui;
29890
29892
  c2b_NewSplitChain(atoms, dcut) { let ic = this.icn3d; ic.icn3dui;
29891
- let x0 = [], y0 = [], z0 = [];
29893
+ let x0 = [], y0 = [], z0 = [], resiArray = [];
29892
29894
 
29893
29895
  //substruct: array of secondary structures, each of which has the keys: From (1-based), To (1-based), Sheet (0 or 1), also add these paras: x1, y1, z1, x2, y2, z2
29894
29896
  let substruct = [];
@@ -29903,11 +29905,11 @@ class Domain3d {
29903
29905
  residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
29904
29906
 
29905
29907
  let substructItem = {};
29906
- let resiOffset = 0;
29907
29908
  for(let i = 0; i < residueArray.length; ++i) {
29908
29909
  let resid = residueArray[i];
29909
29910
 
29910
29911
  let resi = resid.substr(resid.lastIndexOf('_') + 1);
29912
+ /*
29911
29913
  if(i == 0) {
29912
29914
  resiOffset = resi - 1;
29913
29915
 
@@ -29917,10 +29919,13 @@ class Domain3d {
29917
29919
  z0.push(undefined);
29918
29920
  }
29919
29921
  }
29922
+ */
29920
29923
 
29921
29924
  //let resid = chnid + "_" + resi;
29922
29925
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
29923
29926
 
29927
+ if(!atom) continue;
29928
+ /*
29924
29929
  if(atom) {
29925
29930
  x0.push(atom.coord.x);
29926
29931
  y0.push(atom.coord.y);
@@ -29931,8 +29936,13 @@ class Domain3d {
29931
29936
  y0.push(undefined);
29932
29937
  z0.push(undefined);
29933
29938
  }
29934
-
29935
- if(!atom) continue;
29939
+ */
29940
+ //if(!atom) continue;
29941
+
29942
+ x0.push(atom.coord.x);
29943
+ y0.push(atom.coord.y);
29944
+ z0.push(atom.coord.z);
29945
+ resiArray.push(resi);
29936
29946
 
29937
29947
  if(atom.ssend) {
29938
29948
  substructItem.To = parseInt(resi);
@@ -29966,12 +29976,13 @@ class Domain3d {
29966
29976
  return {subdomains: subdomains, substruct: substruct};
29967
29977
  }
29968
29978
 
29969
- let seqLen = residueArray.length + resiOffset;
29979
+ let seqLen = residueArray.length; // + resiOffset;
29980
+ let lastResi = resiArray[seqLen - 1];
29970
29981
 
29971
29982
  // get a list of Calpha-Calpha contacts
29972
29983
  ///list< pair< pair< int, let >, let > >
29973
- let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut);
29974
-
29984
+ let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut, resiArray);
29985
+
29975
29986
  //
29976
29987
  // Produce a "map" of the SSEs, i.e. vec_sse[i] = 0 means residue i + 1
29977
29988
  // is in a loop, and vec_sse[i] = k means residue i + 1 belongs to SSE
@@ -30216,13 +30227,17 @@ class Domain3d {
30216
30227
  let prts = list_parts[index];
30217
30228
  //vector<int> resflags;
30218
30229
  //resflags.clear();
30219
- let resflags = [];
30230
+
30231
+ //let resflags = [];
30232
+ let resflags = {};
30220
30233
 
30221
30234
  // a domain must have at least 3 SSEs...
30222
30235
  if (prts.length <= 2) continue;
30223
30236
 
30224
- for (let i = 0; i < seqLen; i++)
30225
- resflags.push(0);
30237
+ for (let i = 0; i < seqLen; i++) {
30238
+ //resflags.push(0);
30239
+ resflags[resiArray[i]] = 0;
30240
+ }
30226
30241
 
30227
30242
  for (let i = 0; i < prts.length; i++) {
30228
30243
  let k = prts[i] - 1;
@@ -30236,8 +30251,10 @@ class Domain3d {
30236
30251
  let From = sserec.From;
30237
30252
  let To = sserec.To;
30238
30253
 
30239
- for (let j = From; j <= To; j++)
30240
- resflags[j - 1] = 1;
30254
+ for (let j = From; j <= To; j++) {
30255
+ //resflags[j - 1] = 1;
30256
+ resflags[j] = 1;
30257
+ }
30241
30258
 
30242
30259
  if ((k == 0) && (From > 1)) {
30243
30260
  // residues with negative residue numbers will not be included
@@ -30245,17 +30262,21 @@ class Domain3d {
30245
30262
  //resflags[j - 1] = 1;
30246
30263
  // include at most 10 residues
30247
30264
  if(From - j <= 10) {
30248
- resflags[j - 1] = 1;
30265
+ //resflags[j - 1] = 1;
30266
+ resflags[j] = 1;
30249
30267
  }
30250
30268
  }
30251
30269
  }
30252
30270
 
30253
- if ((k == substruct.length - 1) && (To < seqLen)) {
30254
- for (let j = To + 1; j <= seqLen; j++) {
30271
+ //if ((k == substruct.length - 1) && (To < seqLen)) {
30272
+ if ((k == substruct.length - 1) && (To < parseInt(lastResi))) {
30273
+ //for (let j = To + 1; j <= seqLen; j++) {
30274
+ for (let j = To + 1; j <= parseInt(lastResi); j++) {
30255
30275
  //resflags[j - 1] = 1;
30256
30276
  // include at most 10 residues
30257
30277
  if(j - To <= 10) {
30258
- resflags[j - 1] = 1;
30278
+ //resflags[j - 1] = 1;
30279
+ resflags[j] = 1;
30259
30280
  }
30260
30281
  }
30261
30282
  }
@@ -30269,8 +30290,10 @@ class Domain3d {
30269
30290
  let ll = parseInt(0.5 * (From - To1 - 1));
30270
30291
 
30271
30292
  if (ll > 0) {
30272
- for (let j = From - ll; j <= From - 1; j++)
30273
- resflags[j - 1] = 1;
30293
+ for (let j = From - ll; j <= From - 1; j++) {
30294
+ //resflags[j - 1] = 1;
30295
+ resflags[j] = 1;
30296
+ }
30274
30297
  }
30275
30298
  }
30276
30299
 
@@ -30286,8 +30309,10 @@ class Domain3d {
30286
30309
  let ll = parseInt(0.5 * (From1 - To - 1) + 0.5);
30287
30310
 
30288
30311
  if (ll > 0) {
30289
- for (let j = To + 1; j <= To + ll; j++)
30290
- resflags[j - 1] = 1;
30312
+ for (let j = To + 1; j <= To + ll; j++) {
30313
+ //resflags[j - 1] = 1;
30314
+ resflags[j] = 1;
30315
+ }
30291
30316
  }
30292
30317
  }
30293
30318
  }
@@ -30300,11 +30325,13 @@ class Domain3d {
30300
30325
  let segments = [];
30301
30326
 
30302
30327
  for (let i = 0; i < seqLen; i++) {
30303
- let rf = resflags[i];
30328
+ //let rf = resflags[i];
30329
+ let rf = resflags[resiArray[i]];
30304
30330
 
30305
30331
  if (!inseg && (rf == 1)) {
30306
30332
  // new segment starts here
30307
- startseg = i + 1;
30333
+ //startseg = i + 1;
30334
+ startseg = resiArray[i];
30308
30335
  inseg = true;
30309
30336
  continue;
30310
30337
  }
@@ -30312,7 +30339,8 @@ class Domain3d {
30312
30339
  if (inseg && (rf == 0)) {
30313
30340
  // segment ends
30314
30341
  segments.push(startseg);
30315
- segments.push(i);
30342
+ //segments.push(i);
30343
+ segments.push(resiArray[i]);
30316
30344
  inseg = false;
30317
30345
  }
30318
30346
  }
@@ -30320,7 +30348,8 @@ class Domain3d {
30320
30348
  // check for the last segment
30321
30349
  if (inseg) {
30322
30350
  segments.push(startseg);
30323
- segments.push(seqLen);
30351
+ //segments.push(seqLen);
30352
+ segments.push(lastResi);
30324
30353
  }
30325
30354
 
30326
30355
  subdomains.push(segments);
@@ -37710,7 +37739,7 @@ class ParserUtils {
37710
37739
  ic.selectionCls.saveSelectionIfSelected();
37711
37740
  ic.drawCls.draw();
37712
37741
  }
37713
-
37742
+
37714
37743
  // if(ic.bInitial && me.cfg.command !== undefined && me.cfg.command !== '') {
37715
37744
  if(!ic.bCommandLoad && ic.bInitial && me.cfg.command !== undefined && me.cfg.command !== '') {
37716
37745
  if(Object.keys(ic.structures).length == 1) {
@@ -37718,11 +37747,13 @@ class ParserUtils {
37718
37747
  me.cfg.command = me.cfg.command.replace(new RegExp('!','g'), id + '_');
37719
37748
  }
37720
37749
  // final step resolved ic.deferred
37721
- if(me.cfg.mmdbafid === undefined && me.cfg.afid === undefined) ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
37750
+ //if(me.cfg.mmdbafid === undefined && me.cfg.afid === undefined) ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
37751
+ ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
37722
37752
  //ic.loadScriptCls.loadScript(me.cfg.command);
37723
37753
  }
37724
37754
  else {
37725
37755
  if(me.deferred !== undefined) me.deferred.resolve(); if(ic.deferred2 !== undefined) ic.deferred2.resolve();
37756
+ if(me.deferredMmdbaf !== undefined) me.deferredMmdbaf.resolve();
37726
37757
  }
37727
37758
  //if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined || ic.bRealign ||( ic.bInputfile && ic.InputfileType == 'pdb' && Object.keys(ic.structures).length >= 2) ) {
37728
37759
  if(Object.keys(ic.structures).length >= 2) {
@@ -67857,7 +67888,8 @@ class Vastplus {
67857
67888
 
67858
67889
  let pdbAjaxArray = [];
67859
67890
  for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
67860
- let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
67891
+ //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
67892
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
67861
67893
 
67862
67894
  let pdbAjax = $.ajax({
67863
67895
  url: urlpdb,
@@ -67906,7 +67938,7 @@ class Vastplus {
67906
67938
  // align each 3D domain with reference structure
67907
67939
  let result = ic.domain3dCls.c2b_NewSplitChain(ic.chains[chainid]);
67908
67940
  let subdomains = result.subdomains;
67909
-
67941
+
67910
67942
  let domainAtomsArray = [];
67911
67943
  if(subdomains.length <= 1) {
67912
67944
  domainAtomsArray.push(ic.chains[chainid]);
@@ -67920,6 +67952,7 @@ class Vastplus {
67920
67952
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
67921
67953
  let domainAtoms = {};
67922
67954
  let segArray = subdomains[k];
67955
+
67923
67956
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
67924
67957
  let startResi = segArray[m];
67925
67958
  let endResi = segArray[m+1];
@@ -67933,10 +67966,9 @@ class Vastplus {
67933
67966
  domainAtomsArray.push(domainAtoms);
67934
67967
  }
67935
67968
  }
67936
-
67969
+
67937
67970
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
67938
67971
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
67939
-
67940
67972
  let domainid = chainid + '-' + k;
67941
67973
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
67942
67974
  let struct2 = "stru" + index;
@@ -68028,14 +68060,14 @@ console.log(domainid + ' TM-score: ' + domainid2score[domainid] + ' matched ' +
68028
68060
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
68029
68061
  }
68030
68062
  }
68031
-
68063
+
68032
68064
  // combine domainid into chainid
68033
68065
  for(let domainid in domainid2segs) {
68034
68066
  let chainid = domainid.split('-')[0];
68035
68067
  if(!chainid2segs[chainid]) chainid2segs[chainid] = [];
68036
68068
  chainid2segs[chainid] = chainid2segs[chainid].concat(domainid2segs[domainid]);
68037
68069
  }
68038
-
68070
+
68039
68071
  // assign ic.resid2refnum, ic.refnum2residArray, ic.chainsMapping
68040
68072
  if(!ic.resid2refnum) ic.resid2refnum = {};
68041
68073
  if(!ic.refnum2residArray) ic.refnum2residArray = {};