icn3d 3.29.15 → 3.29.16

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
@@ -36885,12 +36885,12 @@ class AnnoCddSite {
36885
36885
  let color = this.getColorFromPos(chnid, fromArray[i], titleArray);
36886
36886
 
36887
36887
  let emptyWidth;
36888
- if(titleArray) {
36888
+ // if(titleArray) {
36889
36889
  emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
36890
- }
36891
- else {
36892
- emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
36893
- }
36890
+ // }
36891
+ // else {
36892
+ // emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
36893
+ // }
36894
36894
 
36895
36895
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
36896
36896
  html2 += '<div style="display:inline-block; color:white!important; font-weight:bold; background-color:#' + color + '; width:' + Math.round(ic.seqAnnWidth *(toArray[i] - fromArray[i] + 1) / ic.maxAnnoLength) + 'px;" class="icn3d-seqTitle ' + linkStr + '" ' + type + '="' +(index+1).toString() + '" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + title + '" index="' + index + '" setname="' + setname + '" id="' + chnid + '_domain_' + index + '_' + r + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">' + domain + ' </div>';
@@ -38331,7 +38331,9 @@ class AnnoDomain {
38331
38331
 
38332
38332
  if(me.cfg.blast_rep_id != chnid) { // regular
38333
38333
  for(let i = 0, il = fromArray.length; i < il; ++i) {
38334
- let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
38334
+ // let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
38335
+ let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
38336
+
38335
38337
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
38336
38338
  html2 += '<div style="display:inline-block; color:white!important; font-weight:bold; background-color:#' + color + '; width:' + Math.round(ic.seqAnnWidth *(toArray[i] - fromArray[i] + 1) / ic.maxAnnoLength) + 'px;" class="icn3d-seqTitle icn3d-link icn3d-blue" 3ddomain="' +(index+1).toString() + '" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + title + '" index="' + index + '" setname="' + chnid + '_3d_domain_' +(index+1).toString() + '" id="' + chnid + '_3d_domain_' + index + '" anno="sequence" chain="' + chnid + '" title="' + fulltitle + '">3D domain ' +(index+1).toString() + '</div>';
38337
38339
  }
@@ -39940,7 +39942,7 @@ class Domain3d {
39940
39942
  // get a list of Calpha-Calpha contacts
39941
39943
  ///list< pair< pair< int, let >, let > >
39942
39944
  let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut, resiArray);
39943
-
39945
+
39944
39946
  //
39945
39947
  // Produce a "map" of the SSEs, i.e. vec_sse[i] = 0 means residue i + 1
39946
39948
  // is in a loop, and vec_sse[i] = k means residue i + 1 belongs to SSE
@@ -40001,7 +40003,7 @@ class Domain3d {
40001
40003
  vec_cts1.push(i + 1);
40002
40004
  vec_cts2.push(i + 1);
40003
40005
  }
40004
-
40006
+
40005
40007
  // create contact counts from the contacts/interactions
40006
40008
  //map< pair< int, let >, let > ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
40007
40009
  let ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
@@ -40025,7 +40027,7 @@ class Domain3d {
40025
40027
  sheetNeighbor[ss2][ss1] = 1;
40026
40028
  }
40027
40029
  }
40028
-
40030
+
40029
40031
  //https://www.geeksforgeeks.org/number-groups-formed-graph-friends/
40030
40032
  let existing_groups = 0;
40031
40033
  let sheet2sheetnum = {};
@@ -40153,7 +40155,7 @@ class Domain3d {
40153
40155
  this.parts[2*i] = this.parts[2*i + 1] = 0;
40154
40156
  ratios[i] = 0.0;
40155
40157
  }
40156
-
40158
+
40157
40159
  n_saved = this.new_split_chain(nsse, sratio, minSize, minSSE, maxCsz, avgCts, cDelta, ncFact, this.parts, n_saved, ratios);
40158
40160
 
40159
40161
  // save domain data
@@ -40201,6 +40203,36 @@ class Domain3d {
40201
40203
 
40202
40204
  list_parts = list_partsTmp;
40203
40205
 
40206
+ // if there is only one domain, add all
40207
+ if(list_parts.length == 0) {
40208
+ let groupnum2cnt = {}, groupnum2sseList = {}, chosenGroupnum = 0;
40209
+ for(let i = 0, il = this.group_num.length; i < il; ++i) {
40210
+ let groupnum = this.group_num[i];
40211
+ let sse = i + 1;
40212
+ if(groupnum && groupnum != i + 1) {
40213
+ if(!groupnum2sseList[groupnum]) groupnum2sseList[groupnum] = [];
40214
+ // collect all sse for this groupnum
40215
+ groupnum2sseList[groupnum].push(sse);
40216
+
40217
+ if(!groupnum2cnt[groupnum]) {
40218
+ groupnum2cnt[groupnum] = 1;
40219
+ }
40220
+ else {
40221
+ ++groupnum2cnt[groupnum];
40222
+ if(groupnum2cnt[groupnum] >= 3) { // minimum 3 sse
40223
+ chosenGroupnum = groupnum;
40224
+ }
40225
+ }
40226
+ }
40227
+ }
40228
+
40229
+ if(chosenGroupnum != 0) { // found a domain
40230
+ let sseArray = [chosenGroupnum].concat(groupnum2sseList[chosenGroupnum]);
40231
+
40232
+ list_parts.push(sseArray);
40233
+ }
40234
+ }
40235
+
40204
40236
  //for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
40205
40237
  for (let index = 0, indexl = list_parts.length; index < indexl; ++index) {
40206
40238
  //vector<int> prts = *lpint;
@@ -40338,7 +40370,7 @@ class Domain3d {
40338
40370
  ic.tddomains[domainName][resid] = 1;
40339
40371
  }
40340
40372
  }
40341
- }
40373
+ }
40342
40374
 
40343
40375
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
40344
40376
  } // end c2b_NewSplitChain
@@ -66015,7 +66047,7 @@ class Dssp {
66015
66047
  let result = ic.domain3dCls.c2b_NewSplitChain(currAtoms, undefined);
66016
66048
  let subdomains = result.subdomains;
66017
66049
  let pos2resi = result.pos2resi;
66018
-
66050
+ /*
66019
66051
  if(subdomains.length <= 1) {
66020
66052
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
66021
66053
  if(residueArray.length < minResidues) return domainAtomsArray;
@@ -66032,25 +66064,27 @@ class Dssp {
66032
66064
 
66033
66065
  domainAtomsArray.push(currAtoms);
66034
66066
  }
66035
- else {
66067
+ else
66068
+ */
66069
+
66070
+ if(subdomains.length >= 1) {
66036
66071
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
66037
66072
  let domainAtoms = {};
66038
66073
  let segArray = subdomains[k];
66039
66074
 
66040
66075
  let resCnt = 0;
66041
66076
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
66042
- let startResi = segArray[m];
66043
- let endResi = segArray[m+1];
66044
- for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
66077
+ let startResi = parseInt(segArray[m]);
66078
+ let endResi = parseInt(segArray[m+1]);
66079
+
66080
+ for(let n = startResi; n <= endResi; ++n) {
66045
66081
  let resid = chainid + '_' + pos2resi[n];
66046
66082
  ++resCnt;
66047
66083
  domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
66048
66084
 
66049
66085
  // clear previous refnum assignment if any
66050
- // if(bRerunDomain) {
66051
- delete ic.resid2refnum[resid];
66052
- delete ic.residIgLoop[resid];
66053
- // }
66086
+ delete ic.resid2refnum[resid];
66087
+ delete ic.residIgLoop[resid];
66054
66088
  }
66055
66089
  }
66056
66090
 
@@ -66247,11 +66281,13 @@ class Dssp {
66247
66281
  domainid2refpdbnamelist[domainid][refpdbname] = score;
66248
66282
  }
66249
66283
  }
66250
- /* !!!
66284
+
66285
+ //!!!
66286
+ /*
66251
66287
  // combine the top three clusters for the 2nd round alignment
66252
66288
  if(bRound1) {
66253
66289
  for(let domainid in domainid2refpdbnamelist) {
66254
- console.log("###score " + ic.domainid2score[domainid].split('_')[0] + " ic.domainid2refpdbname[domainid][0] " + ic.domainid2refpdbname[domainid][0])
66290
+ if(!me.bNode) console.log("###score " + ic.domainid2score[domainid].split('_')[0] + " ic.domainid2refpdbname[domainid][0] " + ic.domainid2refpdbname[domainid][0])
66255
66291
  if(!me.bNode && ic.domainid2refpdbname[domainid][0] == 'all_templates') {
66256
66292
  let refpdbname2score = domainid2refpdbnamelist[domainid];
66257
66293
  let refpdbnameList = Object.keys(refpdbname2score);
@@ -66261,7 +66297,7 @@ class Dssp {
66261
66297
  // top 3 templates
66262
66298
  ic.domainid2refpdbname[domainid] = refpdbnameList.slice(0,3);
66263
66299
  }
66264
- console.log("###bb ic.domainid2refpdbname[domainid] " + ic.domainid2refpdbname[domainid])
66300
+ if(!me.bNode) console.log("###bb ic.domainid2refpdbname[domainid] " + ic.domainid2refpdbname[domainid])
66265
66301
  }
66266
66302
  }
66267
66303
  */
@@ -67171,15 +67207,13 @@ class Dssp {
67171
67207
  }
67172
67208
  }
67173
67209
  }
67174
- /*
67210
+
67175
67211
  // 2b. remove strands with less than 3 residues except G strand
67176
67212
  for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
67177
67213
  let strandTmp = strandArray[i].strand.substr(0, 1);
67178
67214
  if(strandTmp != 'G' && strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
67179
67215
  if(strandTmp == 'B' || strandTmp == 'C' || strandTmp == 'E' || strandTmp == 'F') {
67180
67216
  if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are removed since they are too short...");
67181
-
67182
- console.log("### strandTmp " + strandTmp + " strandArray[i].endRefnum - strandArray[i].startRefnum + 1 " + (strandArray[i].endRefnum - strandArray[i].startRefnum + 1))
67183
67217
  return false;
67184
67218
  }
67185
67219
 
@@ -67190,7 +67224,7 @@ class Dssp {
67190
67224
  strandArray.splice(i, 1);
67191
67225
  }
67192
67226
  }
67193
- */
67227
+
67194
67228
  // 3. assign refnumLabel for each resid
67195
67229
  strandCnt = 0;
67196
67230
  let loopCnt = 0;