icn3d 3.19.2 → 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
@@ -19929,7 +19929,7 @@ class Symd {
19929
19929
  url: url,
19930
19930
  type: 'POST',
19931
19931
  data : dataObj,
19932
- dataType: "jsonp",
19932
+ dataType: "json",
19933
19933
  cache: true,
19934
19934
  tryCount : 0,
19935
19935
  retryLimit : 0, //1
@@ -22783,7 +22783,6 @@ class Dssp {
22783
22783
 
22784
22784
  let url = (window && window.location && window.location.hostname.indexOf('ncbi.nlm.nih.gov') != -1) ? "/Structure/mmcifparser/mmcifparser.cgi" :
22785
22785
  me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi";
22786
- //let url = "https://www.ncbi.nlm.nih.gov/Structure/mmcifparser/mmcifparser.cgi";
22787
22786
 
22788
22787
  for(let i = 0, il = struArray.length; i < il; ++i) {
22789
22788
  let pdbStr = '';
@@ -22802,7 +22801,8 @@ class Dssp {
22802
22801
  url: url,
22803
22802
  type: 'POST',
22804
22803
  data: {'dssp':'t', 'calphaonly': calphaonly, 'pdbfile': pdbStr},
22805
- dataType: 'jsonp',
22804
+ //dataType: 'jsonp',
22805
+ dataType: 'json',
22806
22806
  cache: true
22807
22807
  });
22808
22808
 
@@ -25061,7 +25061,7 @@ class RealignParser {
25061
25061
  url: urlalign,
25062
25062
  type: 'POST',
25063
25063
  data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25064
- dataType: 'jsonp',
25064
+ dataType: 'json',
25065
25065
  cache: true
25066
25066
  });
25067
25067
  }
@@ -25076,7 +25076,7 @@ class RealignParser {
25076
25076
  url: urltmalign,
25077
25077
  type: 'POST',
25078
25078
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
25079
- dataType: 'jsonp',
25079
+ dataType: 'json',
25080
25080
  cache: true
25081
25081
  });
25082
25082
  }
@@ -25285,7 +25285,7 @@ class RealignParser {
25285
25285
  url: url,
25286
25286
  type: 'POST',
25287
25287
  data : {'targets': seq1, 'queries': seq2},
25288
- dataType: 'jsonp',
25288
+ dataType: 'json',
25289
25289
  cache: true
25290
25290
  });
25291
25291
 
@@ -25357,7 +25357,7 @@ class RealignParser {
25357
25357
  url: url,
25358
25358
  type: 'POST',
25359
25359
  data : {'targets': seq1, 'queries': seq2},
25360
- dataType: 'jsonp',
25360
+ dataType: 'json',
25361
25361
  cache: true
25362
25362
  });
25363
25363
 
@@ -25562,7 +25562,7 @@ class ChainalignParser {
25562
25562
  url: urlalign,
25563
25563
  type: 'POST',
25564
25564
  data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25565
- dataType: 'jsonp',
25565
+ dataType: 'json',
25566
25566
  cache: true
25567
25567
  });
25568
25568
  }
@@ -25574,7 +25574,7 @@ class ChainalignParser {
25574
25574
  url: urltmalign,
25575
25575
  type: 'POST',
25576
25576
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
25577
- dataType: 'jsonp',
25577
+ dataType: 'json',
25578
25578
  cache: true
25579
25579
  });
25580
25580
  }
@@ -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);
@@ -31127,7 +31156,7 @@ class AddTrack {
31127
31156
  url: url,
31128
31157
  type: 'POST',
31129
31158
  data : {'targets': chainid, 'queries': gi},
31130
- dataType: 'jsonp',
31159
+ dataType: 'json',
31131
31160
  //dataType: 'json',
31132
31161
  tryCount : 0,
31133
31162
  retryLimit : 0, //1
@@ -31176,7 +31205,7 @@ class AddTrack {
31176
31205
  url: url,
31177
31206
  type: 'POST',
31178
31207
  data : {'targets': targets, 'queries': fasta},
31179
- dataType: 'jsonp',
31208
+ dataType: 'json',
31180
31209
  //dataType: 'json',
31181
31210
  tryCount : 0,
31182
31211
  retryLimit : 0, //1
@@ -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) {
@@ -37961,7 +37992,7 @@ class MmcifParser {
37961
37992
  url: url,
37962
37993
  type: 'POST',
37963
37994
  data : {'mmciffile': data},
37964
- dataType: 'jsonp',
37995
+ dataType: 'json',
37965
37996
  cache: true,
37966
37997
  tryCount : 0,
37967
37998
  retryLimit : 0, //1
@@ -38175,7 +38206,7 @@ class MmcifParser {
38175
38206
  url: url,
38176
38207
  type: 'POST',
38177
38208
  data : {'mmcifheader': data},
38178
- dataType: 'jsonp',
38209
+ dataType: 'json',
38179
38210
  cache: true,
38180
38211
  tryCount : 0,
38181
38212
  retryLimit : 0, //1
@@ -39001,7 +39032,7 @@ class ShowAnno {
39001
39032
  url: url,
39002
39033
  type: 'POST',
39003
39034
  data : dataObj,
39004
- dataType: 'jsonp',
39035
+ dataType: 'json',
39005
39036
  //dataType: 'json',
39006
39037
  tryCount : 0,
39007
39038
  retryLimit : 0, //1
@@ -62429,7 +62460,7 @@ class Events {
62429
62460
  url: url,
62430
62461
  type: 'POST',
62431
62462
  data : {'mmciffile': dataStr},
62432
- dataType: 'jsonp',
62463
+ dataType: 'json',
62433
62464
  cache: true,
62434
62465
  tryCount : 0,
62435
62466
  retryLimit : 0, //1
@@ -67146,7 +67177,7 @@ class Vastplus {
67146
67177
  url: urltmalign,
67147
67178
  type: 'POST',
67148
67179
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
67149
- dataType: 'jsonp',
67180
+ dataType: 'json',
67150
67181
  cache: true
67151
67182
  });
67152
67183
 
@@ -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;
@@ -67949,7 +67981,7 @@ class Vastplus {
67949
67981
  url: urltmalign,
67950
67982
  type: 'POST',
67951
67983
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]},
67952
- dataType: 'jsonp',
67984
+ dataType: 'json',
67953
67985
  cache: true
67954
67986
  });
67955
67987
 
@@ -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 = {};