icn3d 3.29.15 → 3.29.17

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
@@ -37782,16 +37782,17 @@ class AnnoCddSite {
37782
37782
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html2 += ic.showSeqCls.insertMulGapOverview(chnid, ic.seqStartLen[chnid]);
37783
37783
 
37784
37784
  if(me.cfg.blast_rep_id != chnid) { // regular
37785
+ let color;
37785
37786
  for(let i = 0, il = fromArray.length; i < il; ++i) {
37786
- let color = this.getColorFromPos(chnid, fromArray[i], titleArray);
37787
+ if(i == 0) color = this.getColorFromPos(chnid, fromArray[i], titleArray);
37787
37788
 
37788
37789
  let emptyWidth;
37789
- if(titleArray) {
37790
+ // if(titleArray) {
37790
37791
  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
- }
37792
+ // }
37793
+ // else {
37794
+ // 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);
37795
+ // }
37795
37796
 
37796
37797
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
37797
37798
  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>';
@@ -38820,19 +38821,24 @@ class AnnoIg {
38820
38821
  html2 += htmlTitle;
38821
38822
  html2 += htmlCnt + '<span class="icn3d-seqLine">';
38822
38823
 
38824
+ let prevDomainindex, color;
38823
38825
  for(let i = 0, il = fromArray.length; i < il; ++i) {
38824
38826
  let resi = ic.ParserUtilsCls.getResi(chnid, fromArray[i]);
38825
38827
  let resid = chnid + "_" + resi;
38826
- let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
38827
- let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
38828
- let color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
38829
38828
 
38830
38829
  let domainindex = posindex2domainindex[fromArray[i]];
38830
+ if(domainindex != prevDomainindex) {
38831
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
38832
+ let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
38833
+ color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
38834
+ }
38831
38835
 
38832
38836
  let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) :
38833
38837
  Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
38834
38838
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
38835
38839
  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 + '" ig="0" from="' + fromArray + '" to="' + toArray + '" shorttitle="' + domainArray[domainindex] + '" index="0" setname="' + chnid + '_igs" id="' + chnid + '_igs" anno="sequence" chain="' + chnid + '" title="' + domainArray[domainindex] + '">' + domainArray[domainindex] + ' </div>';
38840
+
38841
+ prevDomainindex = domainindex;
38836
38842
  }
38837
38843
 
38838
38844
  html2 += htmlCnt;
@@ -39232,7 +39238,9 @@ class AnnoDomain {
39232
39238
 
39233
39239
  if(me.cfg.blast_rep_id != chnid) { // regular
39234
39240
  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);
39241
+ // 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);
39242
+ let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
39243
+
39236
39244
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
39237
39245
  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
39246
  }
@@ -40841,7 +40849,7 @@ class Domain3d {
40841
40849
  // get a list of Calpha-Calpha contacts
40842
40850
  ///list< pair< pair< int, let >, let > >
40843
40851
  let cts = this.c2b_AlphaContacts(seqLen, x0, y0, z0, dcut, resiArray);
40844
-
40852
+
40845
40853
  //
40846
40854
  // Produce a "map" of the SSEs, i.e. vec_sse[i] = 0 means residue i + 1
40847
40855
  // is in a loop, and vec_sse[i] = k means residue i + 1 belongs to SSE
@@ -40902,7 +40910,7 @@ class Domain3d {
40902
40910
  vec_cts1.push(i + 1);
40903
40911
  vec_cts2.push(i + 1);
40904
40912
  }
40905
-
40913
+
40906
40914
  // create contact counts from the contacts/interactions
40907
40915
  //map< pair< int, let >, let > ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
40908
40916
  let ctable = this.c2b_ContactTable(vec_cts1, vec_cts2);
@@ -40926,7 +40934,7 @@ class Domain3d {
40926
40934
  sheetNeighbor[ss2][ss1] = 1;
40927
40935
  }
40928
40936
  }
40929
-
40937
+
40930
40938
  //https://www.geeksforgeeks.org/number-groups-formed-graph-friends/
40931
40939
  let existing_groups = 0;
40932
40940
  let sheet2sheetnum = {};
@@ -41054,7 +41062,7 @@ class Domain3d {
41054
41062
  this.parts[2*i] = this.parts[2*i + 1] = 0;
41055
41063
  ratios[i] = 0.0;
41056
41064
  }
41057
-
41065
+
41058
41066
  n_saved = this.new_split_chain(nsse, sratio, minSize, minSSE, maxCsz, avgCts, cDelta, ncFact, this.parts, n_saved, ratios);
41059
41067
 
41060
41068
  // save domain data
@@ -41102,6 +41110,36 @@ class Domain3d {
41102
41110
 
41103
41111
  list_parts = list_partsTmp;
41104
41112
 
41113
+ // if there is only one domain, add all
41114
+ if(list_parts.length == 0) {
41115
+ let groupnum2cnt = {}, groupnum2sseList = {}, chosenGroupnum = 0;
41116
+ for(let i = 0, il = this.group_num.length; i < il; ++i) {
41117
+ let groupnum = this.group_num[i];
41118
+ let sse = i + 1;
41119
+ if(groupnum && groupnum != i + 1) {
41120
+ if(!groupnum2sseList[groupnum]) groupnum2sseList[groupnum] = [];
41121
+ // collect all sse for this groupnum
41122
+ groupnum2sseList[groupnum].push(sse);
41123
+
41124
+ if(!groupnum2cnt[groupnum]) {
41125
+ groupnum2cnt[groupnum] = 1;
41126
+ }
41127
+ else {
41128
+ ++groupnum2cnt[groupnum];
41129
+ if(groupnum2cnt[groupnum] >= 3) { // minimum 3 sse
41130
+ chosenGroupnum = groupnum;
41131
+ }
41132
+ }
41133
+ }
41134
+ }
41135
+
41136
+ if(chosenGroupnum != 0) { // found a domain
41137
+ let sseArray = [chosenGroupnum].concat(groupnum2sseList[chosenGroupnum]);
41138
+
41139
+ list_parts.push(sseArray);
41140
+ }
41141
+ }
41142
+
41105
41143
  //for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
41106
41144
  for (let index = 0, indexl = list_parts.length; index < indexl; ++index) {
41107
41145
  //vector<int> prts = *lpint;
@@ -41239,7 +41277,7 @@ class Domain3d {
41239
41277
  ic.tddomains[domainName][resid] = 1;
41240
41278
  }
41241
41279
  }
41242
- }
41280
+ }
41243
41281
 
41244
41282
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
41245
41283
  } // end c2b_NewSplitChain
@@ -66893,9 +66931,9 @@ class Dssp {
66893
66931
 
66894
66932
  if(bRerunDomain) {
66895
66933
  let atomsAssigned = {};
66896
- //ic.resid2refnum_ori should be used
66897
- for(let resid in ic.resid2refnum_ori) {
66898
- atomsAssigned = me.hashUtilsCls.unionHash(atomsAssigned, ic.residues[resid]);
66934
+ // for(let resid in ic.resid2refnum_ori) {
66935
+ for(let resid in ic.resid2domainid) {
66936
+ if(ic.resid2domainid[resid]) atomsAssigned = me.hashUtilsCls.unionHash(atomsAssigned, ic.residues[resid]);
66899
66937
  }
66900
66938
 
66901
66939
  currAtoms = me.hashUtilsCls.exclHash(currAtoms, atomsAssigned);
@@ -66916,7 +66954,7 @@ class Dssp {
66916
66954
  let result = ic.domain3dCls.c2b_NewSplitChain(currAtoms, undefined);
66917
66955
  let subdomains = result.subdomains;
66918
66956
  let pos2resi = result.pos2resi;
66919
-
66957
+ /*
66920
66958
  if(subdomains.length <= 1) {
66921
66959
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
66922
66960
  if(residueArray.length < minResidues) return domainAtomsArray;
@@ -66933,25 +66971,27 @@ class Dssp {
66933
66971
 
66934
66972
  domainAtomsArray.push(currAtoms);
66935
66973
  }
66936
- else {
66974
+ else
66975
+ */
66976
+
66977
+ if(subdomains.length >= 1) {
66937
66978
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
66938
66979
  let domainAtoms = {};
66939
66980
  let segArray = subdomains[k];
66940
66981
 
66941
66982
  let resCnt = 0;
66942
66983
  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) {
66984
+ let startResi = parseInt(segArray[m]);
66985
+ let endResi = parseInt(segArray[m+1]);
66986
+
66987
+ for(let n = startResi; n <= endResi; ++n) {
66946
66988
  let resid = chainid + '_' + pos2resi[n];
66947
66989
  ++resCnt;
66948
66990
  domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
66949
66991
 
66950
66992
  // clear previous refnum assignment if any
66951
- // if(bRerunDomain) {
66952
- delete ic.resid2refnum[resid];
66953
- delete ic.residIgLoop[resid];
66954
- // }
66993
+ delete ic.resid2refnum[resid];
66994
+ delete ic.residIgLoop[resid];
66955
66995
  }
66956
66996
  }
66957
66997
 
@@ -67148,11 +67188,12 @@ class Dssp {
67148
67188
  domainid2refpdbnamelist[domainid][refpdbname] = score;
67149
67189
  }
67150
67190
  }
67151
- /* !!!
67152
- // combine the top three clusters for the 2nd round alignment
67191
+
67192
+ //!!!
67193
+
67194
+ // combine the top four clusters for the 2nd round alignment
67153
67195
  if(bRound1) {
67154
67196
  for(let domainid in domainid2refpdbnamelist) {
67155
- console.log("###score " + ic.domainid2score[domainid].split('_')[0] + " ic.domainid2refpdbname[domainid][0] " + ic.domainid2refpdbname[domainid][0])
67156
67197
  if(!me.bNode && ic.domainid2refpdbname[domainid][0] == 'all_templates') {
67157
67198
  let refpdbname2score = domainid2refpdbnamelist[domainid];
67158
67199
  let refpdbnameList = Object.keys(refpdbname2score);
@@ -67160,12 +67201,11 @@ class Dssp {
67160
67201
  return refpdbname2score[b] - refpdbname2score[a]
67161
67202
  });
67162
67203
  // top 3 templates
67163
- ic.domainid2refpdbname[domainid] = refpdbnameList.slice(0,3);
67204
+ ic.domainid2refpdbname[domainid] = refpdbnameList.slice(0,4);
67164
67205
  }
67165
- console.log("###bb ic.domainid2refpdbname[domainid] " + ic.domainid2refpdbname[domainid])
67166
67206
  }
67167
67207
  }
67168
- */
67208
+
67169
67209
  return domainid2segs; // only used in round 2
67170
67210
  }
67171
67211
 
@@ -68032,6 +68072,7 @@ class Dssp {
68032
68072
  let currResid = chnid + '_' + currResi;
68033
68073
  delete ic.residIgLoop[currResid];
68034
68074
  ic.resid2domainid[currResid] = domainid;
68075
+ ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
68035
68076
  }
68036
68077
 
68037
68078
  break;
@@ -68065,6 +68106,7 @@ class Dssp {
68065
68106
  let currResid = chnid + '_' + currResi;
68066
68107
  delete ic.residIgLoop[currResid];
68067
68108
  ic.resid2domainid[currResid] = domainid;
68109
+ ic.resid2refnum_ori[currResid] = 1; // a hash to check which residues were assigned
68068
68110
  }
68069
68111
 
68070
68112
  break;
@@ -68072,15 +68114,13 @@ class Dssp {
68072
68114
  }
68073
68115
  }
68074
68116
  }
68075
- /*
68117
+
68076
68118
  // 2b. remove strands with less than 3 residues except G strand
68077
68119
  for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
68078
68120
  let strandTmp = strandArray[i].strand.substr(0, 1);
68079
68121
  if(strandTmp != 'G' && strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
68080
68122
  if(strandTmp == 'B' || strandTmp == 'C' || strandTmp == 'E' || strandTmp == 'F') {
68081
68123
  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
68124
  return false;
68085
68125
  }
68086
68126
 
@@ -68091,7 +68131,7 @@ class Dssp {
68091
68131
  strandArray.splice(i, 1);
68092
68132
  }
68093
68133
  }
68094
- */
68134
+
68095
68135
  // 3. assign refnumLabel for each resid
68096
68136
  strandCnt = 0;
68097
68137
  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.17",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {