icn3d 3.29.11 → 3.29.12

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
@@ -11977,10 +11977,11 @@ class SetDialog {
11977
11977
  html += "<td></td>";
11978
11978
  html += "</tr><tr>";
11979
11979
  html += tmpStr1 + me.htmlCls.inputCheckStr + "id='" + me.pre + "anno_ig'>Ig Domains" + me.htmlCls.space2 + "</span></td>";
11980
+ */
11980
11981
 
11981
11982
  html += "<td></td>";
11982
11983
  html += "</tr></table></div></div>";
11983
- */
11984
+
11984
11985
  return html;
11985
11986
  }
11986
11987
  }
@@ -36842,14 +36843,12 @@ class AnnoCddSite {
36842
36843
 
36843
36844
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html += ic.showSeqCls.insertMulGap(ic.seqEndLen[chnid], '-');
36844
36845
 
36845
- let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.chains[chnid]);
36846
- let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
36847
- let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
36848
-
36849
36846
  if(ic.seqStartLen && ic.seqStartLen[chnid]) html2 += ic.showSeqCls.insertMulGapOverview(chnid, ic.seqStartLen[chnid]);
36850
36847
 
36851
36848
  if(me.cfg.blast_rep_id != chnid) { // regular
36852
36849
  for(let i = 0, il = fromArray.length; i < il; ++i) {
36850
+ let color = this.getColorFromPos(chnid, i, titleArray);
36851
+
36853
36852
  let emptyWidth;
36854
36853
  if(titleArray) {
36855
36854
  emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
@@ -36875,6 +36874,8 @@ class AnnoCddSite {
36875
36874
  toArray2.push(toArray[i]);
36876
36875
  }
36877
36876
  for(let i = 0, il = fromArray2.length; i < il; ++i) {
36877
+ let color = this.getColorFromPos(chnid, i, titleArray);
36878
+
36878
36879
  html2 += ic.showSeqCls.insertGapOverview(chnid, fromArray2[i]);
36879
36880
  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));
36880
36881
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
@@ -36899,6 +36900,24 @@ class AnnoCddSite {
36899
36900
  // getAdjustedResi(resi, chnid, matchedPos, chainsSeq, baseResi) { let ic = this.icn3d, me = ic.icn3dui;
36900
36901
  // return (resi >= matchedPos[chnid] && resi - matchedPos[chnid] < ic.chainsSeq[chnid].length) ? ic.chainsSeq[chnid][resi - matchedPos[chnid]].resi : baseResi[chnid] + 1 + resi;
36901
36902
  // }
36903
+ getColorFromPos(chainid, pos, bIg) { let ic = this.icn3d; ic.icn3dui;
36904
+ let color;
36905
+
36906
+ let resid = chainid + '_' + ic.ParserUtilsCls.getResi(chainid, pos);
36907
+ // if(!bIg) {
36908
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
36909
+ let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
36910
+ color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
36911
+ // }
36912
+ // else {
36913
+ // let refnumLabel = ic.resid2refnum[resid];
36914
+ // let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
36915
+ // let currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
36916
+ // color = ic.annoIgCls.getRefnumColor(currStrand, true).substr(1);
36917
+ // }
36918
+
36919
+ return color;
36920
+ }
36902
36921
 
36903
36922
  showAnnoType(chnid, chnidBase, type, title, residueArray, resid2resids) { let ic = this.icn3d, me = ic.icn3dui;
36904
36923
  let html = '<div id="' + ic.pre + chnid + '_' + type + 'seq_sequence" class="icn3d-dl_sequence">';
@@ -37556,7 +37575,7 @@ class AnnoIg {
37556
37575
  async showIg(chnid, template) { let ic = this.icn3d; ic.icn3dui;
37557
37576
  if(!ic.bRunRefnum || Object.keys(ic.atoms).length > Object.keys(ic.hAtoms).length) {
37558
37577
  await ic.refnumCls.showIgRefNum(template);
37559
- ic.bRunRefnum = true;
37578
+ ic.bRunRefnum = true;
37560
37579
  }
37561
37580
 
37562
37581
  let type = 'ig';
@@ -37601,7 +37620,6 @@ class AnnoIg {
37601
37620
 
37602
37621
  showRefNum(giSeq, chnid, kabat_or_imgt, bCustom) { let ic = this.icn3d, me = ic.icn3dui;
37603
37622
  let html = '', html2 = '', html3 = '';
37604
- let type = 'ig';
37605
37623
 
37606
37624
  if(!ic.chainid2refpdbname[chnid]) return {html: html, html2: html2, html3: html3};
37607
37625
 
@@ -37640,7 +37658,7 @@ class AnnoIg {
37640
37658
  }
37641
37659
 
37642
37660
  // auto-generate ref numbers for loops
37643
- let bLoop = false, currStrand = '', prevStrand = '';
37661
+ let currStrand = '', prevStrand = '';
37644
37662
  let refnumLabel, refnumStr_ori, refnumStr, postfix, strandPostfix, refnum, refnum3c, refnum2c;
37645
37663
  let bExtendedStrand = false, bSecThird9 = false;
37646
37664
 
@@ -37676,7 +37694,7 @@ class AnnoIg {
37676
37694
  bFoundAnchor = false;
37677
37695
  }
37678
37696
 
37679
- if(prevStrand.substr(0,1) == 'G' && !refnumLabel) { // indicate the end of an IG domain
37697
+ if((prevStrand.substr(0,1) == 'F' || prevStrand.substr(0,1) == 'G') && !refnumLabel) { // indicate the end of an IG domain
37680
37698
  bStart = false;
37681
37699
  }
37682
37700
 
@@ -37961,7 +37979,8 @@ class AnnoIg {
37961
37979
  }
37962
37980
  }
37963
37981
  else {
37964
- if(prevStrandCnt >= 0 && strandArray[prevStrandCnt].strand.substr(0, 1) == 'G') {
37982
+ if(prevStrandCnt >= 0
37983
+ && (strandArray[prevStrandCnt].strand.substr(0, 1) == 'F' || strandArray[prevStrandCnt].strand.substr(0, 1) == 'G')) {
37965
37984
  if(!bAfterGstrand) {
37966
37985
  //loopCnt = 0;
37967
37986
  refnumLabelNoPostfix = undefined;
@@ -38086,15 +38105,30 @@ class AnnoIg {
38086
38105
  }
38087
38106
  }
38088
38107
 
38108
+ // add color to atoms
38109
+ if(ic.bShowRefnum) {
38110
+ ic.opts.color = 'ig strand';
38111
+ ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
38112
+ }
38113
+
38114
+ return this.getIgAnnoHtml(chnid, giSeq, bCustom, kabat_or_imgt);
38115
+ }
38116
+
38117
+ getIgAnnoHtml(chnid, giSeq, bCustom, kabat_or_imgt) { let ic = this.icn3d, me = ic.icn3dui;
38118
+ let html = '', html2 = '', html3 = '';
38119
+ let type = 'ig';
38120
+
38089
38121
  if(!ic.chain2igArray) ic.chain2igArray = {};
38090
38122
  ic.chain2igArray[chnid] = [];
38091
38123
 
38092
38124
  let igElem = {};
38093
- bStart = false;
38094
38125
  let currStrand_ori;
38095
- prevStrand = undefined;
38126
+ let prevStrand = undefined;
38096
38127
  let prevPos;
38097
38128
 
38129
+ let bLoop = false, currStrand = '';
38130
+ let refnumLabel, refnumStr_ori, refnumStr;
38131
+
38098
38132
  // show tracks
38099
38133
  let htmlIg = '';
38100
38134
  for(let i = 0, il = giSeq.length; i < il; ++i) {
@@ -38128,7 +38162,6 @@ class AnnoIg {
38128
38162
  }
38129
38163
  else {
38130
38164
  refnumStr = refnumStr_ori;
38131
- refnum = parseInt(refnumStr);
38132
38165
  }
38133
38166
 
38134
38167
  let prevStrandFirstLet = (prevStrand) ? prevStrand.substr(0, 1) : '';
@@ -38284,9 +38317,9 @@ class AnnoIg {
38284
38317
  for(let i = 0, il = fromArray.length; i < il; ++i) {
38285
38318
  let resi = ic.ParserUtilsCls.getResi(chnid, fromArray[i]);
38286
38319
  let resid = chnid + "_" + resi;
38287
- let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
38288
- let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
38289
- let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
38320
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
38321
+ let colorStr =(!atom || atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
38322
+ let color =(atom && atom.color !== undefined) ? colorStr : "CCCCCC";
38290
38323
 
38291
38324
  let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) :
38292
38325
  Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
@@ -40557,6 +40590,7 @@ class Domain3d {
40557
40590
  }
40558
40591
  if(list_parts_item.length >= this.min_sse) list_partsTmp.push(list_parts[i]);
40559
40592
  }
40593
+
40560
40594
  list_parts = list_partsTmp;
40561
40595
 
40562
40596
  //for (lplet = list_parts.begin(); lplet != list_parts.end(); lpint++) {
@@ -43247,8 +43281,8 @@ class Annotation {
43247
43281
  // ic.bIgShown = true;
43248
43282
 
43249
43283
  if(ic.bShowRefnum) {
43250
- ic.opts.color = 'ig strand';
43251
- ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
43284
+ // ic.opts.color = 'ig strand';
43285
+ // ic.setColorCls.setColorByOptions(ic.opts, ic.dAtoms);
43252
43286
 
43253
43287
  ic.hlUpdateCls.updateHlAll();
43254
43288
  ic.drawCls.draw();
@@ -66505,42 +66539,50 @@ class Dssp {
66505
66539
  if(!bRound1 && queryData[0].segs) {
66506
66540
  let bBstrand = false, bCstrand = false, bEstrand = false, bFstrand = false;
66507
66541
  let bBSheet = true, bCSheet = true, bESheet = true, bFSheet = true;
66542
+ let BCnt = 0, CCnt = 0, ECnt = 0, FCnt = 0;
66508
66543
  let chainid = domainid.split(',')[0];
66509
66544
 
66510
66545
  for(let j = 0, jl = queryData[0].segs.length; j < jl; ++j) {
66511
66546
  let seg = queryData[0].segs[j];
66512
66547
  let resi = seg.t_start;
66513
66548
  let resid = chainid + '_' + resi;
66549
+ let q_start = parseInt(seg.q_start);
66514
66550
 
66515
- if(seg.q_start.indexOf('2550') != -1) {
66551
+ if(q_start > 2540 && q_start < 2560) {
66516
66552
  bBstrand = true;
66517
66553
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66518
- bBSheet = (atom.ss == 'sheet');
66554
+ if(atom.ss == 'helix') bBSheet = false;
66555
+ ++BCnt;
66519
66556
  }
66520
- else if(seg.q_start.indexOf('3550') != -1) {
66557
+ else if(q_start > 3540 && q_start < 3560) {
66521
66558
  bCstrand = true;
66522
66559
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66523
- bBSheet = (atom.ss == 'sheet');
66560
+ if(atom.ss == 'helix') bCSheet = false;
66561
+ ++CCnt;
66524
66562
  }
66525
- else if(seg.q_start.indexOf('7550') != -1) {
66563
+ else if(q_start > 7540 && q_start < 7560) {
66526
66564
  bEstrand = true;
66527
66565
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66528
- bBSheet = (atom.ss == 'sheet');
66566
+ if(atom.ss == 'helix') bESheet = false;
66567
+ ++ECnt;
66529
66568
  }
66530
- else if(seg.q_start.indexOf('8550') != -1) {
66569
+ else if(q_start > 8540 && q_start < 8560) {
66531
66570
  bFstrand = true;
66532
66571
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66533
- bBSheet = (atom.ss == 'sheet');
66572
+ if(atom.ss == 'helix') bFSheet = false;
66573
+ ++FCnt;
66534
66574
  }
66535
66575
 
66536
66576
  //if(bBstrand && bCstrand && bEstrand && bFstrand && bGstrand) break;
66537
66577
  if(bBstrand && bCstrand && bEstrand && bFstrand) break;
66538
66578
  }
66539
-
66540
- if(!(bBstrand && bCstrand && bEstrand && bFstrand) || !(bBSheet && bCSheet && bESheet && bFSheet)) {
66541
- //if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
66579
+
66580
+ if(!(bBstrand && bCstrand && bEstrand && bFstrand) || !(bBSheet && bCSheet && bESheet && bFSheet)
66581
+ || BCnt < 3 || CCnt < 3 || ECnt < 3 || FCnt < 3) {
66582
+ // if(!(bBstrand && bCstrand && bEstrand && bFstrand)) {
66542
66583
  if(!me.bNode && !(bBstrand && bCstrand && bEstrand && bFstrand)) console.log("Some of the Ig strands B, C, E, F are missing in the domain " + domainid + "...");
66543
66584
  if(!me.bNode && !(bBSheet && bCSheet && bESheet && bFSheet)) console.log("Some of the Ig strands B, C, E, F are not beta sheets...");
66585
+ 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 + "...");
66544
66586
  if(ic.domainid2refpdbname[domainid] == refpdbname) {
66545
66587
  delete ic.domainid2refpdbname[domainid];
66546
66588
  delete ic.domainid2score[domainid];
@@ -66838,9 +66880,13 @@ class Dssp {
66838
66880
  refnumLabel = this.getLabelFromRefnum(refnum, currStrandFinal);
66839
66881
  }
66840
66882
 
66841
- ic.resid2refnum[resid] = refnumLabel;
66842
- ic.resid2refnum_ori[resid] = refnumLabel;
66843
- ic.resid2domainid[resid] = domainid;
66883
+ let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66884
+ // only sheet or loop will be aligned
66885
+ if(atom.ss != 'helix') {
66886
+ ic.resid2refnum[resid] = refnumLabel;
66887
+ ic.resid2refnum_ori[resid] = refnumLabel;
66888
+ ic.resid2domainid[resid] = domainid;
66889
+ }
66844
66890
 
66845
66891
  // final reference numbers will be assign in ic.annoIgCls.showRefNum()
66846
66892
 
@@ -67187,6 +67233,8 @@ class Dssp {
67187
67233
  }
67188
67234
 
67189
67235
  async promiseWithFixedJobs(ajaxArray) { let ic = this.icn3d, me = ic.icn3dui;
67236
+ if(!me.bNode) me.icn3d.ParserUtilsCls.showLoading();
67237
+
67190
67238
  let dataArray3 = [];
67191
67239
  //let allPromise = Promise.allSettled(ajaxArray);
67192
67240
  //dataArray3 = await allPromise;
@@ -67209,6 +67257,8 @@ class Dssp {
67209
67257
  dataArray3 = dataArray3.concat(currDataArray);
67210
67258
  }
67211
67259
 
67260
+ if(!me.bNode) me.icn3d.ParserUtilsCls.hideLoading();
67261
+
67212
67262
  return dataArray3;
67213
67263
  }
67214
67264
  }