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.module.js CHANGED
@@ -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);
@@ -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) {
@@ -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;
@@ -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.3",
3
+ "version": "3.19.4",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {