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.module.js CHANGED
@@ -37786,12 +37786,12 @@ class AnnoCddSite {
37786
37786
  let color = this.getColorFromPos(chnid, fromArray[i], titleArray);
37787
37787
 
37788
37788
  let emptyWidth;
37789
- if(titleArray) {
37789
+ // if(titleArray) {
37790
37790
  emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
37791
- }
37792
- else {
37793
- 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);
37794
- }
37791
+ // }
37792
+ // else {
37793
+ // 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);
37794
+ // }
37795
37795
 
37796
37796
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
37797
37797
  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>';
@@ -39232,7 +39232,9 @@ class AnnoDomain {
39232
39232
 
39233
39233
  if(me.cfg.blast_rep_id != chnid) { // regular
39234
39234
  for(let i = 0, il = fromArray.length; i < il; ++i) {
39235
- 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);
39235
+ // 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);
39236
+ let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
39237
+
39236
39238
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
39237
39239
  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>';
39238
39240
  }
@@ -40841,7 +40843,7 @@ class Domain3d {
40841
40843
  // get a list of Calpha-Calpha contacts
40842
40844
  ///list< pair< pair< int, let >, let > >
40843
40845
  let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut, resiArray);
40844
-
40846
+
40845
40847
  //
40846
40848
  // Produce a "map" of the SSEs, i.e. vec_sse[i] = 0 means residue i + 1
40847
40849
  // is in a loop, and vec_sse[i] = k means residue i + 1 belongs to SSE
@@ -40902,7 +40904,7 @@ class Domain3d {
40902
40904
  vec_cts1.push(i + 1);
40903
40905
  vec_cts2.push(i + 1);
40904
40906
  }
40905
-
40907
+
40906
40908
  // create contact counts from the contacts/interactions
40907
40909
  //map< pair< int, let >, let > ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
40908
40910
  let ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
@@ -40926,7 +40928,7 @@ class Domain3d {
40926
40928
  sheetNeighbor[ss2][ss1] = 1;
40927
40929
  }
40928
40930
  }
40929
-
40931
+
40930
40932
  //https://www.geeksforgeeks.org/number-groups-formed-graph-friends/
40931
40933
  let existing_groups = 0;
40932
40934
  let sheet2sheetnum = {};
@@ -41054,7 +41056,7 @@ class Domain3d {
41054
41056
  this.parts[2*i] = this.parts[2*i + 1] = 0;
41055
41057
  ratios[i] = 0.0;
41056
41058
  }
41057
-
41059
+
41058
41060
  n_saved = this.new_split_chain(nsse, sratio, minSize, minSSE, maxCsz, avgCts, cDelta, ncFact, this.parts, n_saved, ratios);
41059
41061
 
41060
41062
  // save domain data
@@ -41102,6 +41104,36 @@ class Domain3d {
41102
41104
 
41103
41105
  list_parts = list_partsTmp;
41104
41106
 
41107
+ // if there is only one domain, add all
41108
+ if(list_parts.length == 0) {
41109
+ let groupnum2cnt = {}, groupnum2sseList = {}, chosenGroupnum = 0;
41110
+ for(let i = 0, il = this.group_num.length; i < il; ++i) {
41111
+ let groupnum = this.group_num[i];
41112
+ let sse = i + 1;
41113
+ if(groupnum && groupnum != i + 1) {
41114
+ if(!groupnum2sseList[groupnum]) groupnum2sseList[groupnum] = [];
41115
+ // collect all sse for this groupnum
41116
+ groupnum2sseList[groupnum].push(sse);
41117
+
41118
+ if(!groupnum2cnt[groupnum]) {
41119
+ groupnum2cnt[groupnum] = 1;
41120
+ }
41121
+ else {
41122
+ ++groupnum2cnt[groupnum];
41123
+ if(groupnum2cnt[groupnum] >= 3) { // minimum 3 sse
41124
+ chosenGroupnum = groupnum;
41125
+ }
41126
+ }
41127
+ }
41128
+ }
41129
+
41130
+ if(chosenGroupnum != 0) { // found a domain
41131
+ let sseArray = [chosenGroupnum].concat(groupnum2sseList[chosenGroupnum]);
41132
+
41133
+ list_parts.push(sseArray);
41134
+ }
41135
+ }
41136
+
41105
41137
  //for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
41106
41138
  for (let index = 0, indexl = list_parts.length; index < indexl; ++index) {
41107
41139
  //vector<int> prts = *lpint;
@@ -41239,7 +41271,7 @@ class Domain3d {
41239
41271
  ic.tddomains[domainName][resid] = 1;
41240
41272
  }
41241
41273
  }
41242
- }
41274
+ }
41243
41275
 
41244
41276
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
41245
41277
  } // end c2b_NewSplitChain
@@ -66916,7 +66948,7 @@ class Dssp {
66916
66948
  let result = ic.domain3dCls.c2b_NewSplitChain(currAtoms, undefined);
66917
66949
  let subdomains = result.subdomains;
66918
66950
  let pos2resi = result.pos2resi;
66919
-
66951
+ /*
66920
66952
  if(subdomains.length <= 1) {
66921
66953
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
66922
66954
  if(residueArray.length < minResidues) return domainAtomsArray;
@@ -66933,25 +66965,27 @@ class Dssp {
66933
66965
 
66934
66966
  domainAtomsArray.push(currAtoms);
66935
66967
  }
66936
- else {
66968
+ else
66969
+ */
66970
+
66971
+ if(subdomains.length >= 1) {
66937
66972
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
66938
66973
  let domainAtoms = {};
66939
66974
  let segArray = subdomains[k];
66940
66975
 
66941
66976
  let resCnt = 0;
66942
66977
  for(let m = 0, ml = segArray.length; m < ml; m += 2) {
66943
- let startResi = segArray[m];
66944
- let endResi = segArray[m+1];
66945
- for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
66978
+ let startResi = parseInt(segArray[m]);
66979
+ let endResi = parseInt(segArray[m+1]);
66980
+
66981
+ for(let n = startResi; n <= endResi; ++n) {
66946
66982
  let resid = chainid + '_' + pos2resi[n];
66947
66983
  ++resCnt;
66948
66984
  domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
66949
66985
 
66950
66986
  // clear previous refnum assignment if any
66951
- // if(bRerunDomain) {
66952
- delete ic.resid2refnum[resid];
66953
- delete ic.residIgLoop[resid];
66954
- // }
66987
+ delete ic.resid2refnum[resid];
66988
+ delete ic.residIgLoop[resid];
66955
66989
  }
66956
66990
  }
66957
66991
 
@@ -67148,11 +67182,13 @@ class Dssp {
67148
67182
  domainid2refpdbnamelist[domainid][refpdbname] = score;
67149
67183
  }
67150
67184
  }
67151
- /* !!!
67185
+
67186
+ //!!!
67187
+ /*
67152
67188
  // combine the top three clusters for the 2nd round alignment
67153
67189
  if(bRound1) {
67154
67190
  for(let domainid in domainid2refpdbnamelist) {
67155
- console.log("###score " + ic.domainid2score[domainid].split('_')[0] + " ic.domainid2refpdbname[domainid][0] " + ic.domainid2refpdbname[domainid][0])
67191
+ if(!me.bNode) console.log("###score " + ic.domainid2score[domainid].split('_')[0] + " ic.domainid2refpdbname[domainid][0] " + ic.domainid2refpdbname[domainid][0])
67156
67192
  if(!me.bNode && ic.domainid2refpdbname[domainid][0] == 'all_templates') {
67157
67193
  let refpdbname2score = domainid2refpdbnamelist[domainid];
67158
67194
  let refpdbnameList = Object.keys(refpdbname2score);
@@ -67162,7 +67198,7 @@ class Dssp {
67162
67198
  // top 3 templates
67163
67199
  ic.domainid2refpdbname[domainid] = refpdbnameList.slice(0,3);
67164
67200
  }
67165
- console.log("###bb ic.domainid2refpdbname[domainid] " + ic.domainid2refpdbname[domainid])
67201
+ if(!me.bNode) console.log("###bb ic.domainid2refpdbname[domainid] " + ic.domainid2refpdbname[domainid])
67166
67202
  }
67167
67203
  }
67168
67204
  */
@@ -68072,15 +68108,13 @@ class Dssp {
68072
68108
  }
68073
68109
  }
68074
68110
  }
68075
- /*
68111
+
68076
68112
  // 2b. remove strands with less than 3 residues except G strand
68077
68113
  for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
68078
68114
  let strandTmp = strandArray[i].strand.substr(0, 1);
68079
68115
  if(strandTmp != 'G' && strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
68080
68116
  if(strandTmp == 'B' || strandTmp == 'C' || strandTmp == 'E' || strandTmp == 'F') {
68081
68117
  if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are removed since they are too short...");
68082
-
68083
- console.log("### strandTmp " + strandTmp + " strandArray[i].endRefnum - strandArray[i].startRefnum + 1 " + (strandArray[i].endRefnum - strandArray[i].startRefnum + 1))
68084
68118
  return false;
68085
68119
  }
68086
68120
 
@@ -68091,7 +68125,7 @@ class Dssp {
68091
68125
  strandArray.splice(i, 1);
68092
68126
  }
68093
68127
  }
68094
- */
68128
+
68095
68129
  // 3. assign refnumLabel for each resid
68096
68130
  strandCnt = 0;
68097
68131
  let loopCnt = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.29.15",
3
+ "version": "3.29.16",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {