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.js CHANGED
@@ -7378,6 +7378,8 @@ class ClickMenu {
7378
7378
  thisClass.setLogCmd('ig refnum on', true);
7379
7379
  // await ic.refnumCls.showIgRefNum();
7380
7380
  // thisClass.setLogCmd('set annotation ig', true);
7381
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
7382
+
7381
7383
  let bSelection = true;
7382
7384
  await ic.annotationCls.setAnnoTabIg(bSelection);
7383
7385
 
@@ -7402,6 +7404,7 @@ class ClickMenu {
7402
7404
  thisClass.setLogCmd('ig template ' + template, true);
7403
7405
  let bSelection = true;
7404
7406
  // await ic.refnumCls.showIgRefNum(template);
7407
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
7405
7408
  await ic.annotationCls.setAnnoTabIg(bSelection, template);
7406
7409
  });
7407
7410
 
@@ -9527,8 +9530,8 @@ class SetMenu {
9527
9530
  //}
9528
9531
 
9529
9532
  //!!!
9530
- //html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
9531
- //html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
9533
+ // html += this.getRadio('mn4_clr', 'mn4_clrIgstrand', 'Ig Strand', undefined, undefined, 2);
9534
+ // html += this.getRadio('mn4_clr', 'mn4_clrIgproto', 'Ig Protodomain', undefined, undefined, 2);
9532
9535
  }
9533
9536
  else {
9534
9537
  //if(!me.cfg.hidelicense) html += this.getRadio('mn4_clr', 'mn1_delphi2', 'DelPhi<br><span style="padding-left:1.5em;">Potential ' + me.htmlCls.licenseStr + '</span>');
@@ -9659,7 +9662,7 @@ class SetMenu {
9659
9662
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResidues', 'per Residue', undefined, 1, 2);
9660
9663
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelResnum', 'per Residue & Number', undefined, 1, 2);
9661
9664
  //!!!
9662
- //html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
9665
+ // html += this.getRadio('mn6_addlabel', 'mn6_addlabelRefnum', 'per Reference Number', undefined, 1, 2);
9663
9666
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelChains', 'per Chain', undefined, undefined, 2);
9664
9667
  html += this.getRadio('mn6_addlabel', 'mn6_addlabelTermini', 'N- & C-Termini', undefined, 1, 2);
9665
9668
  }
@@ -9757,8 +9760,9 @@ class SetMenu {
9757
9760
  html += this.getLink('mn6_igrefYes', 'Show Ig for Selection', undefined, 2);
9758
9761
  html += this.getLink('mn6_igrefTpl', 'Ig w/ Specified Template', undefined, 2);
9759
9762
  html += this.getLink('mn6_igrefNo', 'Reset Ig Ref. Number', undefined, 2);
9760
- */
9763
+
9761
9764
  html += this.getMenuSep();
9765
+ */
9762
9766
 
9763
9767
  html += this.getLink('mn6_customref', 'Custom Ref. Number', undefined, 2);
9764
9768
  html += "</ul>";
@@ -14694,6 +14698,14 @@ class Events {
14694
14698
  thisClass.setLogCmd('define igloop sets | chain ' + chainid, true);
14695
14699
  });
14696
14700
 
14701
+ $(document).on("click", ".icn3d-igdomainsets", function(e) { let ic = me.icn3d;
14702
+ e.stopImmediatePropagation();
14703
+ //e.preventDefault();
14704
+ let chainid = $(this).attr('chainid');
14705
+ ic.addTrackCls.defineIgstrand(chainid, 'igdomain');
14706
+ thisClass.setLogCmd('define igdomain sets | chain ' + chainid, true);
14707
+ });
14708
+
14697
14709
  me.myEventCls.onIds("#" + me.pre + "deletesets", "click", function(e) { let ic = me.icn3d;
14698
14710
  ic.definedSetsCls.deleteSelectedSets();
14699
14711
  thisClass.setLogCmd("delete selected sets", true);
@@ -32473,7 +32485,7 @@ class Instancing {
32473
32485
  }
32474
32486
 
32475
32487
  if(ic.mdlImpostor !== undefined) {
32476
- // after three.js version 128, the cylinder impostor seemed to have a problem in cloning!!!
32488
+ // after three.js version 128, the cylinder impostor seemed to have a problem in cloning
32477
32489
  symmetryMate = ic.mdlImpostor.clone();
32478
32490
  //symmetryMate.applyMatrix(mat);
32479
32491
  this.applyMat(symmetryMate, mat);
@@ -36832,7 +36844,13 @@ class AnnoCddSite {
36832
36844
 
36833
36845
  if(me.cfg.blast_rep_id != chnid) { // regular
36834
36846
  for(let i = 0, il = fromArray.length; i < il; ++i) {
36835
- 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);
36847
+ let emptyWidth;
36848
+ if(titleArray) {
36849
+ emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) : Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
36850
+ }
36851
+ else {
36852
+ 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);
36853
+ }
36836
36854
 
36837
36855
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
36838
36856
  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>';
@@ -38086,7 +38104,7 @@ class AnnoIg {
38086
38104
  refnumLabel = ic.resid2refnum[residueid];
38087
38105
  let bHidelabel = false;
38088
38106
 
38089
- if(refnumLabel) {
38107
+ if(refnumLabel) {
38090
38108
  refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
38091
38109
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
38092
38110
  currStrand_ori = currStrand;
@@ -38118,8 +38136,9 @@ class AnnoIg {
38118
38136
 
38119
38137
  igElem = {};
38120
38138
  igElem.startPos = i;
38121
- igElem.domainid = domainid;
38122
38139
  }
38140
+
38141
+ if(domainid) igElem.domainid = domainid;
38123
38142
 
38124
38143
  if(bCustom) {
38125
38144
  if(!refnumStr) {
@@ -38177,6 +38196,8 @@ class AnnoIg {
38177
38196
 
38178
38197
  igElem.endPos = prevPos;
38179
38198
  ic.chain2igArray[chnid].push(igElem);
38199
+
38200
+ if(me.bNode) return {html: '', html2: '', html3: ''};
38180
38201
  let titleSpace = 120;
38181
38202
 
38182
38203
  let linkStr = 'icn3d-link icn3d-blue';
@@ -38232,11 +38253,14 @@ class AnnoIg {
38232
38253
  html += '</div>';
38233
38254
  html += '</div>';
38234
38255
 
38235
- let igArray = ic.chain2igArray[chnid];
38256
+ let igArray = ic.chain2igArray[chnid];
38257
+ if(igArray.length == 0) return {html: '', html2: '', html3: ''};
38236
38258
  let rangeArray = [], titleArray = [], fullTitleArray = [], domainArray = [];
38237
38259
  for(let i = 0, il = igArray.length; i < il; ++i) {
38238
38260
  let domainid = igArray[i].domainid;
38239
38261
  let info = ic.domainid2info[domainid];
38262
+ if(!info) continue;
38263
+
38240
38264
  let tmscore = info.score;
38241
38265
  let igType = ic.ref2igtype[info.refpdbname];
38242
38266
  titleArray.push(igType + ' (TM:' + parseFloat(tmscore).toFixed(2) + ')');
@@ -38247,6 +38271,7 @@ class AnnoIg {
38247
38271
  range.locs = [{"from":igArray[i].startPos, "to":igArray[i].endPos}];
38248
38272
  rangeArray.push(range);
38249
38273
  }
38274
+ if(titleArray.length == 0) return {html: '', html2: '', html3: ''};
38250
38275
 
38251
38276
  // add tracks for the summary view
38252
38277
  for(let i = 0, il = fromArray.length; i < il; ++i) {
@@ -38256,10 +38281,10 @@ class AnnoIg {
38256
38281
  let colorStr =(atom.color === undefined || atom.color.getHexString() === 'FFFFFF') ? 'DDDDDD' : atom.color.getHexString();
38257
38282
  let color =(atom.color !== undefined) ? colorStr : "CCCCCC";
38258
38283
 
38259
- let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i] - ic.baseResi[chnid] - 1) / ic.maxAnnoLength) :
38284
+ let emptyWidth =(i == 0) ? Math.round(ic.seqAnnWidth *(fromArray[i]) / ic.maxAnnoLength) :
38260
38285
  Math.round(ic.seqAnnWidth *(fromArray[i] - toArray[i-1] - 1) / ic.maxAnnoLength);
38261
38286
  html2 += '<div style="display:inline-block; width:' + emptyWidth + 'px;">&nbsp;</div>';
38262
- 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>';
38287
+ 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>';
38263
38288
  }
38264
38289
 
38265
38290
  html2 += htmlCnt;
@@ -41583,91 +41608,115 @@ class AddTrack {
41583
41608
  let selectedResidues = {};
41584
41609
  let bUnion = false, bUpdateHighlight = true;
41585
41610
 
41586
- let strandCnt = 0, loopCnt = 0;
41587
- let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
41588
-
41589
41611
  // clear selection
41590
41612
  ic.hAtoms = {};
41591
41613
 
41592
- let bStart = false;
41593
-
41594
- for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
41595
- let currResi = ic.chainsSeq[chainid][i].resi;
41596
- let resid = chainid + '_' + currResi;
41614
+ if(type == 'igdomain') {
41615
+ let igArray = ic.chain2igArray[chainid];
41597
41616
 
41598
- if(!ic.residues.hasOwnProperty(resid) ) continue;
41599
-
41600
- let refnumLabel, refnumStr, refnum;
41601
- refnumLabel = ic.resid2refnum[resid];
41602
- if(!refnumLabel) continue;
41617
+ if(igArray && igArray.length > 0) {
41618
+
41619
+ for(let i = 0, il = igArray.length; i < il; ++i) {
41620
+ let startPos = igArray[i].startPos;
41621
+ let endPos = igArray[i].endPos;
41622
+ let domainid = igArray[i].domainid;
41603
41623
 
41604
- refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
41605
- currStrand = refnumLabel.replace(refnumStr, '');
41606
- refnum = parseInt(refnumStr);
41624
+ selectedResidues = {};
41625
+ for(let j = parseInt(startPos); j <= parseInt(endPos); ++j) {
41626
+ let currResi = ic.chainsSeq[chainid][j].resi;
41627
+ let resid = chainid + '_' + currResi;
41628
+ selectedResidues[resid] = 1;
41629
+ }
41607
41630
 
41608
- if(type == 'iganchor') {
41609
- if(refnum > 1000 && refnumStr.substr(refnumStr.length - 2, 2) == '50') {
41610
- selectedResidues[resid] = 1;
41611
- }
41612
- }
41613
- else {
41614
- if(ic.residIgLoop.hasOwnProperty(resid)) {
41615
- currType = 'igloop';
41631
+ let setName = domainid;
41632
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41616
41633
  }
41634
+ }
41635
+ }
41636
+ else {
41637
+ let strandCnt = 0, loopCnt = 0;
41638
+ let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
41639
+
41640
+ let bStart = false;
41641
+
41642
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
41643
+ let currResi = ic.chainsSeq[chainid][i].resi;
41644
+ let resid = chainid + '_' + currResi;
41645
+
41646
+ if(!ic.residues.hasOwnProperty(resid) ) continue;
41647
+
41648
+ let refnumLabel, refnumStr, refnum;
41649
+ refnumLabel = ic.resid2refnum[resid];
41650
+ if(!refnumLabel) continue;
41651
+
41652
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
41653
+ currStrand = refnumLabel.replace(refnumStr, '');
41654
+ refnum = parseInt(refnumStr);
41655
+
41656
+ if(type == 'iganchor') {
41657
+ if(refnum > 1000 && refnumStr.substr(refnumStr.length - 2, 2) == '50') {
41658
+ selectedResidues[resid] = 1;
41659
+ }
41660
+ }
41617
41661
  else {
41618
- currType = 'igstrand';
41619
- }
41662
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
41663
+ currType = 'igloop';
41664
+ }
41665
+ else {
41666
+ currType = 'igstrand';
41667
+ }
41620
41668
 
41621
- if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
41622
- if(prevType == 'igstrand') {
41623
- ++strandCnt;
41624
- setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
41625
- setName = setName.replace(/'/g, '`');
41626
- if(type == 'igstrand') {
41627
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41628
- if(!bUnion) bUnion = true;
41669
+ if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
41670
+ if(prevType == 'igstrand') {
41671
+ ++strandCnt;
41672
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
41673
+ setName = setName.replace(/'/g, '`');
41674
+ if(type == 'igstrand') {
41675
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41676
+ if(!bUnion) bUnion = true;
41677
+ }
41678
+ prevStrandReal = prevStrand;
41629
41679
  }
41630
- prevStrandReal = prevStrand;
41631
- }
41632
- else if(prevType == 'igloop') {
41633
- ++loopCnt;
41634
- setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
41635
- setName = setName.replace(/'/g, '`');
41636
- if(type == 'igloop') {
41637
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41638
- if(!bUnion) bUnion = true;
41680
+ else if(prevType == 'igloop') {
41681
+ ++loopCnt;
41682
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
41683
+ setName = setName.replace(/'/g, '`');
41684
+ if(type == 'igloop') {
41685
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41686
+ if(!bUnion) bUnion = true;
41687
+ }
41639
41688
  }
41640
- }
41641
41689
 
41642
- selectedResidues = {};
41643
- }
41690
+ selectedResidues = {};
41691
+ }
41644
41692
 
41645
- selectedResidues[resid] = 1;
41693
+ selectedResidues[resid] = 1;
41646
41694
 
41647
- prevStrand = currStrand;
41648
- prevType = currType;
41695
+ prevStrand = currStrand;
41696
+ prevType = currType;
41649
41697
 
41650
- bStart = true;
41651
- }
41652
- } // for loop
41698
+ bStart = true;
41699
+ }
41700
+ } // for loop
41653
41701
 
41654
- if(type == 'iganchor') {
41655
- setName = 'Anchor-' + chainid;
41656
- ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41657
- }
41658
- else {
41659
- if(prevType == 'igstrand') {
41660
- ++strandCnt;
41661
- setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
41662
- setName = setName.replace(/'/g, '`');
41663
- if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41702
+ if(type == 'iganchor') {
41703
+ setName = 'Anchor-' + chainid;
41704
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41664
41705
  }
41665
- else if(prevType == 'igloop') {
41666
- ++loopCnt;
41667
- currStrand = 'CT';
41668
- setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
41669
- setName = setName.replace(/'/g, '`');
41670
- if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41706
+ else {
41707
+ if(prevType == 'igstrand') {
41708
+ ++strandCnt;
41709
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
41710
+ setName = setName.replace(/'/g, '`');
41711
+ if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41712
+ }
41713
+ else if(prevType == 'igloop') {
41714
+ ++loopCnt;
41715
+ currStrand = 'CT';
41716
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
41717
+ setName = setName.replace(/'/g, '`');
41718
+ if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
41719
+ }
41671
41720
  }
41672
41721
  }
41673
41722
  }
@@ -43526,10 +43575,12 @@ class ShowAnno {
43526
43575
  + 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;"
43527
43576
  + 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);
43528
43577
 
43529
- if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
43530
- 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;"
43531
- + 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);
43532
- }
43578
+ // if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid) && ic.chainid2refpdbname[chnid].length > 0) {
43579
+ 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;"
43580
+ + 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;"
43581
+ + 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;"
43582
+ + 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);
43583
+ // }
43533
43584
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
43534
43585
  //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
43535
43586
  let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction', 'ig'];
@@ -60172,6 +60223,7 @@ class ApplyCommand {
60172
60223
  await ic.annotationCls.setAnnoTabIg();
60173
60224
  }
60174
60225
  else if(command == 'ig refnum on') {
60226
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
60175
60227
  await ic.annotationCls.setAnnoTabIg(true);
60176
60228
  }
60177
60229
  else if(command == 'highlight level up') {
@@ -62661,6 +62713,7 @@ class LoadScript {
62661
62713
  else if(command.indexOf('ig template') == 0 ) {
62662
62714
  let template = command.substr(command.lastIndexOf(' ') + 1);
62663
62715
  // await ic.refnumCls.showIgRefNum(template);
62716
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
62664
62717
  await ic.annotationCls.setAnnoTabIg(true, template);
62665
62718
  }
62666
62719
  else if(command.indexOf('set annotation 3ddomain') == 0) { // the command may have "|||{"factor"...
@@ -62864,6 +62917,7 @@ class LoadScript {
62864
62917
  }
62865
62918
  else if(lastCommand.indexOf('ig refnum on') == 0) {
62866
62919
  // await ic.refnumCls.showIgRefNum();
62920
+ if(!ic.bAnnoShown) await ic.showAnnoCls.showAnnotations();
62867
62921
  await ic.annotationCls.setAnnoTabIg(true);
62868
62922
  }
62869
62923
  else if(lastCommand.indexOf('set annotation 3ddomain') == 0) {
@@ -62990,7 +63044,7 @@ class LoadScript {
62990
63044
  let idNew = '';
62991
63045
  for(let i = 0, il = idArray.length; i < il; ++i) {
62992
63046
  if(!(ic.structures && ic.structures.hasOwnProperty(idArray[i]))) {
62993
- if(!idNew) idNew += ',';
63047
+ if(idNew) idNew += ',';
62994
63048
  idNew += idArray[i];
62995
63049
  }
62996
63050
  }
@@ -65911,7 +65965,9 @@ class Dssp {
65911
65965
  ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'CD3d_6jxrd_human_Iset'];
65912
65966
  ic.refpdbHash['1CD3g_6jxrg_human_Iset'] = ['CD3g_6jxrg_human_Iset', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria'];
65913
65967
  ic.refpdbHash['1CD28_1yjdC_human_V'] = ['CD28_1yjdC_human_V', 'MPT63_1lmiA_bacteria', 'CD3e_6jxrf_human_Iset'];
65914
- ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
65968
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
65969
+
65970
+ 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'];
65915
65971
 
65916
65972
  // use known ref structure
65917
65973
  ic.refpdbHash['5ESV_C'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2'];
@@ -65968,9 +66024,9 @@ class Dssp {
65968
66024
 
65969
66025
  ic.ref2igtype['ASF1A_2iijA_human'] = 'IgE';
65970
66026
  ic.ref2igtype['B2Microglobulin_7phrL_human_C1'] = 'IgC1';
65971
- ic.ref2igtype['BArrestin1_4jqiA_rat_n1'] = 'IgFn3-like';
66027
+ ic.ref2igtype['BArrestin1_4jqiA_rat_n1'] = 'IgFN3-like';
65972
66028
  ic.ref2igtype['BTLA_2aw2A_human_Iset'] = 'IgI';
65973
- ic.ref2igtype['C3_2qkiD_human_n1'] = 'IgFn3-like';
66029
+ ic.ref2igtype['C3_2qkiD_human_n1'] = 'IgFN3-like';
65974
66030
  ic.ref2igtype['CD19_6al5A_human_C2orV-n1'] = 'other Ig'; //'CD19';
65975
66031
  ic.ref2igtype['CD28_1yjdC_human_V'] = 'IgV';
65976
66032
  ic.ref2igtype['CD2_1hnfA_human_C2-n2'] = 'IgC2';
@@ -65980,7 +66036,7 @@ class Dssp {
65980
66036
  ic.ref2igtype['CD3g_6jxrg_human_Iset'] = 'IgI';
65981
66037
  ic.ref2igtype['CD8a_1cd8A_human_V'] = 'IgV';
65982
66038
  ic.ref2igtype['CoAtomerGamma1_1r4xA_human'] = 'IgE';
65983
- ic.ref2igtype['Contactin1_2ee2A_human_FN3-n9'] = 'IgFn3';
66039
+ ic.ref2igtype['Contactin1_2ee2A_human_FN3-n9'] = 'IgFN3';
65984
66040
  ic.ref2igtype['Contactin1_3s97C_human_C2-n2'] = 'IgC2';
65985
66041
  ic.ref2igtype['CuZnSuperoxideDismutase_1hl5C_human'] = 'other Ig'; //'SOD';
65986
66042
  ic.ref2igtype['ECadherin_4zt1A_human_n2'] = 'other Ig'; //'Cadherin';
@@ -65989,12 +66045,12 @@ class Dssp {
65989
66045
  ic.ref2igtype['FAB-HEAVY_5esv_V-n1'] = 'IgV';
65990
66046
  ic.ref2igtype['FAB-LIGHT_5esv_C1-n2'] = 'IgC1';
65991
66047
  ic.ref2igtype['FAB-LIGHT_5esv_V-n1'] = 'IgV';
65992
- ic.ref2igtype['GHR_1axiB_human_FN3-n1'] = 'IgFn3';
66048
+ ic.ref2igtype['GHR_1axiB_human_FN3-n1'] = 'IgFN3';
65993
66049
  ic.ref2igtype['ICOS_6x4gA_human_V'] = 'IgV';
65994
- ic.ref2igtype['IL6Rb_1bquB_human_FN3-n2'] = 'IgFn3';
65995
- ic.ref2igtype['IL6Rb_1bquB_human_FN3-n3'] = 'IgFn3';
65996
- ic.ref2igtype['InsulinR_8guyE_human_FN3-n1'] = 'IgFn3';
65997
- ic.ref2igtype['InsulinR_8guyE_human_FN3-n2'] = 'IgFn3';
66050
+ ic.ref2igtype['IL6Rb_1bquB_human_FN3-n2'] = 'IgFN3';
66051
+ ic.ref2igtype['IL6Rb_1bquB_human_FN3-n3'] = 'IgFN3';
66052
+ ic.ref2igtype['InsulinR_8guyE_human_FN3-n1'] = 'IgFN3';
66053
+ ic.ref2igtype['InsulinR_8guyE_human_FN3-n2'] = 'IgFN3';
65998
66054
  ic.ref2igtype['IsdA_2iteA_bacteria'] = 'IgE';
65999
66055
  ic.ref2igtype['JAM1_1nbqA_human_VorIset-n2'] = 'IgI';
66000
66056
  ic.ref2igtype['LAG3_7tzgD_human_C2-n2'] = 'IgC2';
@@ -66008,9 +66064,9 @@ class Dssp {
66008
66064
  ic.ref2igtype['PD1_4zqkB_human_V'] = 'IgV';
66009
66065
  ic.ref2igtype['PDL1_4z18B_human_V-n1'] = 'IgV';
66010
66066
  ic.ref2igtype['Palladin_2dm3A_human_Iset-n1'] = 'IgI';
66011
- ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFn3-like';
66012
- ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFn3-like';
66013
- ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFn3';
66067
+ ic.ref2igtype['RBPJ_6py8C_human_Unk-n1'] = 'IgFN3-like';
66068
+ ic.ref2igtype['RBPJ_6py8C_human_Unk-n2'] = 'IgFN3-like';
66069
+ ic.ref2igtype['Sidekick2_1wf5A_human_FN3-n7'] = 'IgFN3';
66014
66070
  ic.ref2igtype['Siglec3_5j0bB_human_C2-n2'] = 'IgC2';
66015
66071
  ic.ref2igtype['TCRa_6jxrm_human_C1-n2'] = 'IgC1';
66016
66072
  ic.ref2igtype['TCRa_6jxrm_human_V-n1'] = 'IgV';
@@ -66075,7 +66131,7 @@ class Dssp {
66075
66131
  let thisClass = this;
66076
66132
 
66077
66133
  let struArray = Object.keys(ic.structures);
66078
-
66134
+
66079
66135
  let ajaxArray = [];
66080
66136
  let domainidpairArray = [];
66081
66137
 
@@ -66094,7 +66150,7 @@ class Dssp {
66094
66150
  for(let j = 0, jl = chainidArray.length; j < jl; ++j) {
66095
66151
  let chainid = chainidArray[j];
66096
66152
 
66097
- // for selected atoms only
66153
+ // for selected atoms only, assign ic.resid2domainid[resid]
66098
66154
  let domainAtomsArray = this.getDomainAtomsArray(chainid, bRerun);
66099
66155
 
66100
66156
  if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
@@ -66111,8 +66167,8 @@ class Dssp {
66111
66167
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtomsArray[k]);
66112
66168
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtomsArray[k]);
66113
66169
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtomsArray[k]).length;
66114
- //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
66115
- let domainid = chainid + ',' + k + '_' + resiSum;
66170
+ //let domainid = chainid + '-' + k + '_' + Object.keys(domainAtomsArray[k]).length;
66171
+ let domainid = chainid + ',' + k + '_' + resiSum;
66116
66172
  ic.domainid2pdb[domainid] = pdb_target;
66117
66173
 
66118
66174
  if(!template) {
@@ -66130,7 +66186,7 @@ class Dssp {
66130
66186
  // let alignAjax = me.getAjaxPostPromise(urlalign, dataObj);
66131
66187
 
66132
66188
  ajaxArray.push(alignAjax);
66133
-
66189
+
66134
66190
  domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
66135
66191
  }
66136
66192
  }
@@ -66150,14 +66206,14 @@ class Dssp {
66150
66206
  // dataArray2 = await allPromise;
66151
66207
 
66152
66208
  dataArray2 = await this.promiseWithFixedJobs(ajaxArray);
66153
-
66209
+
66154
66210
  let bRound1 = true;
66155
- await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
66211
+ bNoMoreIg = await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
66156
66212
 
66157
66213
  /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
66158
66214
  }
66159
66215
  else {
66160
- if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
66216
+ if(!me.bNode) console.log("Start alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
66161
66217
 
66162
66218
  // start round2
66163
66219
  let ajaxArray = [];
@@ -66172,36 +66228,36 @@ class Dssp {
66172
66228
  //let allPromise2 = Promise.allSettled(pdbAjaxArray);
66173
66229
  //ic.pdbDataArray = await allPromise2;
66174
66230
 
66175
- ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
66231
+ let pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
66176
66232
 
66177
66233
  for(let domainid in ic.domainid2refpdbname) {
66178
66234
  ic.domainid2refpdbname[domainid];
66179
66235
  domainid.substr(0, domainid.indexOf(','));
66180
66236
 
66181
66237
  let pdb_target = ic.domainid2pdb[domainid];
66182
- for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
66238
+ for(let index = 0, indexl = pdbDataArray.length; index < indexl; ++index) {
66183
66239
  let struct2 = ic.defaultPdbId + index;
66184
- let pdb_query = ic.pdbDataArray[index].value; //[0];
66240
+ let pdb_query = pdbDataArray[index].value; //[0];
66185
66241
 
66186
66242
  let header = 'HEADER ' + struct2 + '\n';
66187
66243
  pdb_query = header + pdb_query;
66188
-
66244
+
66189
66245
  let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": template};
66190
66246
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
66191
66247
  ajaxArray.push(alignAjax);
66192
-
66248
+
66193
66249
  //domainidpairArray3.push(domainid + "," + refpdbname);
66194
66250
  domainidpairArray3.push(domainid + "|" + template);
66195
66251
  }
66196
66252
  }
66197
-
66253
+
66198
66254
  let dataArray3 = [];
66199
66255
  //let allPromise = Promise.allSettled(ajaxArray);
66200
66256
  //dataArray3 = await allPromise;
66201
66257
 
66202
66258
  dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
66203
-
66204
- await thisClass.parseAlignData(dataArray3, domainidpairArray3);
66259
+
66260
+ bNoMoreIg = await thisClass.parseAlignData(dataArray3, domainidpairArray3);
66205
66261
  }
66206
66262
 
66207
66263
  return bNoMoreIg;
@@ -66217,8 +66273,8 @@ class Dssp {
66217
66273
  }
66218
66274
  //console.log("Error in aligning with TM-align...");
66219
66275
  return;
66220
- }
66221
- */
66276
+ }
66277
+ */
66222
66278
  }
66223
66279
 
66224
66280
  getDomainAtomsArray(chainid, bRerunDomain) { let ic = this.icn3d, me = ic.icn3dui;
@@ -66261,21 +66317,22 @@ class Dssp {
66261
66317
  //let result = ic.domain3dCls.c2b_NewSplitChain(ic.chains[chainid]);
66262
66318
  // assign ref numbers to selected residues
66263
66319
  let result = ic.domain3dCls.c2b_NewSplitChain(currAtoms, undefined);
66264
- let subdomains = result.subdomains;
66320
+ let subdomains = result.subdomains;
66265
66321
  let pos2resi = result.pos2resi;
66266
66322
 
66267
66323
  if(subdomains.length <= 1) {
66268
66324
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
66269
66325
  if(residueArray.length < minResidues) return domainAtomsArray;
66270
-
66326
+ /*
66271
66327
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(currAtoms);
66272
66328
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(currAtoms);
66273
66329
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(currAtoms).length;
66274
-
66330
+ */
66275
66331
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
66276
66332
  let resid = residueArray[n];
66277
- ic.resid2domainid[resid] = chainid + ',0' + '_' + resiSum;
66278
-
66333
+ /*
66334
+ ic.resid2domainid[resid] = chainid + ',0' + '_' + resiSum;
66335
+ */
66279
66336
  // clear previous refnum assignment if any
66280
66337
  // if(!bRerunDomain && ic.resid2refnum && ic.resid2refnum[resid]) {
66281
66338
  // if(ic.resid2refnum && ic.resid2refnum[resid]) {
@@ -66286,7 +66343,7 @@ class Dssp {
66286
66343
 
66287
66344
  domainAtomsArray.push(currAtoms);
66288
66345
  }
66289
- else {
66346
+ else {
66290
66347
  for(let k = 0, kl = subdomains.length; k < kl; ++k) {
66291
66348
  let domainAtoms = {};
66292
66349
  let segArray = subdomains[k];
@@ -66313,7 +66370,7 @@ class Dssp {
66313
66370
  if(resCnt < minResidues) continue;
66314
66371
 
66315
66372
  domainAtomsArray.push(domainAtoms);
66316
-
66373
+ /*
66317
66374
  let atomFirst = ic.firstAtomObjCls.getFirstAtomObj(domainAtoms);
66318
66375
  let atomLast = ic.firstAtomObjCls.getLastAtomObj(domainAtoms);
66319
66376
  let resiSum = atomFirst.resi + ':' + atomLast.resi + ':' + Object.keys(domainAtoms).length;
@@ -66324,15 +66381,16 @@ class Dssp {
66324
66381
  for(let n = parseInt(startResi); n <= parseInt(endResi); ++n) {
66325
66382
  let resid = chainid + '_' + pos2resi[n];
66326
66383
  //domainAtoms = me.hashUtilsCls.unionHash(domainAtoms, ic.residues[resid]);
66327
- ic.resid2domainid[resid] = chainid + ',' + k + '_' + resiSum;
66384
+ ic.resid2domainid[resid] = chainid + ',' + k + '_' + resiSum;
66328
66385
  }
66329
66386
  }
66387
+ */
66330
66388
  }
66331
66389
  }
66332
66390
 
66333
66391
  return domainAtomsArray;
66334
66392
  }
66335
-
66393
+
66336
66394
  getTemplateList(domainid) { let ic = this.icn3d; ic.icn3dui;
66337
66395
  let refpdbname = '', score = '', seqid = '', nresAlign = '';
66338
66396
 
@@ -66365,7 +66423,6 @@ class Dssp {
66365
66423
  if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
66366
66424
 
66367
66425
  let minResidues = 20;
66368
-
66369
66426
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
66370
66427
  //let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
66371
66428
  let queryData = (dataArray[i]) ? dataArray[i].value : undefined; //[0];
@@ -66376,7 +66433,7 @@ class Dssp {
66376
66433
  }
66377
66434
 
66378
66435
  if(queryData[0].score === undefined) continue;
66379
-
66436
+
66380
66437
  //let domainid_index = domainidpairArray[i].split(',');
66381
66438
  //let domainid = domainid_index[0];
66382
66439
  let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
@@ -66397,7 +66454,7 @@ class Dssp {
66397
66454
  continue;
66398
66455
  }
66399
66456
  }
66400
-
66457
+
66401
66458
  if(!bRound1) {
66402
66459
  if(!me.bNode) console.log("refpdbname " + refpdbname + " TM-score: " + queryData[0].score);
66403
66460
  }
@@ -66460,8 +66517,13 @@ class Dssp {
66460
66517
  }
66461
66518
 
66462
66519
  if(!domainid2segs.hasOwnProperty(domainid) || queryData[0].score >= ic.domainid2score[domainid].split('_')[0]) {
66463
- ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
66464
- ic.domainid2refpdbname[domainid] = refpdbname;
66520
+ ic.domainid2score[domainid] = queryData[0].score + '_' + queryData[0].frac_identical + '_' + queryData[0].num_res ;
66521
+ if(bRound1) {
66522
+ ic.domainid2refpdbname[domainid] = parseFloat(queryData[0].score) > 0.75 ? refpdbname : 'all_templates';
66523
+ }
66524
+ else {
66525
+ ic.domainid2refpdbname[domainid] = refpdbname;
66526
+ }
66465
66527
  domainid2segs[domainid] = queryData[0].segs;
66466
66528
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
66467
66529
  ic.domainid2ig2imgt[domainid] = queryData[0].ig2imgt;
@@ -66472,10 +66534,17 @@ class Dssp {
66472
66534
  }
66473
66535
 
66474
66536
  async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
66537
+ let bNoMoreIg = false;
66538
+
66475
66539
  let domainid2segs = this.parseAlignData_part1(dataArray, domainidpairArray, bRound1);
66476
66540
 
66541
+ if(Object.keys(domainid2segs).length == 0) {
66542
+ bNoMoreIg = true;
66543
+ return bNoMoreIg;
66544
+ }
66545
+
66477
66546
  if(bRound1) {
66478
- if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
66547
+ if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
66479
66548
 
66480
66549
  // start round2
66481
66550
  let ajaxArray = [];
@@ -66493,7 +66562,7 @@ class Dssp {
66493
66562
  //refpdbname = pdbid;
66494
66563
  refpdbname = chainid;
66495
66564
 
66496
- if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
66565
+ if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
66497
66566
  }
66498
66567
 
66499
66568
  if(!ic.refpdbHash[refpdbname]) {
@@ -66511,20 +66580,20 @@ class Dssp {
66511
66580
  //let allPromise2 = Promise.allSettled(pdbAjaxArray);
66512
66581
  //ic.pdbDataArray = await allPromise2;
66513
66582
 
66514
- ic.pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
66583
+ let pdbDataArray = await this.promiseWithFixedJobs(pdbAjaxArray);
66515
66584
 
66516
66585
  let pdb_target = ic.domainid2pdb[domainid];
66517
- for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
66586
+ for(let index = 0, indexl = pdbDataArray.length; index < indexl; ++index) {
66518
66587
  let struct2 = ic.defaultPdbId + index;
66519
- //let pdb_query = (me.bNode) ? ic.pdbDataArray[index] : ic.pdbDataArray[index].value; //[0];
66520
- let pdb_query = ic.pdbDataArray[index].value; //[0];
66588
+ //let pdb_query = (me.bNode) ? pdbDataArray[index] : pdbDataArray[index].value; //[0];
66589
+ let pdb_query = pdbDataArray[index].value; //[0];
66521
66590
  let header = 'HEADER ' + struct2 + '\n';
66522
66591
  pdb_query = header + pdb_query;
66523
66592
 
66524
66593
  let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbHash[refpdbname][index]};
66525
66594
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
66526
66595
  ajaxArray.push(alignAjax);
66527
-
66596
+
66528
66597
  //domainidpairArray3.push(domainid + "," + refpdbname);
66529
66598
  domainidpairArray3.push(domainid + "|" + ic.refpdbHash[refpdbname][index]);
66530
66599
  }
@@ -66537,12 +66606,14 @@ class Dssp {
66537
66606
  dataArray3 = await this.promiseWithFixedJobs(ajaxArray);
66538
66607
 
66539
66608
  await this.parseAlignData(dataArray3, domainidpairArray3, false);
66540
-
66609
+
66541
66610
  // end of round 2
66542
- return;
66611
+ return bNoMoreIg;
66543
66612
  }
66544
66613
 
66545
66614
  await this.parseAlignData_part3(domainid2segs);
66615
+
66616
+ return bNoMoreIg;
66546
66617
  }
66547
66618
 
66548
66619
  async parseAlignData_part3(domainid2segs) { let ic = this.icn3d, me = ic.icn3dui;
@@ -66688,7 +66759,7 @@ class Dssp {
66688
66759
  for(let i = 0, il = segArray.length; i < il; ++i) {
66689
66760
  let seg = segArray[i];
66690
66761
  if(!seg) continue;
66691
-
66762
+
66692
66763
  let qStart = seg.q_start;
66693
66764
  parseInt(seg.q_start);
66694
66765
  if(isNaN(seg.q_start)) seg.q_start.substr(seg.q_start.length - 1, 1);
@@ -66729,9 +66800,10 @@ class Dssp {
66729
66800
  if(currStrand != currStrandFinal) {
66730
66801
  refnumLabel = this.getLabelFromRefnum(refnum, currStrandFinal);
66731
66802
  }
66732
-
66733
- ic.resid2refnum[resid] = refnumLabel;
66803
+
66804
+ ic.resid2refnum[resid] = refnumLabel;
66734
66805
  ic.resid2refnum_ori[resid] = refnumLabel;
66806
+ ic.resid2domainid[resid] = domainid;
66735
66807
 
66736
66808
  // final reference numbers will be assign in ic.annoIgCls.showRefNum()
66737
66809
 
@@ -66778,7 +66850,7 @@ class Dssp {
66778
66850
  else {
66779
66851
  await ic.showAnnoCls.showAnnotations();
66780
66852
  }
66781
-
66853
+
66782
66854
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
66783
66855
  }
66784
66856
  else if(!me.bNode) {
@@ -66819,13 +66891,13 @@ class Dssp {
66819
66891
  // loops may have numbers such as 1310, 1410
66820
66892
 
66821
66893
  let refnumLabel;
66822
-
66894
+
66823
66895
  if(refnum < 1000) refnumLabel = undefined;
66824
66896
  else if(refnum >= 1200 && refnum < 1290) refnumLabel = "A---" + oriRefnum;
66825
66897
  else if(refnum >= 1320 && refnum < 1390) refnumLabel = "A--" + oriRefnum;
66826
66898
  else if(refnum >= 1420 && refnum < 1490) refnumLabel = "A-" + oriRefnum;
66827
- else if(refnum >= 1520 && refnum < 1590) refnumLabel = "A" + oriRefnum;
66828
- else if(refnum >= 1620 && refnum < 1690) refnumLabel = "A+" + oriRefnum;
66899
+ else if(refnum >= 1520 && refnum < 1590) refnumLabel = "A" + oriRefnum;
66900
+ else if(refnum >= 1620 && refnum < 1690) refnumLabel = "A+" + oriRefnum;
66829
66901
  else if(refnum >= 1820 && refnum < 1890) refnumLabel = "A'" + oriRefnum;
66830
66902
  else if(refnum >= 2000 && refnum < 2900) refnumLabel = "B" + oriRefnum;
66831
66903
  else if(refnum >= 3300 && refnum < 3390) refnumLabel = "C--" + oriRefnum;
@@ -66834,8 +66906,8 @@ class Dssp {
66834
66906
  else if(refnum >= 4000 && refnum < 4900) refnumLabel = "C'" + oriRefnum;
66835
66907
  else if(refnum >= 5000 && refnum < 5900) refnumLabel = "C''" + oriRefnum;
66836
66908
  else if(refnum >= 6000 && refnum < 6900) refnumLabel = "D" + oriRefnum;
66837
- else if(refnum >= 7500 && refnum < 7590) refnumLabel = "E" + oriRefnum;
66838
- else if(refnum >= 7620 && refnum < 7900) refnumLabel = "E+" + oriRefnum;
66909
+ else if(refnum >= 7500 && refnum < 7590) refnumLabel = "E" + oriRefnum;
66910
+ else if(refnum >= 7620 && refnum < 7900) refnumLabel = "E+" + oriRefnum;
66839
66911
  else if(refnum >= 8000 && refnum < 8900) refnumLabel = "F" + oriRefnum;
66840
66912
  else if(refnum >= 9500 && refnum < 9590) refnumLabel = "G" + oriRefnum;
66841
66913
  else if(refnum >= 9620 && refnum < 9690) refnumLabel = "G+" + oriRefnum;
@@ -66935,22 +67007,22 @@ class Dssp {
66935
67007
  }
66936
67008
  }
66937
67009
  }
66938
-
67010
+
66939
67011
  let resid2refnum = {};
66940
67012
  for(let resid in ic.resid2refnum) {
66941
67013
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
66942
67014
  if(!atom) continue;
66943
-
67015
+
66944
67016
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
66945
-
67017
+
66946
67018
  let domainid = ic.resid2domainid[resid];
66947
67019
  let refnumLabel = ic.resid2refnum[resid];
66948
-
67020
+
66949
67021
  if(refnumLabel) {
66950
67022
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
66951
67023
  (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
66952
67024
  }
66953
-
67025
+
66954
67026
  if(ic.resid2refnum[resid]) {
66955
67027
  if(ic.residIgLoop.hasOwnProperty(resid)) { // loop
66956
67028
  resid2refnum[resid + '_' + resn] = ic.resid2refnum[resid] + '_loop';
@@ -66988,21 +67060,22 @@ class Dssp {
66988
67060
  refData += '}\n';
66989
67061
  }
66990
67062
  */
67063
+
66991
67064
  if(bIgDomain) {
66992
67065
  refData += '"igs": [\n';
66993
-
66994
67066
  for(let chnid in ic.chains) {
66995
67067
  let igArray = ic.chain2igArray[chnid];
66996
67068
 
66997
- if(igArray.length > 0) {
67069
+ if(igArray && igArray.length > 0) {
66998
67070
  refData += '{"' + chnid + '": {\n';
66999
67071
 
67000
67072
  for(let i = 0, il = igArray.length; i < il; ++i) {
67001
67073
  let startPos = igArray[i].startPos;
67002
67074
  let endPos = igArray[i].endPos;
67003
67075
  let domainid = igArray[i].domainid;
67004
-
67005
67076
  let info = ic.domainid2info[domainid];
67077
+ if(!info) continue;
67078
+
67006
67079
  refData += '"' + domainid + '": {\n';
67007
67080
 
67008
67081
  refData += '"refpdbname":"' + info.refpdbname + '", "score":' + info.score + ', "seqid":' + info.seqid + ', "nresAlign":' + info.nresAlign + ', "data": [';
@@ -67030,18 +67103,18 @@ class Dssp {
67030
67103
  for(let resid in ic.resid2refnum) {
67031
67104
  let domainid = ic.resid2domainid[resid];
67032
67105
  let refnumStr, refnumLabel = ic.resid2refnum[resid];
67033
-
67106
+
67034
67107
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67035
67108
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
67036
-
67109
+
67037
67110
  if(refnumLabel) {
67038
67111
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
67039
67112
  refnumStr = (ic.domainid2ig2kabat[domainid]) ? ic.domainid2ig2kabat[domainid][refnumStr_ori] : undefined;
67040
67113
  }
67041
-
67114
+
67042
67115
  resid2kabat[resid + '_' + resn] = refnumStr;
67043
67116
  }
67044
-
67117
+
67045
67118
  refData += JSON.stringify(resid2kabat);
67046
67119
  }
67047
67120
  // 3. show IMGT ref numbers
@@ -67050,25 +67123,25 @@ class Dssp {
67050
67123
  for(let resid in ic.resid2refnum) {
67051
67124
  let domainid = ic.resid2domainid[resid];
67052
67125
  let refnumStr, refnumLabel = ic.resid2refnum[resid];
67053
-
67126
+
67054
67127
  let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[resid]);
67055
67128
  let resn = me.utilsCls.residueName2Abbr(atom.resn.substr(0, 3));
67056
-
67129
+
67057
67130
  if(refnumLabel) {
67058
67131
  let refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
67059
67132
  refnumStr = (ic.domainid2ig2imgt[domainid]) ? ic.domainid2ig2imgt[domainid][refnumStr_ori] : undefined;
67060
67133
  }
67061
-
67134
+
67062
67135
  resid2imgt[resid + '_' + resn] = refnumStr;
67063
67136
  }
67064
-
67137
+
67065
67138
  refData += JSON.stringify(resid2imgt);
67066
67139
  }
67067
67140
 
67068
67141
 
67069
67142
  if(!me.bNode) {
67070
67143
  let file_pref = Object.keys(me.utilsCls.getHlStructures()).join(',');
67071
-
67144
+
67072
67145
  ic.saveFileCls.saveFile(file_pref + '_refnum_' + type + '.txt', 'text', [refData]);
67073
67146
  }
67074
67147
  else {
@@ -67086,7 +67159,7 @@ class Dssp {
67086
67159
 
67087
67160
  for(let i = 0, il = parseInt((ajaxArray.length - 1) / n + 1); i < il; ++i) {
67088
67161
  let currAjaxArray = [];
67089
- if(i == il - 1) { // last one
67162
+ if(i == il - 1) { // last one
67090
67163
  currAjaxArray = ajaxArray.slice(i * n, ajaxArray.length);
67091
67164
  }
67092
67165
  else {