icn3d 3.29.8 → 3.29.10

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
@@ -8279,6 +8279,8 @@ class ClickMenu {
8279
8279
  thisClass.setLogCmd('ig refnum on', true);
8280
8280
  // await ic.refnumCls.showIgRefNum();
8281
8281
  // thisClass.setLogCmd('set annotation ig', true);
8282
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
8283
+
8282
8284
  let bSelection = true;
8283
8285
  await ic.annotationCls.setAnnoTabIg(bSelection);
8284
8286
 
@@ -8303,6 +8305,7 @@ class ClickMenu {
8303
8305
  thisClass.setLogCmd('ig template ' + template, true);
8304
8306
  let bSelection = true;
8305
8307
  // await ic.refnumCls.showIgRefNum(template);
8308
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
8306
8309
  await ic.annotationCls.setAnnoTabIg(bSelection, template);
8307
8310
  });
8308
8311
 
@@ -10428,8 +10431,8 @@ class SetMenu {
10428
10431
  //}
10429
10432
 
10430
10433
  //!!!
10431
- //html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
10432
- //html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
10434
+ // html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
10435
+ // html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
10433
10436
  }
10434
10437
  else {
10435
10438
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -10560,7 +10563,7 @@ class SetMenu {
10560
10563
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
10561
10564
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
10562
10565
  //!!!
10563
- //html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
10566
+ // html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
10564
10567
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
10565
10568
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
10566
10569
  }
@@ -10658,8 +10661,9 @@ class SetMenu {
10658
10661
  html += this.getLink('mn6_igrefYes', 'Show Ig for Selection', undefined, 2);
10659
10662
  html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
10660
10663
  html += this.getLink('mn6_igrefNo', 'Reset Ig Ref. Number', undefined, 2);
10661
- */
10664
+
10662
10665
  html += this.getMenuSep();
10666
+ */
10663
10667
 
10664
10668
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
10665
10669
  html += "</ul>";
@@ -15595,6 +15599,14 @@ class Events {
15595
15599
  thisClass.setLogCmd('define igloop sets | chain ' + chainid, true);
15596
15600
  });
15597
15601
 
15602
+ $(document).on("click", ".icn3d-igdomainsets", function(e) { let ic = me.icn3d;
15603
+ e.stopImmediatePropagation();
15604
+ //e.preventDefault();
15605
+ let chainid = $(this).attr('chainid');
15606
+ ic.addTrackCls.defineIgstrand(chainid, 'igdomain');
15607
+ thisClass.setLogCmd('define igdomain sets | chain ' + chainid, true);
15608
+ });
15609
+
15598
15610
  me.myEventCls.onIds("#" + me.pre + "deletesets", "click", function(e) { let ic = me.icn3d;
15599
15611
  ic.definedSetsCls.deleteSelectedSets();
15600
15612
  thisClass.setLogCmd("delete selected sets", true);
@@ -33374,7 +33386,7 @@ class Instancing {
33374
33386
  }
33375
33387
 
33376
33388
  if(ic.mdlImpostor !== undefined) {
33377
- // after three.js version 128, the cylinder impostor seemed to have a problem in cloning!!!
33389
+ // after three.js version 128, the cylinder impostor seemed to have a problem in cloning
33378
33390
  symmetryMate = ic.mdlImpostor.clone();
33379
33391
  //symmetryMate.applyMatrix(mat);
33380
33392
  this.applyMat(symmetryMate, mat);
@@ -37733,7 +37745,13 @@ class AnnoCddSite {
37733
37745
 
37734
37746
  if(me.cfg.blast_rep_id != chnid) { // regular
37735
37747
  for(let i = 0, il = fromArray.length; i < il; ++i) {
37736
- 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);
37748
+ let emptyWidth;
37749
+ if(titleArray) {
37750
+ emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
37751
+ }
37752
+ else {
37753
+ 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);
37754
+ }
37737
37755
 
37738
37756
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
37739
37757
  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>';
@@ -38987,7 +39005,7 @@ class AnnoIg {
38987
39005
  refnumLabel = ic.resid2refnum[residueid];
38988
39006
  let bHidelabel = false;
38989
39007
 
38990
- if(refnumLabel) {
39008
+ if(refnumLabel) {
38991
39009
  refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
38992
39010
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
38993
39011
  currStrand_ori = currStrand;
@@ -39019,8 +39037,9 @@ class AnnoIg {
39019
39037
 
39020
39038
  igElem = {};
39021
39039
  igElem.startPos = i;
39022
- igElem.domainid = domainid;
39023
39040
  }
39041
+
39042
+ if(domainid) igElem.domainid = domainid;
39024
39043
 
39025
39044
  if(bCustom) {
39026
39045
  if(!refnumStr) {
@@ -39078,6 +39097,8 @@ class AnnoIg {
39078
39097
 
39079
39098
  igElem.endPos = prevPos;
39080
39099
  ic.chain2igArray[chnid].push(igElem);
39100
+
39101
+ if(me.bNode) return {html: '', html2: '', html3: ''};
39081
39102
  let titleSpace = 120;
39082
39103
 
39083
39104
  let linkStr = 'icn3d-link icn3d-blue';
@@ -39133,11 +39154,14 @@ class AnnoIg {
39133
39154
  html += '</div>';
39134
39155
  html += '</div>';
39135
39156
 
39136
- let igArray = ic.chain2igArray[chnid];
39157
+ let igArray = ic.chain2igArray[chnid];
39158
+ if(igArray.length == 0) return {html: '', html2: '', html3: ''};
39137
39159
  let rangeArray = [], titleArray = [], fullTitleArray = [], domainArray = [];
39138
39160
  for(let i = 0, il = igArray.length; i < il; ++i) {
39139
39161
  let domainid = igArray[i].domainid;
39140
39162
  let info = ic.domainid2info[domainid];
39163
+ if(!info) continue;
39164
+
39141
39165
  let tmscore = info.score;
39142
39166
  let igType = ic.ref2igtype[info.refpdbname];
39143
39167
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
@@ -39148,6 +39172,7 @@ class AnnoIg {
39148
39172
  range.locs = [{"from":igArray[i].startPos, "to":igArray[i].endPos}];
39149
39173
  rangeArray.push(range);
39150
39174
  }
39175
+ if(titleArray.length == 0) return {html: '', html2: '', html3: ''};
39151
39176
 
39152
39177
  // add tracks for the summary view
39153
39178
  for(let i = 0, il = fromArray.length; i < il; ++i) {
@@ -39157,10 +39182,10 @@ class AnnoIg {
39157
39182
  let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
39158
39183
  let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
39159
39184
 
39160
- let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) :
39185
+ let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) :
39161
39186
  Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
39162
39187
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
39163
- 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[i] + '" index="0" setname="' + chnid + '_igs" id="' + chnid + '_igs" anno="sequence" chain="' + chnid + '" title="' + domainArray[i] + '">' + domainArray[i] + ' </div>';
39188
+ 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[i] + '" index="0" setname="' + chnid + '_igs" id="' + chnid + '_igs" anno="sequence" chain="' + chnid + '" title="' + domainArray[i] + '">' + domainArray[i] + ' </div>';
39164
39189
  }
39165
39190
 
39166
39191
  html2 += htmlCnt;
@@ -42484,91 +42509,115 @@ class AddTrack {
42484
42509
  let selectedResidues = {};
42485
42510
  let bUnion = false, bUpdateHighlight = true;
42486
42511
 
42487
- let strandCnt = 0, loopCnt = 0;
42488
- let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
42489
-
42490
42512
  // clear selection
42491
42513
  ic.hAtoms = {};
42492
42514
 
42493
- let bStart = false;
42494
-
42495
- for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
42496
- let currResi = ic.chainsSeq[chainid][i].resi;
42497
- let resid = chainid + '_' + currResi;
42515
+ if(type == 'igdomain') {
42516
+ let igArray = ic.chain2igArray[chainid];
42498
42517
 
42499
- if(!ic.residues.hasOwnProperty(resid) ) continue;
42500
-
42501
- let refnumLabel, refnumStr, refnum;
42502
- refnumLabel = ic.resid2refnum[resid];
42503
- if(!refnumLabel) continue;
42518
+ if(igArray && igArray.length > 0) {
42519
+
42520
+ for(let i = 0, il = igArray.length; i < il; ++i) {
42521
+ let startPos = igArray[i].startPos;
42522
+ let endPos = igArray[i].endPos;
42523
+ let domainid = igArray[i].domainid;
42504
42524
 
42505
- refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42506
- currStrand = refnumLabel.replace(refnumStr, '');
42507
- refnum = parseInt(refnumStr);
42525
+ selectedResidues = {};
42526
+ for(let j = parseInt(startPos); j <= parseInt(endPos); ++j) {
42527
+ let currResi = ic.chainsSeq[chainid][j].resi;
42528
+ let resid = chainid + '_' + currResi;
42529
+ selectedResidues[resid] = 1;
42530
+ }
42508
42531
 
42509
- if(type == 'iganchor') {
42510
- if(refnum > 1000 && refnumStr.substr(refnumStr.length - 2, 2) == '50') {
42511
- selectedResidues[resid] = 1;
42512
- }
42513
- }
42514
- else {
42515
- if(ic.residIgLoop.hasOwnProperty(resid)) {
42516
- currType = 'igloop';
42532
+ let setName = domainid;
42533
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42517
42534
  }
42535
+ }
42536
+ }
42537
+ else {
42538
+ let strandCnt = 0, loopCnt = 0;
42539
+ let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
42540
+
42541
+ let bStart = false;
42542
+
42543
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
42544
+ let currResi = ic.chainsSeq[chainid][i].resi;
42545
+ let resid = chainid + '_' + currResi;
42546
+
42547
+ if(!ic.residues.hasOwnProperty(resid) ) continue;
42548
+
42549
+ let refnumLabel, refnumStr, refnum;
42550
+ refnumLabel = ic.resid2refnum[resid];
42551
+ if(!refnumLabel) continue;
42552
+
42553
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42554
+ currStrand = refnumLabel.replace(refnumStr, '');
42555
+ refnum = parseInt(refnumStr);
42556
+
42557
+ if(type == 'iganchor') {
42558
+ if(refnum > 1000 && refnumStr.substr(refnumStr.length - 2, 2) == '50') {
42559
+ selectedResidues[resid] = 1;
42560
+ }
42561
+ }
42518
42562
  else {
42519
- currType = 'igstrand';
42520
- }
42563
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
42564
+ currType = 'igloop';
42565
+ }
42566
+ else {
42567
+ currType = 'igstrand';
42568
+ }
42521
42569
 
42522
- if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
42523
- if(prevType == 'igstrand') {
42524
- ++strandCnt;
42525
- setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
42526
- setName = setName.replace(/'/g, '`');
42527
- if(type == 'igstrand') {
42528
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42529
- if(!bUnion) bUnion = true;
42570
+ if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
42571
+ if(prevType == 'igstrand') {
42572
+ ++strandCnt;
42573
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
42574
+ setName = setName.replace(/'/g, '`');
42575
+ if(type == 'igstrand') {
42576
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42577
+ if(!bUnion) bUnion = true;
42578
+ }
42579
+ prevStrandReal = prevStrand;
42530
42580
  }
42531
- prevStrandReal = prevStrand;
42532
- }
42533
- else if(prevType == 'igloop') {
42534
- ++loopCnt;
42535
- setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
42536
- setName = setName.replace(/'/g, '`');
42537
- if(type == 'igloop') {
42538
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42539
- if(!bUnion) bUnion = true;
42581
+ else if(prevType == 'igloop') {
42582
+ ++loopCnt;
42583
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
42584
+ setName = setName.replace(/'/g, '`');
42585
+ if(type == 'igloop') {
42586
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42587
+ if(!bUnion) bUnion = true;
42588
+ }
42540
42589
  }
42541
- }
42542
42590
 
42543
- selectedResidues = {};
42544
- }
42591
+ selectedResidues = {};
42592
+ }
42545
42593
 
42546
- selectedResidues[resid] = 1;
42594
+ selectedResidues[resid] = 1;
42547
42595
 
42548
- prevStrand = currStrand;
42549
- prevType = currType;
42596
+ prevStrand = currStrand;
42597
+ prevType = currType;
42550
42598
 
42551
- bStart = true;
42552
- }
42553
- } // for loop
42599
+ bStart = true;
42600
+ }
42601
+ } // for loop
42554
42602
 
42555
- if(type == 'iganchor') {
42556
- setName = 'Anchor-' + chainid;
42557
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42558
- }
42559
- else {
42560
- if(prevType == 'igstrand') {
42561
- ++strandCnt;
42562
- setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
42563
- setName = setName.replace(/'/g, '`');
42564
- if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42603
+ if(type == 'iganchor') {
42604
+ setName = 'Anchor-' + chainid;
42605
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42565
42606
  }
42566
- else if(prevType == 'igloop') {
42567
- ++loopCnt;
42568
- currStrand = 'CT';
42569
- setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
42570
- setName = setName.replace(/'/g, '`');
42571
- if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42607
+ else {
42608
+ if(prevType == 'igstrand') {
42609
+ ++strandCnt;
42610
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
42611
+ setName = setName.replace(/'/g, '`');
42612
+ if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42613
+ }
42614
+ else if(prevType == 'igloop') {
42615
+ ++loopCnt;
42616
+ currStrand = 'CT';
42617
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
42618
+ setName = setName.replace(/'/g, '`');
42619
+ if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
42620
+ }
42572
42621
  }
42573
42622
  }
42574
42623
  }
@@ -44427,10 +44476,12 @@ class ShowAnno {
44427
44476
  + this.addButton(chnid, "icn3d-sheetsets", "Sheet Sets", "Define sets for each sheet in this chain and add them to the menu of \"Defined Sets\"", 60, buttonStyle) + "&nbsp;"
44428
44477
  + this.addButton(chnid, "icn3d-coilsets", "Coil Sets", "Define sets for each coil in this chain and add them to the menu of \"Defined Sets\"", 60, buttonStyle);
44429
44478
 
44430
- if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
44431
- chainHtml += "&nbsp;&nbsp;&nbsp;" + this.addButton(chnid, "icn3d-iganchorsets", "Ig Anchor Set", "Define the set for all Ig anchors in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle) + "&nbsp;" + this.addButton(chnid, "icn3d-igstrandsets", "Ig Strand Sets", "Define sets for each Ig strand in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle) + "&nbsp;"
44432
- + this.addButton(chnid, "icn3d-igloopsets", "Ig Loop Sets", "Define sets for each Ig loop in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle);
44433
- }
44479
+ // if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
44480
+ chainHtml += "&nbsp;&nbsp;&nbsp;" + this.addButton(chnid, "icn3d-iganchorsets", "Ig Anchor Set", "Define the set for all Ig anchors in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle) + "&nbsp;"
44481
+ + this.addButton(chnid, "icn3d-igstrandsets", "Ig Strand Sets", "Define sets for each Ig strand in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle) + "&nbsp;"
44482
+ + this.addButton(chnid, "icn3d-igloopsets", "Ig Loop Sets", "Define sets for each Ig loop in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle) + "&nbsp;"
44483
+ + this.addButton(chnid, "icn3d-igdomainsets", "Ig Domain Sets", "Define sets for each Ig domain in this chain and add them to the menu of \"Defined Sets\"", 80, buttonStyle);
44484
+ // }
44434
44485
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
44435
44486
  //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
44436
44487
  let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction', 'ig'];
@@ -61073,6 +61124,7 @@ class ApplyCommand {
61073
61124
  await ic.annotationCls.setAnnoTabIg();
61074
61125
  }
61075
61126
  else if(command == 'ig refnum on') {
61127
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
61076
61128
  await ic.annotationCls.setAnnoTabIg(true);
61077
61129
  }
61078
61130
  else if(command == 'highlight level up') {
@@ -63562,6 +63614,7 @@ class LoadScript {
63562
63614
  else if(command.indexOf('ig template') == 0 ) {
63563
63615
  let template = command.substr(command.lastIndexOf(' ') + 1);
63564
63616
  // await ic.refnumCls.showIgRefNum(template);
63617
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
63565
63618
  await ic.annotationCls.setAnnoTabIg(true, template);
63566
63619
  }
63567
63620
  else if(command.indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
@@ -63765,6 +63818,7 @@ class LoadScript {
63765
63818
  }
63766
63819
  else if(lastCommand.indexOf('ig refnum on') == 0) {
63767
63820
  // await ic.refnumCls.showIgRefNum();
63821
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
63768
63822
  await ic.annotationCls.setAnnoTabIg(true);
63769
63823
  }
63770
63824
  else if(lastCommand.indexOf('set annotation 3ddomain') == 0) {
@@ -63891,7 +63945,7 @@ class LoadScript {
63891
63945
  let idNew = '';
63892
63946
  for(let i = 0, il = idArray.length; i < il; ++i) {
63893
63947
  if(!(ic.structures && ic.structures.hasOwnProperty(idArray[i]))) {
63894
- if(!idNew) idNew += ',';
63948
+ if(idNew) idNew += ',';
63895
63949
  idNew += idArray[i];
63896
63950
  }
63897
63951
  }
@@ -66812,7 +66866,9 @@ class Dssp {
66812
66866
  ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'CD3d_6jxrd_human_Iset'];
66813
66867
  ic.refpdbHash['1CD3g_6jxrg_human_Iset'] = ['CD3g_6jxrg_human_Iset', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria'];
66814
66868
  ic.refpdbHash['1CD28_1yjdC_human_V'] = ['CD28_1yjdC_human_V', 'MPT63_1lmiA_bacteria', 'CD3e_6jxrf_human_Iset'];
66815
- ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
66869
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
66870
+
66871
+ ic.refpdbHash['all_templates'] = ['ASF1A_2iijA_human', 'B2Microglobulin_7phrL_human_C1', 'BArrestin1_4jqiA_rat_n1', 'BTLA_2aw2A_human_Iset', 'C3_2qkiD_human_n1', 'CD19_6al5A_human_C2orV-n1', 'CD28_1yjdC_human_V', 'CD2_1hnfA_human_C2-n2', 'CD2_1hnfA_human_V-n1', 'CD3d_6jxrd_human_Iset', 'CD3e_6jxrf_human_Iset', 'CD3g_6jxrg_human_Iset', 'CD8a_1cd8A_human_V', 'CoAtomerGamma1_1r4xA_human', 'Contactin1_2ee2A_human_FN3-n9', 'Contactin1_3s97C_human_C2-n2', 'CuZnSuperoxideDismutase_1hl5C_human', 'ECadherin_4zt1A_human_n2', 'Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'FAB-HEAVY_5esv_C1-n2', 'FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_C1-n2', 'FAB-LIGHT_5esv_V-n1', 'GHR_1axiB_human_FN3-n1', 'ICOS_6x4gA_human_V', 'IL6Rb_1bquB_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n3', 'InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2', 'IsdA_2iteA_bacteria', 'JAM1_1nbqA_human_VorIset-n2', 'LAG3_7tzgD_human_C2-n2', 'LAG3_7tzgD_human_V-n1', 'LaminAC_1ifrA_human', 'MHCIa_7phrH_human_C1', 'MPT63_1lmiA_bacteria', 'NaCaExchanger_2fwuA_dog_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'ORF7a_1xakA_virus', 'PD1_4zqkB_human_V', 'PDL1_4z18B_human_V-n1', 'Palladin_2dm3A_human_Iset-n1', 'RBPJ_6py8C_human_Unk-n1', 'RBPJ_6py8C_human_Unk-n2', 'Sidekick2_1wf5A_human_FN3-n7', 'Siglec3_5j0bB_human_C2-n2', 'TCRa_6jxrm_human_C1-n2', 'TCRa_6jxrm_human_V-n1', 'TEAD1_3kysC_human', 'TP34_2o6cA_bacteria', 'TP47_1o75A_bacteria', 'Titin_4uowM_human_Unk-n152', 'VISTA_6oilA_human_V', 'VNAR_1t6vN_shark_V', 'VTCN1_Q7Z7D3_human_V-n2'];
66816
66872
 
66817
66873
  // use known ref structure
66818
66874
  ic.refpdbHash['5ESV_C'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2'];
@@ -66869,9 +66925,9 @@ class Dssp {
66869
66925
 
66870
66926
  ic.ref2igtype['ASF1A_2iijA_human'] = 'IgE';
66871
66927
  ic.ref2igtype['B2Microglobulin_7phrL_human_C1'] = 'IgC1';
66872
- ic.ref2igtype['BArrestin1_4jqiA_rat_n1'] = 'IgFn3-like';
66928
+ ic.ref2igtype['BArrestin1_4jqiA_rat_n1'] = 'IgFN3-like';
66873
66929
  ic.ref2igtype['BTLA_2aw2A_human_Iset'] = 'IgI';
66874
- ic.ref2igtype['C3_2qkiD_human_n1'] = 'IgFn3-like';
66930
+ ic.ref2igtype['C3_2qkiD_human_n1'] = 'IgFN3-like';
66875
66931
  ic.ref2igtype['CD19_6al5A_human_C2orV-n1'] = 'other Ig'; //'CD19';
66876
66932
  ic.ref2igtype['CD28_1yjdC_human_V'] = 'IgV';
66877
66933
  ic.ref2igtype['CD2_1hnfA_human_C2-n2'] = 'IgC2';
@@ -66881,7 +66937,7 @@ class Dssp {
66881
66937
  ic.ref2igtype['CD3g_6jxrg_human_Iset'] = 'IgI';
66882
66938
  ic.ref2igtype['CD8a_1cd8A_human_V'] = 'IgV';
66883
66939
  ic.ref2igtype['CoAtomerGamma1_1r4xA_human'] = 'IgE';
66884
- ic.ref2igtype['Contactin1_2ee2A_human_FN3-n9'] = 'IgFn3';
66940
+ ic.ref2igtype['Contactin1_2ee2A_human_FN3-n9'] = 'IgFN3';
66885
66941
  ic.ref2igtype['Contactin1_3s97C_human_C2-n2'] = 'IgC2';
66886
66942
  ic.ref2igtype['CuZnSuperoxideDismutase_1hl5C_human'] = 'other Ig'; //'SOD';
66887
66943
  ic.ref2igtype['ECadherin_4zt1A_human_n2'] = 'other Ig'; //'Cadherin';
@@ -66890,12 +66946,12 @@ class Dssp {
66890
66946
  ic.ref2igtype['FAB-HEAVY_5esv_V-n1'] = 'IgV';
66891
66947
  ic.ref2igtype['FAB-LIGHT_5esv_C1-n2'] = 'IgC1';
66892
66948
  ic.ref2igtype['FAB-LIGHT_5esv_V-n1'] = 'IgV';
66893
- ic.ref2igtype['GHR_1axiB_human_FN3-n1'] = 'IgFn3';
66949
+ ic.ref2igtype['GHR_1axiB_human_FN3-n1'] = 'IgFN3';
66894
66950
  ic.ref2igtype['ICOS_6x4gA_human_V'] = 'IgV';
66895
- ic.ref2igtype['IL6Rb_1bquB_human_FN3-n2'] = 'IgFn3';
66896
- ic.ref2igtype['IL6Rb_1bquB_human_FN3-n3'] = 'IgFn3';
66897
- ic.ref2igtype['InsulinR_8guyE_human_FN3-n1'] = 'IgFn3';
66898
- ic.ref2igtype['InsulinR_8guyE_human_FN3-n2'] = 'IgFn3';
66951
+ ic.ref2igtype['IL6Rb_1bquB_human_FN3-n2'] = 'IgFN3';
66952
+ ic.ref2igtype['IL6Rb_1bquB_human_FN3-n3'] = 'IgFN3';
66953
+ ic.ref2igtype['InsulinR_8guyE_human_FN3-n1'] = 'IgFN3';
66954
+ ic.ref2igtype['InsulinR_8guyE_human_FN3-n2'] = 'IgFN3';
66899
66955
  ic.ref2igtype['IsdA_2iteA_bacteria'] = 'IgE';
66900
66956
  ic.ref2igtype['JAM1_1nbqA_human_VorIset-n2'] = 'IgI';
66901
66957
  ic.ref2igtype['LAG3_7tzgD_human_C2-n2'] = 'IgC2';
@@ -66909,9 +66965,9 @@ class Dssp {
66909
66965
  ic.ref2igtype['PD1_4zqkB_human_V'] = 'IgV';
66910
66966
  ic.ref2igtype['PDL1_4z18B_human_V-n1'] = 'IgV';
66911
66967
  ic.ref2igtype['Palladin_2dm3A_human_Iset-n1'] = 'IgI';
66912
- ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFn3-like';
66913
- ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFn3-like';
66914
- ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFn3';
66968
+ ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFN3-like';
66969
+ ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
66970
+ ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFN3';
66915
66971
  ic.ref2igtype['Siglec3_5j0bB_human_C2-n2'] = 'IgC2';
66916
66972
  ic.ref2igtype['TCRa_6jxrm_human_C1-n2'] = 'IgC1';
66917
66973
  ic.ref2igtype['TCRa_6jxrm_human_V-n1'] = 'IgV';
@@ -66976,7 +67032,7 @@ class Dssp {
66976
67032
  let thisClass = this;
66977
67033
 
66978
67034
  let struArray = Object.keys(ic.structures);
66979
-
67035
+
66980
67036
  let ajaxArray = [];
66981
67037
  let domainidpairArray = [];
66982
67038
 
@@ -66995,7 +67051,7 @@ class Dssp {
66995
67051
  for(let j = 0, jl = chainidArray.length; j < jl; ++j) {
66996
67052
  let chainid = chainidArray[j];
66997
67053
 
66998
- // for selected atoms only
67054
+ // for selected atoms only, assign ic.resid2domainid[resid]
66999
67055
  let domainAtomsArray = this.getDomainAtomsArray(chainid, bRerun);
67000
67056
 
67001
67057
  if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
@@ -67012,8 +67068,8 @@ class Dssp {
67012
67068
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtomsArray[k]);
67013
67069
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtomsArray[k]);
67014
67070
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtomsArray[k]).length;
67015
- //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
67016
- let domainid = chainid + ',' + k + '_' + resiSum;
67071
+ //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
67072
+ let domainid = chainid + ',' + k + '_' + resiSum;
67017
67073
  ic.domainid2pdb[domainid] = pdb_target;
67018
67074
 
67019
67075
  if(!template) {
@@ -67031,7 +67087,7 @@ class Dssp {
67031
67087
  // let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
67032
67088
 
67033
67089
  ajaxArray.push(alignAjax);
67034
-
67090
+
67035
67091
  domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
67036
67092
  }
67037
67093
  }
@@ -67051,14 +67107,14 @@ class Dssp {
67051
67107
  // dataArray2 = await allPromise;
67052
67108
 
67053
67109
  dataArray2 = await this.promiseWithFixedJobs(ajaxArray);
67054
-
67110
+
67055
67111
  let bRound1 = true;
67056
- await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
67112
+ bNoMoreIg = await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
67057
67113
 
67058
67114
  /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
67059
67115
  }
67060
67116
  else {
67061
- if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
67117
+ if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
67062
67118
 
67063
67119
  // start round2
67064
67120
  let ajaxArray = [];
@@ -67073,36 +67129,36 @@ class Dssp {
67073
67129
  //let allPromise2 = Promise.allSettled(pdbAjaxArray);
67074
67130
  //ic.pdbDataArray = await allPromise2;
67075
67131
 
67076
- ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
67132
+ let pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
67077
67133
 
67078
67134
  for(let domainid in ic.domainid2refpdbname) {
67079
67135
  ic.domainid2refpdbname[domainid];
67080
67136
  domainid.substr(0, domainid.indexOf(','));
67081
67137
 
67082
67138
  let pdb_target = ic.domainid2pdb[domainid];
67083
- for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
67139
+ for(let index = 0, indexl = pdbDataArray.length; index < indexl; ++index) {
67084
67140
  let struct2 = ic.defaultPdbId + index;
67085
- let pdb_query = ic.pdbDataArray[index].value; //[0];
67141
+ let pdb_query = pdbDataArray[index].value; //[0];
67086
67142
 
67087
67143
  let header = 'HEADER ' + struct2 + '\n';
67088
67144
  pdb_query = header + pdb_query;
67089
-
67145
+
67090
67146
  let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": template};
67091
67147
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
67092
67148
  ajaxArray.push(alignAjax);
67093
-
67149
+
67094
67150
  //domainidpairArray3.push(domainid + "," + refpdbname);
67095
67151
  domainidpairArray3.push(domainid + "|" + template);
67096
67152
  }
67097
67153
  }
67098
-
67154
+
67099
67155
  let dataArray3 = [];
67100
67156
  //let allPromise = Promise.allSettled(ajaxArray);
67101
67157
  //dataArray3 = await allPromise;
67102
67158
 
67103
67159
  dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
67104
-
67105
- await thisClass.parseAlignData(dataArray3, domainidpairArray3);
67160
+
67161
+ bNoMoreIg = await thisClass.parseAlignData(dataArray3, domainidpairArray3);
67106
67162
  }
67107
67163
 
67108
67164
  return bNoMoreIg;
@@ -67118,8 +67174,8 @@ class Dssp {
67118
67174
  }
67119
67175
  //console.log("Error in aligning with TM-align...");
67120
67176
  return;
67121
- }
67122
- */
67177
+ }
67178
+ */
67123
67179
  }
67124
67180
 
67125
67181
  getDomainAtomsArray(chainid, bRerunDomain) { let ic = this.icn3d, me = ic.icn3dui;
@@ -67162,21 +67218,22 @@ class Dssp {
67162
67218
  //let result = ic.domain3dCls.c2b_NewSplitChain(ic.chains[chainid]);
67163
67219
  // assign ref numbers to selected residues
67164
67220
  let result = ic.domain3dCls.c2b_NewSplitChain(currAtoms, undefined);
67165
- let subdomains = result.subdomains;
67221
+ let subdomains = result.subdomains;
67166
67222
  let pos2resi = result.pos2resi;
67167
67223
 
67168
67224
  if(subdomains.length <= 1) {
67169
67225
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
67170
67226
  if(residueArray.length < minResidues) return domainAtomsArray;
67171
-
67227
+ /*
67172
67228
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(currAtoms);
67173
67229
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(currAtoms);
67174
67230
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(currAtoms).length;
67175
-
67231
+ */
67176
67232
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
67177
67233
  let resid = residueArray[n];
67178
- ic.resid2domainid[resid] = chainid + ',0' + '_' + resiSum;
67179
-
67234
+ /*
67235
+ ic.resid2domainid[resid] = chainid + ',0' + '_' + resiSum;
67236
+ */
67180
67237
  // clear previous refnum assignment if any
67181
67238
  // if(!bRerunDomain && ic.resid2refnum && ic.resid2refnum[resid]) {
67182
67239
  // if(ic.resid2refnum && ic.resid2refnum[resid]) {
@@ -67187,7 +67244,7 @@ class Dssp {
67187
67244
 
67188
67245
  domainAtomsArray.push(currAtoms);
67189
67246
  }
67190
- else {
67247
+ else {
67191
67248
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
67192
67249
  let domainAtoms = {};
67193
67250
  let segArray = subdomains[k];
@@ -67214,7 +67271,7 @@ class Dssp {
67214
67271
  if(resCnt < minResidues) continue;
67215
67272
 
67216
67273
  domainAtomsArray.push(domainAtoms);
67217
-
67274
+ /*
67218
67275
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtoms);
67219
67276
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtoms);
67220
67277
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtoms).length;
@@ -67225,15 +67282,16 @@ class Dssp {
67225
67282
  for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
67226
67283
  let resid = chainid + '_' + pos2resi[n];
67227
67284
  //domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
67228
- ic.resid2domainid[resid] = chainid + ',' + k + '_' + resiSum;
67285
+ ic.resid2domainid[resid] = chainid + ',' + k + '_' + resiSum;
67229
67286
  }
67230
67287
  }
67288
+ */
67231
67289
  }
67232
67290
  }
67233
67291
 
67234
67292
  return domainAtomsArray;
67235
67293
  }
67236
-
67294
+
67237
67295
  getTemplateList(domainid) { let ic = this.icn3d; ic.icn3dui;
67238
67296
  let refpdbname = '', score = '', seqid = '', nresAlign = '';
67239
67297
 
@@ -67266,7 +67324,6 @@ class Dssp {
67266
67324
  if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
67267
67325
 
67268
67326
  let minResidues = 20;
67269
-
67270
67327
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
67271
67328
  //let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
67272
67329
  let queryData = (dataArray[i]) ? dataArray[i].value : undefined; //[0];
@@ -67277,7 +67334,7 @@ class Dssp {
67277
67334
  }
67278
67335
 
67279
67336
  if(queryData[0].score === undefined) continue;
67280
-
67337
+
67281
67338
  //let domainid_index = domainidpairArray[i].split(',');
67282
67339
  //let domainid = domainid_index[0];
67283
67340
  let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
@@ -67298,7 +67355,7 @@ class Dssp {
67298
67355
  continue;
67299
67356
  }
67300
67357
  }
67301
-
67358
+
67302
67359
  if(!bRound1) {
67303
67360
  if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
67304
67361
  }
@@ -67361,8 +67418,13 @@ class Dssp {
67361
67418
  }
67362
67419
 
67363
67420
  if(!domainid2segs.hasOwnProperty(domainid) || queryData[0].score >= ic.domainid2score[domainid].split('_')[0]) {
67364
- ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
67365
- ic.domainid2refpdbname[domainid] = refpdbname;
67421
+ ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
67422
+ if(bRound1) {
67423
+ ic.domainid2refpdbname[domainid] = parseFloat(queryData[0].score) > 0.75 ? refpdbname : 'all_templates';
67424
+ }
67425
+ else {
67426
+ ic.domainid2refpdbname[domainid] = refpdbname;
67427
+ }
67366
67428
  domainid2segs[domainid] = queryData[0].segs;
67367
67429
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
67368
67430
  ic.domainid2ig2imgt[domainid] = queryData[0].ig2imgt;
@@ -67373,10 +67435,17 @@ class Dssp {
67373
67435
  }
67374
67436
 
67375
67437
  async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
67438
+ let bNoMoreIg = false;
67439
+
67376
67440
  let domainid2segs = this.parseAlignData_part1(dataArray, domainidpairArray, bRound1);
67377
67441
 
67442
+ if(Object.keys(domainid2segs).length == 0) {
67443
+ bNoMoreIg = true;
67444
+ return bNoMoreIg;
67445
+ }
67446
+
67378
67447
  if(bRound1) {
67379
- if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
67448
+ if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
67380
67449
 
67381
67450
  // start round2
67382
67451
  let ajaxArray = [];
@@ -67394,7 +67463,7 @@ class Dssp {
67394
67463
  //refpdbname = pdbid;
67395
67464
  refpdbname = chainid;
67396
67465
 
67397
- if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
67466
+ if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
67398
67467
  }
67399
67468
 
67400
67469
  if(!ic.refpdbHash[refpdbname]) {
@@ -67412,20 +67481,20 @@ class Dssp {
67412
67481
  //let allPromise2 = Promise.allSettled(pdbAjaxArray);
67413
67482
  //ic.pdbDataArray = await allPromise2;
67414
67483
 
67415
- ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
67484
+ let pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
67416
67485
 
67417
67486
  let pdb_target = ic.domainid2pdb[domainid];
67418
- for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
67487
+ for(let index = 0, indexl = pdbDataArray.length; index < indexl; ++index) {
67419
67488
  let struct2 = ic.defaultPdbId + index;
67420
- //let pdb_query = (me.bNode) ? ic.pdbDataArray[index] : ic.pdbDataArray[index].value; //[0];
67421
- let pdb_query = ic.pdbDataArray[index].value; //[0];
67489
+ //let pdb_query = (me.bNode) ? pdbDataArray[index] : pdbDataArray[index].value; //[0];
67490
+ let pdb_query = pdbDataArray[index].value; //[0];
67422
67491
  let header = 'HEADER ' + struct2 + '\n';
67423
67492
  pdb_query = header + pdb_query;
67424
67493
 
67425
67494
  let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbHash[refpdbname][index]};
67426
67495
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
67427
67496
  ajaxArray.push(alignAjax);
67428
-
67497
+
67429
67498
  //domainidpairArray3.push(domainid + "," + refpdbname);
67430
67499
  domainidpairArray3.push(domainid + "|" + ic.refpdbHash[refpdbname][index]);
67431
67500
  }
@@ -67438,12 +67507,14 @@ class Dssp {
67438
67507
  dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
67439
67508
 
67440
67509
  await this.parseAlignData(dataArray3, domainidpairArray3, false);
67441
-
67510
+
67442
67511
  // end of round 2
67443
- return;
67512
+ return bNoMoreIg;
67444
67513
  }
67445
67514
 
67446
67515
  await this.parseAlignData_part3(domainid2segs);
67516
+
67517
+ return bNoMoreIg;
67447
67518
  }
67448
67519
 
67449
67520
  async parseAlignData_part3(domainid2segs) { let ic = this.icn3d, me = ic.icn3dui;
@@ -67589,7 +67660,7 @@ class Dssp {
67589
67660
  for(let i = 0, il = segArray.length; i < il; ++i) {
67590
67661
  let seg = segArray[i];
67591
67662
  if(!seg) continue;
67592
-
67663
+
67593
67664
  let qStart = seg.q_start;
67594
67665
  parseInt(seg.q_start);
67595
67666
  if(isNaN(seg.q_start)) seg.q_start.substr(seg.q_start.length - 1, 1);
@@ -67630,9 +67701,10 @@ class Dssp {
67630
67701
  if(currStrand != currStrandFinal) {
67631
67702
  refnumLabel = this.getLabelFromRefnum(refnum, currStrandFinal);
67632
67703
  }
67633
-
67634
- ic.resid2refnum[resid] = refnumLabel;
67704
+
67705
+ ic.resid2refnum[resid] = refnumLabel;
67635
67706
  ic.resid2refnum_ori[resid] = refnumLabel;
67707
+ ic.resid2domainid[resid] = domainid;
67636
67708
 
67637
67709
  // final reference numbers will be assign in ic.annoIgCls.showRefNum()
67638
67710
 
@@ -67679,7 +67751,7 @@ class Dssp {
67679
67751
  else {
67680
67752
  await ic.showAnnoCls.showAnnotations();
67681
67753
  }
67682
-
67754
+
67683
67755
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
67684
67756
  }
67685
67757
  else if(!me.bNode) {
@@ -67720,13 +67792,13 @@ class Dssp {
67720
67792
  // loops may have numbers such as 1310, 1410
67721
67793
 
67722
67794
  let refnumLabel;
67723
-
67795
+
67724
67796
  if(refnum < 1000) refnumLabel = undefined;
67725
67797
  else if(refnum >= 1200 && refnum < 1290) refnumLabel = "A---" + oriRefnum;
67726
67798
  else if(refnum >= 1320 && refnum < 1390) refnumLabel = "A--" + oriRefnum;
67727
67799
  else if(refnum >= 1420 && refnum < 1490) refnumLabel = "A-" + oriRefnum;
67728
- else if(refnum >= 1520 && refnum < 1590) refnumLabel = "A" + oriRefnum;
67729
- else if(refnum >= 1620 && refnum < 1690) refnumLabel = "A+" + oriRefnum;
67800
+ else if(refnum >= 1520 && refnum < 1590) refnumLabel = "A" + oriRefnum;
67801
+ else if(refnum >= 1620 && refnum < 1690) refnumLabel = "A+" + oriRefnum;
67730
67802
  else if(refnum >= 1820 && refnum < 1890) refnumLabel = "A'" + oriRefnum;
67731
67803
  else if(refnum >= 2000 && refnum < 2900) refnumLabel = "B" + oriRefnum;
67732
67804
  else if(refnum >= 3300 && refnum < 3390) refnumLabel = "C--" + oriRefnum;
@@ -67735,8 +67807,8 @@ class Dssp {
67735
67807
  else if(refnum >= 4000 && refnum < 4900) refnumLabel = "C'" + oriRefnum;
67736
67808
  else if(refnum >= 5000 && refnum < 5900) refnumLabel = "C''" + oriRefnum;
67737
67809
  else if(refnum >= 6000 && refnum < 6900) refnumLabel = "D" + oriRefnum;
67738
- else if(refnum >= 7500 && refnum < 7590) refnumLabel = "E" + oriRefnum;
67739
- else if(refnum >= 7620 && refnum < 7900) refnumLabel = "E+" + oriRefnum;
67810
+ else if(refnum >= 7500 && refnum < 7590) refnumLabel = "E" + oriRefnum;
67811
+ else if(refnum >= 7620 && refnum < 7900) refnumLabel = "E+" + oriRefnum;
67740
67812
  else if(refnum >= 8000 && refnum < 8900) refnumLabel = "F" + oriRefnum;
67741
67813
  else if(refnum >= 9500 && refnum < 9590) refnumLabel = "G" + oriRefnum;
67742
67814
  else if(refnum >= 9620 && refnum < 9690) refnumLabel = "G+" + oriRefnum;
@@ -67836,22 +67908,22 @@ class Dssp {
67836
67908
  }
67837
67909
  }
67838
67910
  }
67839
-
67911
+
67840
67912
  let resid2refnum = {};
67841
67913
  for(let resid in ic.resid2refnum) {
67842
67914
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67843
67915
  if(!atom) continue;
67844
-
67916
+
67845
67917
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
67846
-
67918
+
67847
67919
  let domainid = ic.resid2domainid[resid];
67848
67920
  let refnumLabel = ic.resid2refnum[resid];
67849
-
67921
+
67850
67922
  if(refnumLabel) {
67851
67923
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
67852
67924
  (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
67853
67925
  }
67854
-
67926
+
67855
67927
  if(ic.resid2refnum[resid]) {
67856
67928
  if(ic.residIgLoop.hasOwnProperty(resid)) { // loop
67857
67929
  resid2refnum[resid + '_' + resn] = ic.resid2refnum[resid] + '_loop';
@@ -67889,21 +67961,22 @@ class Dssp {
67889
67961
  refData += '}\n';
67890
67962
  }
67891
67963
  */
67964
+
67892
67965
  if(bIgDomain) {
67893
67966
  refData += '"igs": [\n';
67894
-
67895
67967
  for(let chnid in ic.chains) {
67896
67968
  let igArray = ic.chain2igArray[chnid];
67897
67969
 
67898
- if(igArray.length > 0) {
67970
+ if(igArray && igArray.length > 0) {
67899
67971
  refData += '{"' + chnid + '": {\n';
67900
67972
 
67901
67973
  for(let i = 0, il = igArray.length; i < il; ++i) {
67902
67974
  let startPos = igArray[i].startPos;
67903
67975
  let endPos = igArray[i].endPos;
67904
67976
  let domainid = igArray[i].domainid;
67905
-
67906
67977
  let info = ic.domainid2info[domainid];
67978
+ if(!info) continue;
67979
+
67907
67980
  refData += '"' + domainid + '": {\n';
67908
67981
 
67909
67982
  refData += '"refpdbname":"' + info.refpdbname + '", "score":' + info.score + ', "seqid":' + info.seqid + ', "nresAlign":' + info.nresAlign + ', "data": [';
@@ -67931,18 +68004,18 @@ class Dssp {
67931
68004
  for(let resid in ic.resid2refnum) {
67932
68005
  let domainid = ic.resid2domainid[resid];
67933
68006
  let refnumStr, refnumLabel = ic.resid2refnum[resid];
67934
-
68007
+
67935
68008
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67936
68009
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
67937
-
68010
+
67938
68011
  if(refnumLabel) {
67939
68012
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
67940
68013
  refnumStr = (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
67941
68014
  }
67942
-
68015
+
67943
68016
  resid2kabat[resid + '_' + resn] = refnumStr;
67944
68017
  }
67945
-
68018
+
67946
68019
  refData += JSON.stringify(resid2kabat);
67947
68020
  }
67948
68021
  // 3. show IMGT ref numbers
@@ -67951,25 +68024,25 @@ class Dssp {
67951
68024
  for(let resid in ic.resid2refnum) {
67952
68025
  let domainid = ic.resid2domainid[resid];
67953
68026
  let refnumStr, refnumLabel = ic.resid2refnum[resid];
67954
-
68027
+
67955
68028
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67956
68029
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
67957
-
68030
+
67958
68031
  if(refnumLabel) {
67959
68032
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
67960
68033
  refnumStr = (ic.domainid2ig2imgt[domainid]) ? ic.domainid2ig2imgt[domainid][refnumStr_ori] : undefined;
67961
68034
  }
67962
-
68035
+
67963
68036
  resid2imgt[resid + '_' + resn] = refnumStr;
67964
68037
  }
67965
-
68038
+
67966
68039
  refData += JSON.stringify(resid2imgt);
67967
68040
  }
67968
68041
 
67969
68042
 
67970
68043
  if(!me.bNode) {
67971
68044
  let file_pref = Object.keys(me.utilsCls.getHlStructures()).join(',');
67972
-
68045
+
67973
68046
  ic.saveFileCls.saveFile(file_pref + '_refnum_' + type + '.txt', 'text', [refData]);
67974
68047
  }
67975
68048
  else {
@@ -67987,7 +68060,7 @@ class Dssp {
67987
68060
 
67988
68061
  for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
67989
68062
  let currAjaxArray = [];
67990
- if(i == il - 1) { // last one
68063
+ if(i == il - 1) { // last one
67991
68064
  currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
67992
68065
  }
67993
68066
  else {