icn3d 3.29.11 → 3.29.13

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
@@ -12878,10 +12878,11 @@ class SetDialog {
12878
12878
  html += "<td></td>";
12879
12879
  html += "</tr><tr>";
12880
12880
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ig'>Ig Domains" + me.htmlCls.space2 + "</span></td>";
12881
+ */
12881
12882
 
12882
12883
  html += "<td></td>";
12883
12884
  html += "</tr></table></div></div>";
12884
- */
12885
+
12885
12886
  return html;
12886
12887
  }
12887
12888
  }
@@ -37743,14 +37744,12 @@ class AnnoCddSite {
37743
37744
 
37744
37745
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqEndLen[chnid], '-');
37745
37746
 
37746
- let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.chains[chnid]);
37747
- let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
37748
- let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
37749
-
37750
37747
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html2 += ic.showSeqCls.insertMulGapOverview(chnid, ic.seqStartLen[chnid]);
37751
37748
 
37752
37749
  if(me.cfg.blast_rep_id != chnid) { // regular
37753
37750
  for(let i = 0, il = fromArray.length; i < il; ++i) {
37751
+ let color = this.getColorFromPos(chnid, i, titleArray);
37752
+
37754
37753
  let emptyWidth;
37755
37754
  if(titleArray) {
37756
37755
  emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
@@ -37776,6 +37775,8 @@ class AnnoCddSite {
37776
37775
  toArray2.push(toArray[i]);
37777
37776
  }
37778
37777
  for(let i = 0, il = fromArray2.length; i < il; ++i) {
37778
+ let color = this.getColorFromPos(chnid, i, titleArray);
37779
+
37779
37780
  html2 += ic.showSeqCls.insertGapOverview(chnid, fromArray2[i]);
37780
37781
  let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray2[i] - ic.baseResi[chnid] - 1) /(ic.maxAnnoLength + ic.nTotalGap)) : Math.round(ic.seqAnnWidth *(fromArray2[i] - toArray2[i-1] - 1) /(ic.maxAnnoLength + ic.nTotalGap));
37781
37782
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
@@ -37800,6 +37801,24 @@ class AnnoCddSite {
37800
37801
  // getAdjustedResi(resi, chnid, matchedPos, chainsSeq, baseResi) { let ic = this.icn3d, me = ic.icn3dui;
37801
37802
  // return (resi >= matchedPos[chnid] && resi - matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][resi - matchedPos[chnid]].resi : baseResi[chnid] + 1 + resi;
37802
37803
  // }
37804
+ getColorFromPos(chainid, pos, bIg) { let ic = this.icn3d; ic.icn3dui;
37805
+ let color;
37806
+
37807
+ let resid = chainid + '_' + ic.ParserUtilsCls.getResi(chainid, pos);
37808
+ // if(!bIg) {
37809
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
37810
+ let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
37811
+ color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
37812
+ // }
37813
+ // else {
37814
+ // let refnumLabel = ic.resid2refnum[resid];
37815
+ // let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
37816
+ // let currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
37817
+ // color = ic.annoIgCls.getRefnumColor(currStrand, true).substr(1);
37818
+ // }
37819
+
37820
+ return color;
37821
+ }
37803
37822
 
37804
37823
  showAnnoType(chnid, chnidBase, type, title, residueArray, resid2resids) { let ic = this.icn3d, me = ic.icn3dui;
37805
37824
  let html = '<div id="' + ic.pre + chnid + '_' + type + 'seq_sequence" class="icn3d-dl_sequence">';
@@ -38457,7 +38476,7 @@ class AnnoIg {
38457
38476
  async showIg(chnid, template) { let ic = this.icn3d; ic.icn3dui;
38458
38477
  if(!ic.bRunRefnum || Object.keys(ic.atoms).length > Object.keys(ic.hAtoms).length) {
38459
38478
  await ic.refnumCls.showIgRefNum(template);
38460
- ic.bRunRefnum = true;
38479
+ ic.bRunRefnum = true;
38461
38480
  }
38462
38481
 
38463
38482
  let type = 'ig';
@@ -38502,7 +38521,6 @@ class AnnoIg {
38502
38521
 
38503
38522
  showRefNum(giSeq, chnid, kabat_or_imgt, bCustom) { let ic = this.icn3d, me = ic.icn3dui;
38504
38523
  let html = '', html2 = '', html3 = '';
38505
- let type = 'ig';
38506
38524
 
38507
38525
  if(!ic.chainid2refpdbname[chnid]) return {html: html, html2: html2, html3: html3};
38508
38526
 
@@ -38541,7 +38559,7 @@ class AnnoIg {
38541
38559
  }
38542
38560
 
38543
38561
  // auto-generate ref numbers for loops
38544
- let bLoop = false, currStrand = '', prevStrand = '';
38562
+ let currStrand = '', prevStrand = '';
38545
38563
  let refnumLabel, refnumStr_ori, refnumStr, postfix, strandPostfix, refnum, refnum3c, refnum2c;
38546
38564
  let bExtendedStrand = false, bSecThird9 = false;
38547
38565
 
@@ -38577,7 +38595,7 @@ class AnnoIg {
38577
38595
  bFoundAnchor = false;
38578
38596
  }
38579
38597
 
38580
- if(prevStrand.substr(0,1) == 'G' && !refnumLabel) { // indicate the end of an IG domain
38598
+ if((prevStrand.substr(0,1) == 'F' || prevStrand.substr(0,1) == 'G') && !refnumLabel) { // indicate the end of an IG domain
38581
38599
  bStart = false;
38582
38600
  }
38583
38601
 
@@ -38711,7 +38729,13 @@ class AnnoIg {
38711
38729
 
38712
38730
  // 2. remove strands with less than 3 residues except G strand
38713
38731
  for(let il = strandArray.length, i = il - 1; i >= 0; --i) {
38714
- if(strandArray[i].strand.substr(0, 1) != 'G' && strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
38732
+ let strandTmp = strandArray[i].strand.substr(0, 1);
38733
+ if(strandTmp != 'G' && strandArray[i].endRefnum - strandArray[i].startRefnum + 1 < 3) { // remove the strand
38734
+ if(strandTmp == 'B' || strandTmp == 'C' || strandTmp == 'E' || strandTmp == 'F') {
38735
+ if(!me.bNode) console.log("Some of the Ig strands B, C, E, F are missing...");
38736
+ return {html: '', html2: '', html3: ''};
38737
+ }
38738
+
38715
38739
  if(i != il - 1) { // modify
38716
38740
  strandArray[i + 1].loopResCnt += strandArray[i].loopResCnt + parseInt(strandArray[i].endResi) - parseInt(strandArray[i].startResi) + 1;
38717
38741
  }
@@ -38862,7 +38886,8 @@ class AnnoIg {
38862
38886
  }
38863
38887
  }
38864
38888
  else {
38865
- if(prevStrandCnt >= 0 && strandArray[prevStrandCnt].strand.substr(0, 1) == 'G') {
38889
+ if(prevStrandCnt >= 0
38890
+ && (strandArray[prevStrandCnt].strand.substr(0, 1) == 'F' || strandArray[prevStrandCnt].strand.substr(0, 1) == 'G')) {
38866
38891
  if(!bAfterGstrand) {
38867
38892
  //loopCnt = 0;
38868
38893
  refnumLabelNoPostfix = undefined;
@@ -38987,15 +39012,30 @@ class AnnoIg {
38987
39012
  }
38988
39013
  }
38989
39014
 
39015
+ // add color to atoms
39016
+ if(ic.bShowRefnum) {
39017
+ ic.opts.color = 'ig strand';
39018
+ ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
39019
+ }
39020
+
39021
+ return this.getIgAnnoHtml(chnid, giSeq, bCustom, kabat_or_imgt);
39022
+ }
39023
+
39024
+ getIgAnnoHtml(chnid, giSeq, bCustom, kabat_or_imgt) { let ic = this.icn3d, me = ic.icn3dui;
39025
+ let html = '', html2 = '', html3 = '';
39026
+ let type = 'ig';
39027
+
38990
39028
  if(!ic.chain2igArray) ic.chain2igArray = {};
38991
39029
  ic.chain2igArray[chnid] = [];
38992
39030
 
38993
39031
  let igElem = {};
38994
- bStart = false;
38995
39032
  let currStrand_ori;
38996
- prevStrand = undefined;
39033
+ let prevStrand = undefined;
38997
39034
  let prevPos;
38998
39035
 
39036
+ let bLoop = false, currStrand = '';
39037
+ let refnumLabel, refnumStr_ori, refnumStr;
39038
+
38999
39039
  // show tracks
39000
39040
  let htmlIg = '';
39001
39041
  for(let i = 0, il = giSeq.length; i < il; ++i) {
@@ -39029,7 +39069,6 @@ class AnnoIg {
39029
39069
  }
39030
39070
  else {
39031
39071
  refnumStr = refnumStr_ori;
39032
- refnum = parseInt(refnumStr);
39033
39072
  }
39034
39073
 
39035
39074
  let prevStrandFirstLet = (prevStrand) ? prevStrand.substr(0, 1) : '';
@@ -39185,9 +39224,9 @@ class AnnoIg {
39185
39224
  for(let i = 0, il = fromArray.length; i < il; ++i) {
39186
39225
  let resi = ic.ParserUtilsCls.getResi(chnid, fromArray[i]);
39187
39226
  let resid = chnid + "_" + resi;
39188
- let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
39189
- let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
39190
- let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
39227
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
39228
+ let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
39229
+ let color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
39191
39230
 
39192
39231
  let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) :
39193
39232
  Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
@@ -41458,6 +41497,7 @@ class Domain3d {
41458
41497
  }
41459
41498
  if(list_parts_item.length >= this.min_sse) list_partsTmp.push(list_parts[i]);
41460
41499
  }
41500
+
41461
41501
  list_parts = list_partsTmp;
41462
41502
 
41463
41503
  //for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
@@ -44148,8 +44188,8 @@ class Annotation {
44148
44188
  // ic.bIgShown = true;
44149
44189
 
44150
44190
  if(ic.bShowRefnum) {
44151
- ic.opts.color = 'ig strand';
44152
- ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
44191
+ // ic.opts.color = 'ig strand';
44192
+ // ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
44153
44193
 
44154
44194
  ic.hlUpdateCls.updateHlAll();
44155
44195
  ic.drawCls.draw();
@@ -67412,26 +67452,27 @@ class Dssp {
67412
67452
  let seg = queryData[0].segs[j];
67413
67453
  let resi = seg.t_start;
67414
67454
  let resid = chainid + '_' + resi;
67455
+ let q_start = parseInt(seg.q_start);
67415
67456
 
67416
- if(seg.q_start.indexOf('2550') != -1) {
67457
+ if(q_start > 2540 && q_start < 2560) {
67417
67458
  bBstrand = true;
67418
67459
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67419
- bBSheet = (atom.ss == 'sheet');
67460
+ if(atom.ss == 'helix') bBSheet = false;
67420
67461
  }
67421
- else if(seg.q_start.indexOf('3550') != -1) {
67462
+ else if(q_start > 3540 && q_start < 3560) {
67422
67463
  bCstrand = true;
67423
67464
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67424
- bBSheet = (atom.ss == 'sheet');
67465
+ if(atom.ss == 'helix') bCSheet = false;
67425
67466
  }
67426
- else if(seg.q_start.indexOf('7550') != -1) {
67467
+ else if(q_start > 7540 && q_start < 7560) {
67427
67468
  bEstrand = true;
67428
67469
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67429
- bBSheet = (atom.ss == 'sheet');
67470
+ if(atom.ss == 'helix') bESheet = false;
67430
67471
  }
67431
- else if(seg.q_start.indexOf('8550') != -1) {
67472
+ else if(q_start > 8540 && q_start < 8560) {
67432
67473
  bFstrand = true;
67433
67474
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67434
- bBSheet = (atom.ss == 'sheet');
67475
+ if(atom.ss == 'helix') bFSheet = false;
67435
67476
  }
67436
67477
 
67437
67478
  //if(bBstrand && bCstrand && bEstrand && bFstrand && bGstrand) break;
@@ -67439,9 +67480,10 @@ class Dssp {
67439
67480
  }
67440
67481
 
67441
67482
  if(!(bBstrand && bCstrand && bEstrand && bFstrand) || !(bBSheet && bCSheet && bESheet && bFSheet)) {
67442
- //if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
67483
+ // if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
67443
67484
  if(!me.bNode && !(bBstrand && bCstrand && bEstrand && bFstrand)) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
67444
67485
  if(!me.bNode && !(bBSheet && bCSheet && bESheet && bFSheet)) console.log("Some of the Ig strands B, C, E, F are not beta sheets...");
67486
+ // if(!me.bNode && (BCnt < 3 || CCnt < 3 || ECnt < 3 || FCnt < 3)) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
67445
67487
  if(ic.domainid2refpdbname[domainid] == refpdbname) {
67446
67488
  delete ic.domainid2refpdbname[domainid];
67447
67489
  delete ic.domainid2score[domainid];
@@ -67739,9 +67781,13 @@ class Dssp {
67739
67781
  refnumLabel = this.getLabelFromRefnum(refnum, currStrandFinal);
67740
67782
  }
67741
67783
 
67742
- ic.resid2refnum[resid] = refnumLabel;
67743
- ic.resid2refnum_ori[resid] = refnumLabel;
67744
- ic.resid2domainid[resid] = domainid;
67784
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67785
+ // only sheet or loop will be aligned
67786
+ if(atom.ss != 'helix') {
67787
+ ic.resid2refnum[resid] = refnumLabel;
67788
+ ic.resid2refnum_ori[resid] = refnumLabel;
67789
+ ic.resid2domainid[resid] = domainid;
67790
+ }
67745
67791
 
67746
67792
  // final reference numbers will be assign in ic.annoIgCls.showRefNum()
67747
67793
 
@@ -68088,6 +68134,8 @@ class Dssp {
68088
68134
  }
68089
68135
 
68090
68136
  async promiseWithFixedJobs(ajaxArray) { let ic = this.icn3d, me = ic.icn3dui;
68137
+ if(!me.bNode) me.icn3d.ParserUtilsCls.showLoading();
68138
+
68091
68139
  let dataArray3 = [];
68092
68140
  //let allPromise = Promise.allSettled(ajaxArray);
68093
68141
  //dataArray3 = await allPromise;
@@ -68110,6 +68158,8 @@ class Dssp {
68110
68158
  dataArray3 = dataArray3.concat(currDataArray);
68111
68159
  }
68112
68160
 
68161
+ if(!me.bNode) me.icn3d.ParserUtilsCls.hideLoading();
68162
+
68113
68163
  return dataArray3;
68114
68164
  }
68115
68165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.29.11",
3
+ "version": "3.29.13",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {