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.module.js CHANGED
@@ -20829,7 +20829,7 @@ class Symd {
20829
20829
  url: url,
20830
20830
  type: 'POST',
20831
20831
  data : dataObj,
20832
- dataType: "jsonp",
20832
+ dataType: "json",
20833
20833
  cache: true,
20834
20834
  tryCount : 0,
20835
20835
  retryLimit : 0, //1
@@ -23683,7 +23683,6 @@ class Dssp {
23683
23683
 
23684
23684
  let url = (window && window.location && window.location.hostname.indexOf('ncbi.nlm.nih.gov') != -1) ? "/Structure/mmcifparser/mmcifparser.cgi" :
23685
23685
  me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi";
23686
- //let url = "https://www.ncbi.nlm.nih.gov/Structure/mmcifparser/mmcifparser.cgi";
23687
23686
 
23688
23687
  for(let i = 0, il = struArray.length; i < il; ++i) {
23689
23688
  let pdbStr = '';
@@ -23702,7 +23701,8 @@ class Dssp {
23702
23701
  url: url,
23703
23702
  type: 'POST',
23704
23703
  data: {'dssp':'t', 'calphaonly': calphaonly, 'pdbfile': pdbStr},
23705
- dataType: 'jsonp',
23704
+ //dataType: 'jsonp',
23705
+ dataType: 'json',
23706
23706
  cache: true
23707
23707
  });
23708
23708
 
@@ -25961,7 +25961,7 @@ class RealignParser {
25961
25961
  url: urlalign,
25962
25962
  type: 'POST',
25963
25963
  data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
25964
- dataType: 'jsonp',
25964
+ dataType: 'json',
25965
25965
  cache: true
25966
25966
  });
25967
25967
  }
@@ -25976,7 +25976,7 @@ class RealignParser {
25976
25976
  url: urltmalign,
25977
25977
  type: 'POST',
25978
25978
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
25979
- dataType: 'jsonp',
25979
+ dataType: 'json',
25980
25980
  cache: true
25981
25981
  });
25982
25982
  }
@@ -26185,7 +26185,7 @@ class RealignParser {
26185
26185
  url: url,
26186
26186
  type: 'POST',
26187
26187
  data : {'targets': seq1, 'queries': seq2},
26188
- dataType: 'jsonp',
26188
+ dataType: 'json',
26189
26189
  cache: true
26190
26190
  });
26191
26191
 
@@ -26257,7 +26257,7 @@ class RealignParser {
26257
26257
  url: url,
26258
26258
  type: 'POST',
26259
26259
  data : {'targets': seq1, 'queries': seq2},
26260
- dataType: 'jsonp',
26260
+ dataType: 'json',
26261
26261
  cache: true
26262
26262
  });
26263
26263
 
@@ -26462,7 +26462,7 @@ class ChainalignParser {
26462
26462
  url: urlalign,
26463
26463
  type: 'POST',
26464
26464
  data: {'domains1': jsonStr_q, 'domains2': jsonStr_t},
26465
- dataType: 'jsonp',
26465
+ dataType: 'json',
26466
26466
  cache: true
26467
26467
  });
26468
26468
  }
@@ -26474,7 +26474,7 @@ class ChainalignParser {
26474
26474
  url: urltmalign,
26475
26475
  type: 'POST',
26476
26476
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
26477
- dataType: 'jsonp',
26477
+ dataType: 'json',
26478
26478
  cache: true
26479
26479
  });
26480
26480
  }
@@ -29929,6 +29929,7 @@ class LoadScript {
29929
29929
  if(ic.bTransparentSurface && ic.bRender) ic.drawCls.render();
29930
29930
 
29931
29931
  if(me.deferred !== undefined) me.deferred.resolve(); if(ic.deferred2 !== undefined) ic.deferred2.resolve();
29932
+ if(me.deferredMmdbaf !== undefined) me.deferredMmdbaf.resolve();
29932
29933
  }
29933
29934
 
29934
29935
  replayFirstStep(currentNumber) { let ic = this.icn3d, me = ic.icn3dui;
@@ -30638,7 +30639,7 @@ class Domain3d {
30638
30639
  //list< pair< pair< int, let >, let > >
30639
30640
  //c2b_AlphaContacts(let n0, let* x0, let* y0, let* z0,
30640
30641
  // const let incr = 4, const let dcut = 8.0) { let ic = this.icn3d, me = ic.icn3dui;
30641
- c2b_AlphaContacts(n0, x0, y0, z0, dcut) { let ic = this.icn3d; ic.icn3dui;
30642
+ c2b_AlphaContacts(n0, x0, y0, z0, dcut, resiArray) { let ic = this.icn3d; ic.icn3dui;
30642
30643
  //if(!incr) incr = 4;
30643
30644
  if(!dcut) dcut = this.dcut;
30644
30645
 
@@ -30652,7 +30653,8 @@ class Domain3d {
30652
30653
 
30653
30654
  //ResRec rr0;
30654
30655
  let rr0 = {};
30655
- rr0.rnum = i + 1;
30656
+ //rr0.rnum = i + 1;
30657
+ rr0.rnum = resiArray[i];
30656
30658
  rr0.x = x0[i];
30657
30659
  rr0.y = y0[i];
30658
30660
  rr0.z = z0[i];
@@ -30680,7 +30682,7 @@ class Domain3d {
30680
30682
  for (j = i + 1; j < len; ++j) {
30681
30683
  //ResRec rr2 = *rrit2;
30682
30684
  let rr2 = list_rr[j];
30683
- if ((rr1.rnum - rr2.rnum <= 3) && (rr2.rnum - rr1.rnum <= 3)) continue;
30685
+ if ((parseInt(rr1.rnum) - parseInt(rr2.rnum) <= 3) && (parseInt(rr2.rnum) - parseInt(rr1.rnum) <= 3)) continue;
30684
30686
  let x2 = rr2.x;
30685
30687
  let y2 = rr2.y;
30686
30688
  let z2 = rr2.z;
@@ -30698,7 +30700,7 @@ class Domain3d {
30698
30700
  //pair< int, let > rpair;
30699
30701
  let lpair = {}, rpair = {};
30700
30702
 
30701
- if (rr1.rnum < rr2.rnum) {
30703
+ if (parseInt(rr1.rnum) < parseInt(rr2.rnum)) {
30702
30704
  rpair.first = rr1.rnum;
30703
30705
  rpair.second = rr2.rnum;
30704
30706
  }
@@ -30788,7 +30790,7 @@ class Domain3d {
30788
30790
  // x0, y0, z0: array of x,y,z coordinates of C-alpha atoms
30789
30791
  //c2b_NewSplitChain(chnid, dcut) { let ic = this.icn3d, me = ic.icn3dui;
30790
30792
  c2b_NewSplitChain(atoms, dcut) { let ic = this.icn3d; ic.icn3dui;
30791
- let x0 = [], y0 = [], z0 = [];
30793
+ let x0 = [], y0 = [], z0 = [], resiArray = [];
30792
30794
 
30793
30795
  //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
30794
30796
  let substruct = [];
@@ -30803,11 +30805,11 @@ class Domain3d {
30803
30805
  residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
30804
30806
 
30805
30807
  let substructItem = {};
30806
- let resiOffset = 0;
30807
30808
  for(let i = 0; i < residueArray.length; ++i) {
30808
30809
  let resid = residueArray[i];
30809
30810
 
30810
30811
  let resi = resid.substr(resid.lastIndexOf('_') + 1);
30812
+ /*
30811
30813
  if(i == 0) {
30812
30814
  resiOffset = resi - 1;
30813
30815
 
@@ -30817,10 +30819,13 @@ class Domain3d {
30817
30819
  z0.push(undefined);
30818
30820
  }
30819
30821
  }
30822
+ */
30820
30823
 
30821
30824
  //let resid = chnid + "_" + resi;
30822
30825
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
30823
30826
 
30827
+ if(!atom) continue;
30828
+ /*
30824
30829
  if(atom) {
30825
30830
  x0.push(atom.coord.x);
30826
30831
  y0.push(atom.coord.y);
@@ -30831,8 +30836,13 @@ class Domain3d {
30831
30836
  y0.push(undefined);
30832
30837
  z0.push(undefined);
30833
30838
  }
30834
-
30835
- if(!atom) continue;
30839
+ */
30840
+ //if(!atom) continue;
30841
+
30842
+ x0.push(atom.coord.x);
30843
+ y0.push(atom.coord.y);
30844
+ z0.push(atom.coord.z);
30845
+ resiArray.push(resi);
30836
30846
 
30837
30847
  if(atom.ssend) {
30838
30848
  substructItem.To = parseInt(resi);
@@ -30866,12 +30876,13 @@ class Domain3d {
30866
30876
  return {subdomains: subdomains, substruct: substruct};
30867
30877
  }
30868
30878
 
30869
- let seqLen = residueArray.length + resiOffset;
30879
+ let seqLen = residueArray.length; // + resiOffset;
30880
+ let lastResi = resiArray[seqLen - 1];
30870
30881
 
30871
30882
  // get a list of Calpha-Calpha contacts
30872
30883
  ///list< pair< pair< int, let >, let > >
30873
- let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut);
30874
-
30884
+ let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut, resiArray);
30885
+
30875
30886
  //
30876
30887
  // Produce a "map" of the SSEs, i.e. vec_sse[i] = 0 means residue i + 1
30877
30888
  // is in a loop, and vec_sse[i] = k means residue i + 1 belongs to SSE
@@ -31116,13 +31127,17 @@ class Domain3d {
31116
31127
  let prts = list_parts[index];
31117
31128
  //vector<int> resflags;
31118
31129
  //resflags.clear();
31119
- let resflags = [];
31130
+
31131
+ //let resflags = [];
31132
+ let resflags = {};
31120
31133
 
31121
31134
  // a domain must have at least 3 SSEs...
31122
31135
  if (prts.length <= 2) continue;
31123
31136
 
31124
- for (let i = 0; i < seqLen; i++)
31125
- resflags.push(0);
31137
+ for (let i = 0; i < seqLen; i++) {
31138
+ //resflags.push(0);
31139
+ resflags[resiArray[i]] = 0;
31140
+ }
31126
31141
 
31127
31142
  for (let i = 0; i < prts.length; i++) {
31128
31143
  let k = prts[i] - 1;
@@ -31136,8 +31151,10 @@ class Domain3d {
31136
31151
  let From = sserec.From;
31137
31152
  let To = sserec.To;
31138
31153
 
31139
- for (let j = From; j <= To; j++)
31140
- resflags[j - 1] = 1;
31154
+ for (let j = From; j <= To; j++) {
31155
+ //resflags[j - 1] = 1;
31156
+ resflags[j] = 1;
31157
+ }
31141
31158
 
31142
31159
  if ((k == 0) && (From > 1)) {
31143
31160
  // residues with negative residue numbers will not be included
@@ -31145,17 +31162,21 @@ class Domain3d {
31145
31162
  //resflags[j - 1] = 1;
31146
31163
  // include at most 10 residues
31147
31164
  if(From - j <= 10) {
31148
- resflags[j - 1] = 1;
31165
+ //resflags[j - 1] = 1;
31166
+ resflags[j] = 1;
31149
31167
  }
31150
31168
  }
31151
31169
  }
31152
31170
 
31153
- if ((k == substruct.length - 1) && (To < seqLen)) {
31154
- for (let j = To + 1; j <= seqLen; j++) {
31171
+ //if ((k == substruct.length - 1) && (To < seqLen)) {
31172
+ if ((k == substruct.length - 1) && (To < parseInt(lastResi))) {
31173
+ //for (let j = To + 1; j <= seqLen; j++) {
31174
+ for (let j = To + 1; j <= parseInt(lastResi); j++) {
31155
31175
  //resflags[j - 1] = 1;
31156
31176
  // include at most 10 residues
31157
31177
  if(j - To <= 10) {
31158
- resflags[j - 1] = 1;
31178
+ //resflags[j - 1] = 1;
31179
+ resflags[j] = 1;
31159
31180
  }
31160
31181
  }
31161
31182
  }
@@ -31169,8 +31190,10 @@ class Domain3d {
31169
31190
  let ll = parseInt(0.5 * (From - To1 - 1));
31170
31191
 
31171
31192
  if (ll > 0) {
31172
- for (let j = From - ll; j <= From - 1; j++)
31173
- resflags[j - 1] = 1;
31193
+ for (let j = From - ll; j <= From - 1; j++) {
31194
+ //resflags[j - 1] = 1;
31195
+ resflags[j] = 1;
31196
+ }
31174
31197
  }
31175
31198
  }
31176
31199
 
@@ -31186,8 +31209,10 @@ class Domain3d {
31186
31209
  let ll = parseInt(0.5 * (From1 - To - 1) + 0.5);
31187
31210
 
31188
31211
  if (ll > 0) {
31189
- for (let j = To + 1; j <= To + ll; j++)
31190
- resflags[j - 1] = 1;
31212
+ for (let j = To + 1; j <= To + ll; j++) {
31213
+ //resflags[j - 1] = 1;
31214
+ resflags[j] = 1;
31215
+ }
31191
31216
  }
31192
31217
  }
31193
31218
  }
@@ -31200,11 +31225,13 @@ class Domain3d {
31200
31225
  let segments = [];
31201
31226
 
31202
31227
  for (let i = 0; i < seqLen; i++) {
31203
- let rf = resflags[i];
31228
+ //let rf = resflags[i];
31229
+ let rf = resflags[resiArray[i]];
31204
31230
 
31205
31231
  if (!inseg && (rf == 1)) {
31206
31232
  // new segment starts here
31207
- startseg = i + 1;
31233
+ //startseg = i + 1;
31234
+ startseg = resiArray[i];
31208
31235
  inseg = true;
31209
31236
  continue;
31210
31237
  }
@@ -31212,7 +31239,8 @@ class Domain3d {
31212
31239
  if (inseg && (rf == 0)) {
31213
31240
  // segment ends
31214
31241
  segments.push(startseg);
31215
- segments.push(i);
31242
+ //segments.push(i);
31243
+ segments.push(resiArray[i]);
31216
31244
  inseg = false;
31217
31245
  }
31218
31246
  }
@@ -31220,7 +31248,8 @@ class Domain3d {
31220
31248
  // check for the last segment
31221
31249
  if (inseg) {
31222
31250
  segments.push(startseg);
31223
- segments.push(seqLen);
31251
+ //segments.push(seqLen);
31252
+ segments.push(lastResi);
31224
31253
  }
31225
31254
 
31226
31255
  subdomains.push(segments);
@@ -32027,7 +32056,7 @@ class AddTrack {
32027
32056
  url: url,
32028
32057
  type: 'POST',
32029
32058
  data : {'targets': chainid, 'queries': gi},
32030
- dataType: 'jsonp',
32059
+ dataType: 'json',
32031
32060
  //dataType: 'json',
32032
32061
  tryCount : 0,
32033
32062
  retryLimit : 0, //1
@@ -32076,7 +32105,7 @@ class AddTrack {
32076
32105
  url: url,
32077
32106
  type: 'POST',
32078
32107
  data : {'targets': targets, 'queries': fasta},
32079
- dataType: 'jsonp',
32108
+ dataType: 'json',
32080
32109
  //dataType: 'json',
32081
32110
  tryCount : 0,
32082
32111
  retryLimit : 0, //1
@@ -38610,7 +38639,7 @@ class ParserUtils {
38610
38639
  ic.selectionCls.saveSelectionIfSelected();
38611
38640
  ic.drawCls.draw();
38612
38641
  }
38613
-
38642
+
38614
38643
  // if(ic.bInitial && me.cfg.command !== undefined && me.cfg.command !== '') {
38615
38644
  if(!ic.bCommandLoad && ic.bInitial && me.cfg.command !== undefined && me.cfg.command !== '') {
38616
38645
  if(Object.keys(ic.structures).length == 1) {
@@ -38618,11 +38647,13 @@ class ParserUtils {
38618
38647
  me.cfg.command = me.cfg.command.replace(new RegExp('!','g'), id + '_');
38619
38648
  }
38620
38649
  // final step resolved ic.deferred
38621
- if(me.cfg.mmdbafid === undefined && me.cfg.afid === undefined) ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
38650
+ //if(me.cfg.mmdbafid === undefined && me.cfg.afid === undefined) ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
38651
+ ic.loadScriptCls.loadScript(me.cfg.command, undefined, true);
38622
38652
  //ic.loadScriptCls.loadScript(me.cfg.command);
38623
38653
  }
38624
38654
  else {
38625
38655
  if(me.deferred !== undefined) me.deferred.resolve(); if(ic.deferred2 !== undefined) ic.deferred2.resolve();
38656
+ if(me.deferredMmdbaf !== undefined) me.deferredMmdbaf.resolve();
38626
38657
  }
38627
38658
  //if(me.cfg.align !== undefined || me.cfg.chainalign !== undefined || ic.bRealign ||( ic.bInputfile && ic.InputfileType == 'pdb' && Object.keys(ic.structures).length >= 2) ) {
38628
38659
  if(Object.keys(ic.structures).length >= 2) {
@@ -38861,7 +38892,7 @@ class MmcifParser {
38861
38892
  url: url,
38862
38893
  type: 'POST',
38863
38894
  data : {'mmciffile': data},
38864
- dataType: 'jsonp',
38895
+ dataType: 'json',
38865
38896
  cache: true,
38866
38897
  tryCount : 0,
38867
38898
  retryLimit : 0, //1
@@ -39075,7 +39106,7 @@ class MmcifParser {
39075
39106
  url: url,
39076
39107
  type: 'POST',
39077
39108
  data : {'mmcifheader': data},
39078
- dataType: 'jsonp',
39109
+ dataType: 'json',
39079
39110
  cache: true,
39080
39111
  tryCount : 0,
39081
39112
  retryLimit : 0, //1
@@ -39901,7 +39932,7 @@ class ShowAnno {
39901
39932
  url: url,
39902
39933
  type: 'POST',
39903
39934
  data : dataObj,
39904
- dataType: 'jsonp',
39935
+ dataType: 'json',
39905
39936
  //dataType: 'json',
39906
39937
  tryCount : 0,
39907
39938
  retryLimit : 0, //1
@@ -63329,7 +63360,7 @@ class Events {
63329
63360
  url: url,
63330
63361
  type: 'POST',
63331
63362
  data : {'mmciffile': dataStr},
63332
- dataType: 'jsonp',
63363
+ dataType: 'json',
63333
63364
  cache: true,
63334
63365
  tryCount : 0,
63335
63366
  retryLimit : 0, //1
@@ -68046,7 +68077,7 @@ class Vastplus {
68046
68077
  url: urltmalign,
68047
68078
  type: 'POST',
68048
68079
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target},
68049
- dataType: 'jsonp',
68080
+ dataType: 'json',
68050
68081
  cache: true
68051
68082
  });
68052
68083
 
@@ -68757,7 +68788,8 @@ class Vastplus {
68757
68788
 
68758
68789
  let pdbAjaxArray = [];
68759
68790
  for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
68760
- let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
68791
+ //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
68792
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
68761
68793
 
68762
68794
  let pdbAjax = $.ajax({
68763
68795
  url: urlpdb,
@@ -68806,7 +68838,7 @@ class Vastplus {
68806
68838
  // align each 3D domain with reference structure
68807
68839
  let result = ic.domain3dCls.c2b_NewSplitChain(ic.chains[chainid]);
68808
68840
  let subdomains = result.subdomains;
68809
-
68841
+
68810
68842
  let domainAtomsArray = [];
68811
68843
  if(subdomains.length <= 1) {
68812
68844
  domainAtomsArray.push(ic.chains[chainid]);
@@ -68820,6 +68852,7 @@ class Vastplus {
68820
68852
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
68821
68853
  let domainAtoms = {};
68822
68854
  let segArray = subdomains[k];
68855
+
68823
68856
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
68824
68857
  let startResi = segArray[m];
68825
68858
  let endResi = segArray[m+1];
@@ -68833,10 +68866,9 @@ class Vastplus {
68833
68866
  domainAtomsArray.push(domainAtoms);
68834
68867
  }
68835
68868
  }
68836
-
68869
+
68837
68870
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
68838
68871
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
68839
-
68840
68872
  let domainid = chainid + '-' + k;
68841
68873
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
68842
68874
  let struct2 = "stru" + index;
@@ -68849,7 +68881,7 @@ class Vastplus {
68849
68881
  url: urltmalign,
68850
68882
  type: 'POST',
68851
68883
  data: {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbArray[index]},
68852
- dataType: 'jsonp',
68884
+ dataType: 'json',
68853
68885
  cache: true
68854
68886
  });
68855
68887
 
@@ -68928,14 +68960,14 @@ console.log(domainid + ' TM-score: ' + domainid2score[domainid] + ' matched ' +
68928
68960
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
68929
68961
  }
68930
68962
  }
68931
-
68963
+
68932
68964
  // combine domainid into chainid
68933
68965
  for(let domainid in domainid2segs) {
68934
68966
  let chainid = domainid.split('-')[0];
68935
68967
  if(!chainid2segs[chainid]) chainid2segs[chainid] = [];
68936
68968
  chainid2segs[chainid] = chainid2segs[chainid].concat(domainid2segs[domainid]);
68937
68969
  }
68938
-
68970
+
68939
68971
  // assign ic.resid2refnum, ic.refnum2residArray, ic.chainsMapping
68940
68972
  if(!ic.resid2refnum) ic.resid2refnum = {};
68941
68973
  if(!ic.refnum2residArray) ic.refnum2residArray = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.19.2",
3
+ "version": "3.19.4",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {