icn3d 3.25.11 → 3.25.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/icn3d.module.js CHANGED
@@ -7136,19 +7136,19 @@ class ClickMenu {
7136
7136
  });
7137
7137
 
7138
7138
  me.myEventCls.onIds("#" + me.pre + "mn1_link_bind", "click", function(e) { let ic = me.icn3d; e.preventDefault();
7139
- url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_structure&from_uid=" + ic.inputid;
7139
+ let url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_structure&from_uid=" + ic.inputid;
7140
7140
  thisClass.setLogCmd("link to 3D protein structures bound to CID " + ic.inputid + ": " + url, false);
7141
7141
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
7142
7142
  window.open(url, urlTarget);
7143
7143
  });
7144
7144
 
7145
7145
  me.myEventCls.onIds("#" + me.pre + "mn1_link_vast", "click", function(e) { let ic = me.icn3d; e.preventDefault();
7146
- if(ic.inputid === undefined) {
7147
- url = "https://www.ncbi.nlm.nih.gov/pccompound?term=" + ic.molTitle;
7148
- thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
7146
+ let url;
7147
+ if(ic.inputid === undefined) {
7148
+ url = "https://www.ncbi.nlm.nih.gov/pccompound?term=" + ic.molTitle;
7149
+ thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
7149
7150
  }
7150
7151
  else {
7151
- let url;
7152
7152
  if(me.cfg.cid !== undefined) {
7153
7153
  url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_pccompound_3d&from_uid=" + ic.inputid;
7154
7154
  thisClass.setLogCmd("link to compounds with structure similar to CID " + ic.inputid + ": " + url, false);
@@ -7172,8 +7172,8 @@ class ClickMenu {
7172
7172
  });
7173
7173
 
7174
7174
  me.myEventCls.onIds("#" + me.pre + "mn1_link_pubmed", "click", function(e) { let ic = me.icn3d; e.preventDefault();
7175
+ let url;
7175
7176
  if(ic.inputid === undefined) {
7176
- let url;
7177
7177
  url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.molTitle;
7178
7178
  thisClass.setLogCmd("link to literature about " + ic.molTitle + ": " + url, false);
7179
7179
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
@@ -7181,7 +7181,6 @@ class ClickMenu {
7181
7181
  }
7182
7182
  else if(ic.pmid) {
7183
7183
  let idArray = ic.pmid.toString().split('_');
7184
- let url;
7185
7184
  if(idArray.length === 1) {
7186
7185
  url = "https://www.ncbi.nlm.nih.gov/pubmed/" + ic.pmid;
7187
7186
  thisClass.setLogCmd("link to PubMed ID " + ic.pmid + ": " + url, false);
@@ -7195,7 +7194,6 @@ class ClickMenu {
7195
7194
  }
7196
7195
  else if(isNaN(ic.inputid)) {
7197
7196
  let idArray = ic.inputid.toString().split('_');
7198
- let url;
7199
7197
  if(idArray.length === 1) {
7200
7198
  url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.inputid;
7201
7199
  thisClass.setLogCmd("link to literature about PDB " + ic.inputid + ": " + url, false);
@@ -11909,11 +11907,11 @@ class SetDialog {
11909
11907
 
11910
11908
  html += "<div>4. " + me.htmlCls.buttonStr + "applyhbonds'>3D Display Interactions</button></div><br>";
11911
11909
 
11912
- html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondWindow'>Highlight Interactions in Table</button><span style='margin-left:30px; font-wieght:bold'>Sort Interactions on</span>: " + me.htmlCls.buttonStr + "sortSet1'> Set 1</button>" + me.htmlCls.buttonStr + "sortSet2' style='margin-left:20px'>Set 2</button></div><br>";
11910
+ html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondWindow'>Highlight Interactions in Table</button><span style='margin-left:30px; font-wieght:bold'>Sort Interactions on</span>: " + me.htmlCls.buttonStr + "sortSet1'> Set 1</button>" + me.htmlCls.buttonStr + "sortSet2' style='margin-left:12px'>Set 2</button></div><br>";
11913
11911
 
11914
- html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondLineGraph'>2D Interaction Network</button> to show interactions between two lines of residue nodes</div><br>";
11912
+ html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondLineGraph'>2D Interaction Network</button> " + me.htmlCls.buttonStr + "hbondLineGraph2' style='margin-left:12px'>2D Network with Reference Numbers</button> to show two lines of residue nodes</div><br>";
11915
11913
 
11916
- html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondScatterplot'>2D Interaction Map</button> to show interactions as map</div><br>";
11914
+ html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondScatterplot'>2D Interaction Map</button> " + me.htmlCls.buttonStr + "hbondScatterplot2' style='margin-left:12px'>2D Map with Reference Numbers</button> to show map</div><br>";
11917
11915
 
11918
11916
  tmpStr = ': </td><td><input style="margin-left:-12px" type="text" id="';
11919
11917
 
@@ -12681,7 +12679,7 @@ class Events {
12681
12679
  async searchSeq() { let me = this.icn3dui, ic = me.icn3d, thisClass = this;
12682
12680
  let select = $("#" + me.pre + "search_seq").val();
12683
12681
  if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1
12684
- && select.indexOf('%') == -1 && select.indexOf('@') == -1) {
12682
+ && select.indexOf('@') == -1) {
12685
12683
  select = ':' + select;
12686
12684
  }
12687
12685
  let commandname = select.replace(/\s+/g, '_');
@@ -14326,11 +14324,29 @@ class Events {
14326
14324
  me.myEventCls.onIds("#" + me.pre + "hbondLineGraph", "click", async function(e) { let ic = me.icn3d;
14327
14325
  e.preventDefault();
14328
14326
 
14327
+ ic.bShownRefnum = false;
14328
+ thisClass.setLogCmd("hide ref number", true);
14329
14329
  await ic.showInterCls.showInteractions('linegraph');
14330
14330
  });
14331
+ me.myEventCls.onIds("#" + me.pre + "hbondLineGraph2", "click", async function(e) { let ic = me.icn3d;
14332
+ e.preventDefault();
14333
+
14334
+ ic.bShownRefnum = true;
14335
+ thisClass.setLogCmd("show ref number", true);
14336
+ await ic.showInterCls.showInteractions('linegraph');
14337
+ });
14331
14338
  me.myEventCls.onIds("#" + me.pre + "hbondScatterplot", "click", async function(e) { let ic = me.icn3d;
14339
+ e.preventDefault();
14340
+
14341
+ ic.bShownRefnum = false;
14342
+ thisClass.setLogCmd("hide ref number", true);
14343
+ await ic.showInterCls.showInteractions('scatterplot');
14344
+ });
14345
+ me.myEventCls.onIds("#" + me.pre + "hbondScatterplot2", "click", async function(e) { let ic = me.icn3d;
14332
14346
  e.preventDefault();
14333
14347
 
14348
+ ic.bShownRefnum = true;
14349
+ thisClass.setLogCmd("show ref number", true);
14334
14350
  await ic.showInterCls.showInteractions('scatterplot');
14335
14351
  });
14336
14352
  // select residues
@@ -15117,6 +15133,22 @@ class Events {
15117
15133
  thisClass.setLogCmd('define coil sets | chain ' + chainid, true);
15118
15134
  });
15119
15135
 
15136
+ $(document).on("click", ".icn3d-igstrandsets", function(e) { let ic = me.icn3d;
15137
+ e.stopImmediatePropagation();
15138
+ //e.preventDefault();
15139
+ let chainid = $(this).attr('chainid');
15140
+ ic.addTrackCls.defineIgstrand(chainid, 'igstrand');
15141
+ thisClass.setLogCmd('define igstrand sets | chain ' + chainid, true);
15142
+ });
15143
+
15144
+ $(document).on("click", ".icn3d-igloopsets", function(e) { let ic = me.icn3d;
15145
+ e.stopImmediatePropagation();
15146
+ //e.preventDefault();
15147
+ let chainid = $(this).attr('chainid');
15148
+ ic.addTrackCls.defineIgstrand(chainid, 'igloop');
15149
+ thisClass.setLogCmd('define igloop sets | chain ' + chainid, true);
15150
+ });
15151
+
15120
15152
  me.myEventCls.onIds("#" + me.pre + "deletesets", "click", function(e) { let ic = me.icn3d;
15121
15153
  ic.definedSetsCls.deleteSelectedSets();
15122
15154
  thisClass.setLogCmd("delete selected sets", true);
@@ -35588,7 +35620,7 @@ class SetColor {
35588
35620
  // color = me.parasCls.thr(me.htmlCls.GREYB);
35589
35621
  // }
35590
35622
  // else {
35591
- let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
35623
+ let refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
35592
35624
  let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
35593
35625
  color = ic.showSeqCls.getRefnumColor(currStrand);
35594
35626
 
@@ -35624,7 +35656,7 @@ class SetColor {
35624
35656
  color = me.parasCls.thr(me.htmlCls.GREYB);
35625
35657
  }
35626
35658
  else {
35627
- let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
35659
+ let refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
35628
35660
  let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
35629
35661
  color = ic.showSeqCls.getProtodomainColor(currStrand);
35630
35662
 
@@ -40752,7 +40784,7 @@ class AddTrack {
40752
40784
  ++helixCnt;
40753
40785
 
40754
40786
  if(Object.keys(selectedResidues).length > 0) {
40755
- setName = currName + 'H' + helixCnt + ')';
40787
+ setName = currName + 'H' + helixCnt.toString().padStart(2, '0') + ')';
40756
40788
  if(type == 'coil') {
40757
40789
  ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40758
40790
  if(!bUnion) bUnion = true;
@@ -40763,13 +40795,13 @@ class AddTrack {
40763
40795
 
40764
40796
  //zero =(index < 10) ? '0' : '';
40765
40797
  //currName = chainid + zero + index + '_H' + helixCnt;
40766
- currName = chainid + '_H' + helixCnt;
40798
+ currName = chainid + '_H' + helixCnt.toString().padStart(2, '0');
40767
40799
  selectedResidues[residueid] = 1;
40768
40800
 
40769
40801
  if(atom.ssend) {
40770
40802
  //zero =(index < 9) ? '0' : '';
40771
40803
  //prevName = chainid + zero +(index+1) + '_L(H' + helixCnt;
40772
- prevName = chainid + '_C(H' + helixCnt;
40804
+ prevName = chainid + '_C(H' + helixCnt.toString().padStart(2, '0');
40773
40805
  if(type == 'helix') {
40774
40806
  ic.selectionCls.selectResidueList(selectedResidues, currName, currName, bUnion, bUpdateHighlight);
40775
40807
  if(!bUnion) bUnion = true;
@@ -40782,7 +40814,7 @@ class AddTrack {
40782
40814
  ++sheetCnt;
40783
40815
 
40784
40816
  if(Object.keys(selectedResidues).length > 0) {
40785
- setName = currName + 'S' + sheetCnt + ')';
40817
+ setName = currName + 'S' + sheetCnt.toString().padStart(2, '0') + ')';
40786
40818
  if(type == 'coil') {
40787
40819
  ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40788
40820
  if(!bUnion) bUnion = true;
@@ -40793,13 +40825,13 @@ class AddTrack {
40793
40825
 
40794
40826
  //zero =(index < 10) ? '0' : '';
40795
40827
  //currName = chainid + zero + index + '_S' + sheetCnt;
40796
- currName = chainid + '_S' + sheetCnt;
40828
+ currName = chainid + '_S' + sheetCnt.toString().padStart(2, '0');
40797
40829
  selectedResidues[residueid] = 1;
40798
40830
 
40799
40831
  if(atom.ssend) {
40800
40832
  //zero =(index < 9) ? '0' : '';
40801
40833
  //prevName = chainid + zero +(index+1) + '_L(S' + sheetCnt;
40802
- prevName = chainid + '_C(S' + sheetCnt;
40834
+ prevName = chainid + '_C(S' + sheetCnt.toString().padStart(2, '0');
40803
40835
  if(type == 'sheet') {
40804
40836
  ic.selectionCls.selectResidueList(selectedResidues, currName, currName, bUnion, bUpdateHighlight);
40805
40837
  if(!bUnion) bUnion = true;
@@ -40822,6 +40854,90 @@ class AddTrack {
40822
40854
  }
40823
40855
  }
40824
40856
 
40857
+ // type: igstrand, igloop
40858
+ defineIgstrand(chainid, type) { let ic = this.icn3d, me = ic.icn3dui;
40859
+ if(!$('#' + ic.pre + 'dl_definedsets').hasClass('ui-dialog-content') || !$('#' + ic.pre + 'dl_definedsets').dialog( 'isOpen' )) {
40860
+ me.htmlCls.dialogCls.openDlg('dl_definedsets', 'Select sets');
40861
+ $("#" + ic.pre + "atomsCustom").resizable();
40862
+ }
40863
+
40864
+ let selectedResidues = {};
40865
+ let bUnion = false, bUpdateHighlight = true;
40866
+
40867
+ let strandCnt = 0, loopCnt = 0;
40868
+ let setName, currStrand, prevStrand, prevStrandReal, currType, prevType;
40869
+
40870
+ // clear selection
40871
+ ic.hAtoms = {};
40872
+
40873
+ let bStart = false;
40874
+
40875
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
40876
+ let currResi = ic.chainsSeq[chainid][i].resi;
40877
+ let resid = chainid + '_' + currResi;
40878
+
40879
+ if(!ic.residues.hasOwnProperty(resid) ) continue;
40880
+
40881
+ let refnumLabel, refnumStr;
40882
+ refnumLabel = ic.resid2refnum[resid];
40883
+ if(!refnumLabel) continue;
40884
+
40885
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
40886
+ currStrand = refnumLabel.replace(refnumStr, '');
40887
+
40888
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
40889
+ currType = 'igloop';
40890
+ }
40891
+ else {
40892
+ currType = 'igstrand';
40893
+ }
40894
+
40895
+ if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
40896
+ if(prevType == 'igstrand') {
40897
+ ++strandCnt;
40898
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
40899
+ setName = setName.replace(/'/g, '`');
40900
+ if(type == 'igstrand') {
40901
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40902
+ if(!bUnion) bUnion = true;
40903
+ }
40904
+ prevStrandReal = prevStrand;
40905
+ }
40906
+ else if(prevType == 'igloop') {
40907
+ ++loopCnt;
40908
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40909
+ setName = setName.replace(/'/g, '`');
40910
+ if(type == 'igloop') {
40911
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40912
+ if(!bUnion) bUnion = true;
40913
+ }
40914
+ }
40915
+
40916
+ selectedResidues = {};
40917
+ }
40918
+
40919
+ selectedResidues[resid] = 1;
40920
+
40921
+ prevStrand = currStrand;
40922
+ prevType = currType;
40923
+
40924
+ bStart = true;
40925
+ } // for loop
40926
+
40927
+ if(prevType == 'igstrand') {
40928
+ ++strandCnt;
40929
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
40930
+ setName = setName.replace(/'/g, '`');
40931
+ if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40932
+ }
40933
+ else if(prevType == 'igloop') {
40934
+ ++loopCnt;
40935
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40936
+ setName = setName.replace(/'/g, '`');
40937
+ if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40938
+ }
40939
+ }
40940
+
40825
40941
  simplifyText(text) { let ic = this.icn3d; ic.icn3dui;
40826
40942
  let out = ''; // 1-based text positions
40827
40943
  let bFoundText = false;
@@ -41831,6 +41947,11 @@ class ShowAnno {
41831
41947
  chainHtml += this.addButton(chnid, "icn3d-helixsets", "Helix Sets", "Define sets for each helix in this chain and add them to the menu of \"Defined Sets\"", 60, buttonStyle) + "&nbsp;"
41832
41948
  + 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;"
41833
41949
  + 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);
41950
+
41951
+ if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid)) {
41952
+ chainHtml += "&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;"
41953
+ + 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);
41954
+ }
41834
41955
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
41835
41956
  //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
41836
41957
  let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
@@ -41889,7 +42010,7 @@ class ShowAnno {
41889
42010
  }
41890
42011
  catch(err) {
41891
42012
  thisClass.enableHlSeq();
41892
- if(!me.bNode) console.log( "No data were found for the protein " + chnidBaseArray + "..." );
42013
+ if(!me.bNode) console.log( "No sequence data were found for the protein " + chnidBaseArray + "..." );
41893
42014
  for(let chnid in ic.protein_chainid) {
41894
42015
  let chnidBase = ic.protein_chainid[chnid];
41895
42016
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
@@ -42015,7 +42136,7 @@ class ShowAnno {
42015
42136
  }
42016
42137
  }
42017
42138
  else {
42018
- if(!me.bNode) console.log( "No data were found for the chain " + chnid + "..." );
42139
+ if(!me.bNode) console.log( "No sequence data were found for the chain " + chnid + "..." );
42019
42140
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
42020
42141
  }
42021
42142
 
@@ -42724,7 +42845,7 @@ class ShowSeq {
42724
42845
  html += '</div>';
42725
42846
  html3 += '</div></div>';
42726
42847
  }
42727
- else if(ic.bShowRefnum && ic.chainid2index.hasOwnProperty(chnid)) {
42848
+ else if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid)) {
42728
42849
  let result = this.showRefNum(giSeq, chnid);
42729
42850
  html += result.html;
42730
42851
  html3 += result.html3;
@@ -42767,10 +42888,10 @@ class ShowSeq {
42767
42888
  let html = '', html3 = '';
42768
42889
 
42769
42890
  let chainList = '';
42770
- if(!ic.chainid2index[chnid]) return {html: html, html3: html3};
42891
+ if(!ic.chainid2refpdbname[chnid]) return {html: html, html3: html3};
42771
42892
 
42772
- for(let i = 0, il = ic.chainid2index[chnid].length; i < il; ++i) {
42773
- chainList += ic.refpdbArray[ic.chainid2index[chnid][i]] + " ";
42893
+ for(let i = 0, il = ic.chainid2refpdbname[chnid].length; i < il; ++i) {
42894
+ chainList += ic.chainid2refpdbname[chnid][i] + " ";
42774
42895
  }
42775
42896
 
42776
42897
  let refStruTitle = (chainList) ? "based on " + chainList : "";
@@ -42831,13 +42952,23 @@ class ShowSeq {
42831
42952
 
42832
42953
  // sometimes one chain may have several Ig domains,set an index for each IgDomain
42833
42954
  let index = 1, bStart = false;
42834
-
42955
+
42956
+ if(!bCustom && !kabat_or_imgt) {
42957
+ // reset ic.residIgLoop for the current selection, which could be the second round of ref num assignment
42958
+ let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
42959
+ for(let resid in residHash) {
42960
+ // not in loop any more if you assign ref numbers multiple times
42961
+ delete ic.residIgLoop[resid];
42962
+ }
42963
+ }
42964
+
42835
42965
  // 1. get the range of each strand excluding loops
42836
42966
  let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0, resCntAtAnchor = 0;
42837
42967
  if(!bCustom && !kabat_or_imgt) {
42838
42968
  for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor, ++resCntAtAnchor) {
42839
42969
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
42840
42970
  let residueid = chnid + '_' + currResi;
42971
+
42841
42972
  refnumLabel = ic.resid2refnum[residueid];
42842
42973
 
42843
42974
  let firstChar = (refnumLabel) ? refnumLabel.substr(0,1) : ' ';
@@ -42851,7 +42982,7 @@ class ShowSeq {
42851
42982
  }
42852
42983
 
42853
42984
  if(refnumLabel) {
42854
- refnumStr_ori = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
42985
+ refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42855
42986
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
42856
42987
  refnumStr_ori.substr(0, 1);
42857
42988
 
@@ -42959,7 +43090,7 @@ class ShowSeq {
42959
43090
  currStrand = strandArray[strandCnt].strand;
42960
43091
 
42961
43092
  if(refnumLabel) {
42962
- refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
43093
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42963
43094
  currRefnum = parseInt(refnumStr);
42964
43095
  refnumLabelNoPostfix = currStrand + currRefnum;
42965
43096
 
@@ -43041,7 +43172,7 @@ class ShowSeq {
43041
43172
  }
43042
43173
  else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
43043
43174
  // not in loop any more if you assign ref numbers multiple times
43044
- delete ic.residIgLoop[residueid];
43175
+ //delete ic.residIgLoop[residueid];
43045
43176
 
43046
43177
  bBeforeAstrand = false;
43047
43178
 
@@ -43131,7 +43262,7 @@ class ShowSeq {
43131
43262
  let bHidelabel = false;
43132
43263
 
43133
43264
  if(refnumLabel) {
43134
- refnumStr_ori = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
43265
+ refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
43135
43266
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
43136
43267
  currStrand_ori = currStrand;
43137
43268
 
@@ -45087,6 +45218,11 @@ class GetGraph {
45087
45218
  if(!bVertical) adjusty += 4 * r;
45088
45219
  }
45089
45220
 
45221
+ // show reference numbers
45222
+ if(ic.bShownRefnum && ic.resid2refnum[resid]) {
45223
+ nodeName = ic.resid2refnum[resid];
45224
+ }
45225
+
45090
45226
  let strokecolor = '#000';
45091
45227
  let strokewidth = '1';
45092
45228
  let textcolor = '#000';
@@ -54729,7 +54865,9 @@ class SetSeqAlign {
54729
54865
  if(!ic.chainsMapping[chainid2]) ic.chainsMapping[chainid2] = {};
54730
54866
 
54731
54867
  let posChain1 = {}, posChain2 = {};
54732
-
54868
+ console.log("###bRealign: " + bRealign);
54869
+ console.log(ic.qt_start_end[chainIndex]);
54870
+
54733
54871
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
54734
54872
  let start1, start2, end1, end2;
54735
54873
  if(bRealign) { // real residue numbers are stored, could be "100a"
@@ -54844,10 +54982,14 @@ class SetSeqAlign {
54844
54982
 
54845
54983
  let resi1, resi2, resn1, resn2;
54846
54984
  if(bRealign) { // tmalign: just one residue in this for loop
54847
- // resi1 = j + start1;
54848
- // resi2 = j + start2;
54849
- resi1 = ic.qt_start_end[chainIndex][i].t_start;
54850
- resi2 = ic.qt_start_end[chainIndex][i].q_start;
54985
+ if(me.cfg.aligntool == 'tmalign') {
54986
+ resi1 = ic.qt_start_end[chainIndex][i].t_start;
54987
+ resi2 = ic.qt_start_end[chainIndex][i].q_start;
54988
+ }
54989
+ else {
54990
+ resi1 = j + start1;
54991
+ resi2 = j + start2;
54992
+ }
54851
54993
 
54852
54994
  resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54853
54995
  resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
@@ -55124,7 +55266,12 @@ class SetSeqAlign {
55124
55266
  resObject.mmdbid = chainid.substr(0, pos);
55125
55267
  resObject.chain = chainid.substr(pos+1);
55126
55268
  resObject.resi = (bGap) ? '' : resi; // resi will be empty if there is no coordinates
55127
- resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
55269
+ if(!resn) {
55270
+ resObject.resn = '-';
55271
+ }
55272
+ else {
55273
+ resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
55274
+ }
55128
55275
  resObject.aligned = (bGap) ? false : bAligned;
55129
55276
  resObject.color = (bGap || !bAligned) ? me.htmlCls.GREYC : ((resn == resn_t) ? "#FF0000" : "#0000FF"); // color by identity
55130
55277
  resObject.color2 = (bGap || !bAligned) ? me.htmlCls.GREYC : '#' + ic.showAnnoCls.getColorhexFromBlosum62(resn, resn_t); // color by conservation
@@ -57827,6 +57974,18 @@ class ApplyCommand {
57827
57974
 
57828
57975
  ic.addTrackCls.defineSecondary(chainid, 'coil');
57829
57976
  }
57977
+ else if(commandOri.indexOf('define igstrand sets') == 0) {
57978
+ let chainStr = commandOri.split(' | ')[1];
57979
+ let chainid = chainStr.split(' ')[1];
57980
+
57981
+ ic.addTrackCls.defineIgstrand(chainid, 'igstrand');
57982
+ }
57983
+ else if(commandOri.indexOf('define igloop sets') == 0) {
57984
+ let chainStr = commandOri.split(' | ')[1];
57985
+ let chainid = chainStr.split(' ')[1];
57986
+
57987
+ ic.addTrackCls.defineIgstrand(chainid, 'igloop');
57988
+ }
57830
57989
  else if(commandOri.indexOf('select interaction') == 0) {
57831
57990
  let idArray = commandOri.substr(commandOri.lastIndexOf(' ') + 1).split(',');
57832
57991
  if(idArray !== null) {
@@ -58593,6 +58752,12 @@ class ApplyCommand {
58593
58752
  let dataStr = paraArray[1].replace(/\\n/g, '\n');
58594
58753
  await ic.refnumCls.parseCustomRefFile(dataStr);
58595
58754
  }
58755
+ else if(command.indexOf('show ref number') == 0) {
58756
+ ic.bShownRefnum = true;
58757
+ }
58758
+ else if(command.indexOf('hide ref number') == 0) {
58759
+ ic.bShownRefnum = false;
58760
+ }
58596
58761
 
58597
58762
  // special, select ==========
58598
58763
 
@@ -60627,6 +60792,7 @@ class SelectByCommand {
60627
60792
  // $1,2,3: Structure
60628
60793
  // .A,B,C: chain
60629
60794
  // :5-10,K,chemicals: residues, could be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
60795
+ // :ref_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
60630
60796
  // @CA,C,C*: atoms
60631
60797
  // wild card * can be used to select all
60632
60798
  //var currHighlightAtoms = {}
@@ -60634,7 +60800,7 @@ class SelectByCommand {
60634
60800
  let dollarPos = commandArray[i].indexOf('$');
60635
60801
  let periodPos = commandArray[i].indexOf('.');
60636
60802
  let colonPos = commandArray[i].indexOf(':');
60637
- let colonPos2 = commandArray[i].indexOf('%'); // for reference numbers
60803
+ let colonPos2 = commandArray[i].indexOf(':ref_'); // for reference numbers
60638
60804
  let atPos = commandArray[i].indexOf('@');
60639
60805
 
60640
60806
  let moleculeStr, chainStr, residueStr, refResStr, atomStrArray;
@@ -60651,14 +60817,14 @@ class SelectByCommand {
60651
60817
  if(colonPos === -1 && colonPos2 === -1 ) {
60652
60818
  residueStr = "*";
60653
60819
  }
60820
+ else if(colonPos2 != -1) {
60821
+ refResStr = testStr.substr(colonPos2 + 5);
60822
+ testStr = testStr.substr(0, colonPos2);
60823
+ }
60654
60824
  else if(colonPos != -1) {
60655
60825
  residueStr = testStr.substr(colonPos + 1);
60656
60826
  testStr = testStr.substr(0, colonPos);
60657
60827
  }
60658
- else if(colonPos2 != -1) {
60659
- refResStr = testStr.substr(colonPos2 + 1);
60660
- testStr = testStr.substr(0, colonPos2);
60661
- }
60662
60828
 
60663
60829
  if(periodPos === -1) {
60664
60830
  chainStr = "*";
@@ -60752,7 +60918,9 @@ class SelectByCommand {
60752
60918
  else if(residueStrArray[j] === '*') { // all resiues
60753
60919
  bAllResidues = true;
60754
60920
  }
60755
- else if(residueStrArray[j] !== 'proteins' && residueStrArray[j] !== 'nucleotides' && residueStrArray[j] !== 'chemicals' && residueStrArray[j] !== 'ions' && residueStrArray[j] !== 'water') { // residue name
60921
+ else if(residueStrArray[j] !== 'proteins' && residueStrArray[j] !== 'nucleotides'
60922
+ && residueStrArray[j] !== 'chemicals' && residueStrArray[j] !== 'ions' && residueStrArray[j] !== 'water'
60923
+ && residueStrArray[j] !== 'anchors' && residueStrArray[j] !== 'strands' && residueStrArray[j] !== 'loops') { // residue name
60756
60924
  let tmpStr = residueStrArray[j].toUpperCase();
60757
60925
  //oneLetterResidue =(residueStrArray[j].length === 1) ? tmpStr : me.utilsCls.residueName2Abbr(tmpStr);
60758
60926
  oneLetterResidueStr = tmpStr;
@@ -60821,6 +60989,16 @@ class SelectByCommand {
60821
60989
  for(let m in chainAtomHash) {
60822
60990
  // residue could also be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
60823
60991
  ic.atoms[m].resn.substr(0,3).toUpperCase();
60992
+ let resid = molecule_chain + '_' + ic.atoms[m].resi;
60993
+ let refnumLabel, refnumStr, refnum;
60994
+ if(bRefnum) {
60995
+ refnumLabel = ic.resid2refnum[resid];
60996
+ if(refnumLabel) {
60997
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
60998
+ refnum = parseInt(refnumStr);
60999
+ }
61000
+ }
61001
+
60824
61002
  if(bAllResidues
60825
61003
  //|| me.utilsCls.residueName2Abbr(tmpStr) === oneLetterResidue
60826
61004
  ||(residueStrArray[j] === 'proteins' && m in ic.proteins)
@@ -60828,32 +61006,23 @@ class SelectByCommand {
60828
61006
  ||(residueStrArray[j] === 'chemicals' && m in ic.chemicals)
60829
61007
  ||(residueStrArray[j] === 'ions' && m in ic.ions)
60830
61008
  ||(residueStrArray[j] === 'water' && m in ic.water)
61009
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'anchors' && refnum % 100 == 50)
61010
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'strands' && !ic.residIgLoop.hasOwnProperty(resid))
61011
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'loops' && ic.residIgLoop.hasOwnProperty(resid))
60831
61012
  ) {
60832
61013
  // many duplicates
60833
61014
  if(i === 0) {
60834
- residueHash[molecule_chain + '_' + ic.atoms[m].resi] = 1;
61015
+ residueHash[resid] = 1;
60835
61016
  }
60836
61017
  else {
60837
- let residTmp = molecule_chain + '_' + ic.atoms[m].resi;
60838
- //if(!residueHash.hasOwnProperty(residTmp)) residueHash[residTmp] = undefined;
60839
- if(!residueHash.hasOwnProperty(residTmp)) delete residueHash[residTmp];
61018
+ if(!residueHash.hasOwnProperty(resid)) delete residueHash[resid];
60840
61019
  }
60841
61020
 
60842
61021
  for(let n = 0, nl = atomStrArray.length; n < nl; ++n) {
60843
61022
  let atomStr = atomStrArray[n];
60844
61023
 
60845
61024
  atomHash = this.processAtomStr(atomStr, atomHash, i, m);
60846
-
60847
- // if(atomStr === '*' || atomStr === ic.atoms[m].name) {
60848
- // if(i === 0) {
60849
- // atomHash[m] = 1;
60850
- // }
60851
- // else {
60852
- // if(!atomHash.hasOwnProperty(m)) delete atomHash[m];
60853
- // }
60854
- // }
60855
61025
  }
60856
-
60857
61026
  }
60858
61027
  } // end for(let m in atomHash) {
60859
61028
 
@@ -62970,72 +63139,155 @@ class Dssp {
62970
63139
  async showIgRefNum() { let ic = this.icn3d, me = ic.icn3dui;
62971
63140
  let thisClass = this;
62972
63141
 
62973
- // if(ic.resid2refnum && Object.keys(ic.resid2refnum).length > 0) {
62974
- // ic.bShowRefnum = true;
62975
-
62976
- // // open sequence view
62977
- // ic.hAtomsRefnum = {};
62978
- // ic.bResetAnno = true;
62979
- // await ic.showAnnoCls.showAnnotations();
62980
- // ic.annotationCls.setAnnoViewAndDisplay('detailed view');
63142
+ // if(ic.pdbDataArray) {
63143
+ // await thisClass.parseRefPdbData(ic.pdbDataArray);
62981
63144
  // }
62982
- if(ic.pdbDataArray) {
62983
- await thisClass.parseRefPdbData(ic.pdbDataArray);
62984
- }
62985
- else {
62986
- //ic.refpdbArray = ['1bqu_fn3', '1cd8_igv', '1cdh_cd4', '1dr9_cd80', '1hnf_cd2', '1hxm_d', '1hxm_g', '1ifr_lamin', '1ncn_cd86', '1t6v_vnar', '1yjd_cd28', '2atp_a', '2atp_b', '2dm3_iset', '3kys_tead1', '3pv7_ncr', '4f9l_cd277', '4gos_vtc', '4i0k_cd276', '4jqi_b', '4z18_cd274', '4zqk_pd1', '4zt1_e', '5esv_vh', '5esv_vl', '6al5_cd19', '6jxr_a', '6jxr_b', '6jxr_d', '6jxr_e', '6jxr_g', '6oil_vista', '6rp8_at', '6rp8_t', '6umt_cd273', '6x4g_cd275', '6x4g_icos', '7xq8_a', '7xq8_b', 'q71h61_ild', 'q9um44_hhl', 'p42081_cd86', 'q7z7d3_vtc', '1bqu_x', '1cdh_x', '1hnf_x', '1hxm_dx', '1hxm_gx', '4jqi_x', '4zt1_x', '5esv_vhx', '5esv_vlx', '6jxr_ax', '6jxr_bx', '1dr9_x', '3pv7_x', '4f9l_x', '4iok_x', '4z18_x', '6x4g_cd275x', 'q9um44_x'];
62987
-
62988
- //ic.refpdbArray = ['1bqu_fn3', '1cd8_igv', '1cdh_cd4', '1dr9_cd80', '1hnf_cd2', '1hxm_d', '1hxm_g', '1ifr_lamin', '1ncn_cd86', '1t6v_vnar', '1yjd_cd28', '2atp_a', '2atp_b', '2dm3_iset', '3kys_tead1', '3pv7_ncr', '4f9l_cd277', '4gos_vtc', '4i0k_cd276', '4jqi_b', '4z18_cd274', '4zqk_pd1', '4zt1_e', '5esv_vh', '5esv_vl', '6al5_cd19', '6jxr_a', '6jxr_b', '6jxr_d', '6jxr_e', '6jxr_g', '6oil_vista', '6rp8_at', '6rp8_t', '6umt_cd273', '6x4g_cd275', '6x4g_icos', '7xq8_a', '7xq8_b', 'q71h61_ild', 'q9um44_hhl'];
62989
-
62990
- //ic.refpdbArray = ['ASF1A_2iijA_human', 'BArrestin1_4jqiA_rat_n1', 'BTLA_2aw2A_human_Iset', 'C3_2qkiD_human_n1', 'CD19_6al5A_human_C2orV-n1', 'CD2_1hnfA_human_C2-n2', 'CD2_1hnfA_human_V-n1', 'CD8a_1cd8A_human_V', 'CoAtomerGamma1_1r4xA_human', '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', 'InsulinR_8guyE_human_FN3-n2', 'IsdA_2iteA_bacteria', 'LAG3_7tzgD_human_C2-n2', 'LAG3_7tzgD_human_V-n1', 'LaminAC_1ifrA_human', 'MHCIa_7phrH_human_C1', 'MPT63_1lmiA_bacteria', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'PD1_4zqkB_human_V', 'PDL1_4z18B_human_V-n1', 'Palladin_2dm3A_human_Iset-n1', 'RBPJ_6py8C_human_Unk-n1', 'RBPJ_6py8C_human_Unk-n2', 'TCRa_6jxrm_human_C1-n2', 'TCRa_6jxrm_human_V-n1', 'TEAD1_3kysC_human', 'TP34_2o6cA_bacteria', 'Titin_4uowM_human_Unk-n152', 'VISTA_6oilA_human_V', 'VNAR_1t6vN_shark_V', 'VTCN1_Q7Z7D3_human_V-n2'];
62991
-
62992
- //ic.refpdbArray2 = ['B2Microglobulin_7phrL_human_C1.pdb', 'Contactin1_2ee2A_human_FN3-n9.pdb', 'IL6Rb_1bquB_human_FN3-n3.pdb', 'InsulinR_8guyE_human_FN3-n1.pdb', 'JAM1_1nbqA_human_VorIset-n2.pdb', 'NaCaExchanger_2fwuA_dog_n2.pdb', 'ORF7a_1xakA_virus.pdb', 'Sidekick2_1wf5A_human_FN3-n7.pdb', 'Siglec3_5j0bB_human_C2-n2.pdb', 'TP47_1o75A_bacteria.pdb'];
62993
-
62994
- ic.refpdbArray = ['ASF1A_2iijA_human', 'BArrestin1_4jqiA_rat_n1', 'BTLA_2aw2A_human_Iset', 'C3_2qkiD_human_n1', 'CD19_6al5A_human_C2orV-n1', 'CD2_1hnfA_human_C2-n2', 'CD2_1hnfA_human_V-n1', 'CD8a_1cd8A_human_V', 'CoAtomerGamma1_1r4xA_human', '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', 'InsulinR_8guyE_human_FN3-n2', 'IsdA_2iteA_bacteria', 'LAG3_7tzgD_human_C2-n2', 'LAG3_7tzgD_human_V-n1', 'LaminAC_1ifrA_human', 'MHCIa_7phrH_human_C1', 'MPT63_1lmiA_bacteria', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'PD1_4zqkB_human_V', 'PDL1_4z18B_human_V-n1', 'Palladin_2dm3A_human_Iset-n1', 'RBPJ_6py8C_human_Unk-n1', 'RBPJ_6py8C_human_Unk-n2', 'TCRa_6jxrm_human_C1-n2', 'TCRa_6jxrm_human_V-n1', 'TEAD1_3kysC_human', 'TP34_2o6cA_bacteria', 'Titin_4uowM_human_Unk-n152', 'VISTA_6oilA_human_V', 'VNAR_1t6vN_shark_V', 'VTCN1_Q7Z7D3_human_V-n2', 'B2Microglobulin_7phrL_human_C1.pdb', 'Contactin1_2ee2A_human_FN3-n9.pdb', 'IL6Rb_1bquB_human_FN3-n3.pdb', 'InsulinR_8guyE_human_FN3-n1.pdb', 'JAM1_1nbqA_human_VorIset-n2.pdb', 'NaCaExchanger_2fwuA_dog_n2.pdb', 'ORF7a_1xakA_virus.pdb', 'Sidekick2_1wf5A_human_FN3-n7.pdb', 'Siglec3_5j0bB_human_C2-n2.pdb', 'TP47_1o75A_bacteria.pdb'];
62995
-
62996
- if(ic.pdbDataArray) {
62997
- await thisClass.parseRefPdbData(ic.pdbDataArray);
62998
- }
62999
- else {
63000
-
63001
- let pdbAjaxArray = [];
63002
- for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
63003
- //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
63004
- let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
63145
+ // else {
63146
+ //ic.refpdbArray = ['ASF1A_2iijA_human', 'B2Microglobulin_7phrL_human_C1', 'BArrestin1_4jqiA_rat_n1', 'BTLA_2aw2A_human_Iset', 'C3_2qkiD_human_n1', 'CD19_6al5A_human_C2orV-n1', 'CD2_1hnfA_human_C2-n2', 'CD2_1hnfA_human_V-n1', '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'];
63147
+
63148
+ //ic.refpdbArray = ['1ASF1A_2iijA_human', '1B2Microglobulin_7phrL_human_C1', '1BArrestin1_4jqiA_rat_n1', '1BTLA_2aw2A_human_Iset', '1C3_2qkiD_human_n1', '1CD19_6al5A_human_C2orV-n1', '1CD2_1hnfA_human_C2-n2', '1CD2_1hnfA_human_V-n1', '1CD8a_1cd8A_human_V', '1CoAtomerGamma1_1r4xA_human', '1Contactin1_2ee2A_human_FN3-n9', '1Contactin1_3s97C_human_C2-n2', '1CuZnSuperoxideDismutase_1hl5C_human', '1ECadherin_4zt1A_human_n2', '1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', '1FAB-HEAVY_5esv_C1-n2', '1FAB-HEAVY_5esv_V-n1', '1FAB-LIGHT_5esv_C1-n2', '1FAB-LIGHT_5esv_V-n1', '1GHR_1axiB_human_FN3-n1', '1ICOS_6x4gA_human_V', '1IL6Rb_1bquB_human_FN3-n2', '1IL6Rb_1bquB_human_FN3-n3', '1InsulinR_8guyE_human_FN3-n1', '1InsulinR_8guyE_human_FN3-n2', '1IsdA_2iteA_bacteria', '1JAM1_1nbqA_human_VorIset-n2', '1LAG3_7tzgD_human_C2-n2', '1LAG3_7tzgD_human_V-n1', '1LaminAC_1ifrA_human', '1MHCIa_7phrH_human_C1', '1MPT63_1lmiA_bacteria', '1NaCaExchanger_2fwuA_dog_n2', '1NaKATPaseTransporterBeta_2zxeB_spurdogshark', '1ORF7a_1xakA_virus', '1PD1_4zqkB_human_V', '1PDL1_4z18B_human_V-n1', '1Palladin_2dm3A_human_Iset-n1', '1RBPJ_6py8C_human_Unk-n1', '1RBPJ_6py8C_human_Unk-n2', '1Sidekick2_1wf5A_human_FN3-n7', '1Siglec3_5j0bB_human_C2-n2', '1TCRa_6jxrm_human_C1-n2', '1TCRa_6jxrm_human_V-n1', '1TEAD1_3kysC_human', '1TP34_2o6cA_bacteria', '1TP47_1o75A_bacteria', '1Titin_4uowM_human_Unk-n152', '1VISTA_6oilA_human_V', '1VNAR_1t6vN_shark_V', '1VTCN1_Q7Z7D3_human_V-n2'];
63149
+
63150
+ /*
63151
+ // round 1
63152
+ ic.refpdbArray = ['NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'GHR_1axiB_human_FN3-n1', 'FAB-HEAVY_5esv_C1-n2', 'IL6Rb_1bquB_human_FN3-n2', 'LAG3_7tzgD_human_C2-n2', 'VNAR_1t6vN_shark_V', 'VISTA_6oilA_human_V', 'CD19_6al5A_human_C2orV-n1', 'TP47_1o75A_bacteria', 'TP34_2o6cA_bacteria'];
63153
+ // round 2
63154
+ ic.refpdbHash = {};
63155
+
63156
+ ic.refpdbHash['NaKATPaseTransporterBeta_2zxeB_spurdogshark'] = ['NaKATPaseTransporterBeta_2zxeB_spurdogshark', 'ORF7a_1xakA_virus', 'NaCaExchanger_2fwuA_dog_n2', 'BArrestin1_4jqiA_rat_n1', 'ECadherin_4zt1A_human_n2', 'C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1'];
63157
+ ic.refpdbHash['GHR_1axiB_human_FN3-n1'] = ['GHR_1axiB_human_FN3-n1', 'Siglec3_5j0bB_human_C2-n2', 'ICOS_6x4gA_human_V', 'CD2_1hnfA_human_C2-n2', 'Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
63158
+ ic.refpdbHash['FAB-HEAVY_5esv_C1-n2'] = ['FAB-HEAVY_5esv_C1-n2', 'B2Microglobulin_7phrL_human_C1', 'VTCN1_Q7Z7D3_human_V-n2', 'FAB-LIGHT_5esv_C1-n2', 'MHCIa_7phrH_human_C1'];
63159
+ ic.refpdbHash['IL6Rb_1bquB_human_FN3-n2'] = ['IL6Rb_1bquB_human_FN3-n2', 'Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n3', 'InsulinR_8guyE_human_FN3-n1', 'Sidekick2_1wf5A_human_FN3-n7', 'InsulinR_8guyE_human_FN3-n2'];
63160
+ ic.refpdbHash['LAG3_7tzgD_human_C2-n2'] = ['LAG3_7tzgD_human_C2-n2', 'JAM1_1nbqA_human_VorIset-n2', 'Contactin1_3s97C_human_C2-n2', 'Palladin_2dm3A_human_Iset-n1', 'BTLA_2aw2A_human_Iset', 'Titin_4uowM_human_Unk-n152'];
63161
+ ic.refpdbHash['VNAR_1t6vN_shark_V'] = ['VNAR_1t6vN_shark_V', 'PD1_4zqkB_human_V', 'CD8a_1cd8A_human_V', 'TCRa_6jxrm_human_V-n1', 'FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1'];
63162
+ ic.refpdbHash['VISTA_6oilA_human_V'] = ['VISTA_6oilA_human_V', 'LAG3_7tzgD_human_V-n1', 'PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1'];
63163
+ ic.refpdbHash['CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
63164
+ ic.refpdbHash['TP47_1o75A_bacteria'] = ['TP47_1o75A_bacteria', 'TEAD1_3kysC_human', 'RBPJ_6py8C_human_Unk-n2', 'CuZnSuperoxideDismutase_1hl5C_human', 'ASF1A_2iijA_human'];
63165
+ ic.refpdbHash['TP34_2o6cA_bacteria'] = ['TP34_2o6cA_bacteria', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria', 'LaminAC_1ifrA_human', 'CoAtomerGamma1_1r4xA_human', 'MPT63_1lmiA_bacteria'];
63166
+ */
63167
+ /*
63168
+ // round 1
63169
+ ic.refpdbArray = ['NaCaExchanger_2fwuA_dog_n2', 'C3_2qkiD_human_n1', 'Siglec3_5j0bB_human_C2-n2', 'ICOS_6x4gA_human_V', 'B2Microglobulin_7phrL_human_C1', 'VTCN1_Q7Z7D3_human_V-n2', 'Contactin1_2ee2A_human_FN3-n9', 'InsulinR_8guyE_human_FN3-n1', 'JAM1_1nbqA_human_VorIset-n2', 'LAG3_7tzgD_human_C2-n2', 'Palladin_2dm3A_human_Iset-n1', 'PD1_4zqkB_human_V', 'CD8a_1cd8A_human_V', 'VISTA_6oilA_human_V', 'LAG3_7tzgD_human_V-n1', 'TP47_1o75A_bacteria', 'TP34_2o6cA_bacteria', 'TEAD1_3kysC_human', 'RBPJ_6py8C_human_Unk-n2', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria', 'LaminAC_1ifrA_human', 'CD19_6al5A_human_C2orV-n1'];
63170
+
63171
+ // round 2
63172
+ ic.refpdbHash = {};
63173
+ ic.refpdbHash['NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
63174
+ ic.refpdbHash['C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1', 'BArrestin1_4jqiA_rat_n1'];
63175
+ ic.refpdbHash['Siglec3_5j0bB_human_C2-n2'] = ['Siglec3_5j0bB_human_C2-n2', 'CD2_1hnfA_human_C2-n2', 'GHR_1axiB_human_FN3-n1'];
63176
+ ic.refpdbHash['ICOS_6x4gA_human_V'] = ['ICOS_6x4gA_human_V', 'Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
63177
+ ic.refpdbHash['B2Microglobulin_7phrL_human_C1'] = ['B2Microglobulin_7phrL_human_C1', 'FAB-HEAVY_5esv_C1-n2', 'MHCIa_7phrH_human_C1'];
63178
+ ic.refpdbHash['VTCN1_Q7Z7D3_human_V-n2'] = ['VTCN1_Q7Z7D3_human_V-n2', 'FAB-LIGHT_5esv_C1-n2'];
63179
+ ic.refpdbHash['Contactin1_2ee2A_human_FN3-n9'] = ['Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n3', 'Sidekick2_1wf5A_human_FN3-n7'];
63180
+ ic.refpdbHash['InsulinR_8guyE_human_FN3-n1'] = ['InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n2'];
63181
+ ic.refpdbHash['JAM1_1nbqA_human_VorIset-n2'] = ['JAM1_1nbqA_human_VorIset-n2', 'Contactin1_3s97C_human_C2-n2'];
63182
+ ic.refpdbHash['LAG3_7tzgD_human_C2-n2'] = ['LAG3_7tzgD_human_C2-n2', 'BTLA_2aw2A_human_Iset'];
63183
+ ic.refpdbHash['Palladin_2dm3A_human_Iset-n1'] = ['Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152'];
63184
+ ic.refpdbHash['PD1_4zqkB_human_V'] = ['PD1_4zqkB_human_V', 'TCRa_6jxrm_human_V-n1', 'FAB-LIGHT_5esv_V-n1'];
63185
+ ic.refpdbHash['CD8a_1cd8A_human_V'] = ['CD8a_1cd8A_human_V', 'FAB-HEAVY_5esv_V-n1', 'VNAR_1t6vN_shark_V'];
63186
+ ic.refpdbHash['VISTA_6oilA_human_V'] = ['VISTA_6oilA_human_V', 'PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1'];
63187
+ ic.refpdbHash['LAG3_7tzgD_human_V-n1'] = ['LAG3_7tzgD_human_V-n1'];
63188
+ ic.refpdbHash['TP47_1o75A_bacteria'] = ['TP47_1o75A_bacteria'];
63189
+ ic.refpdbHash['TP34_2o6cA_bacteria'] = ['TP34_2o6cA_bacteria'];
63190
+ ic.refpdbHash['TEAD1_3kysC_human'] = ['TEAD1_3kysC_human', 'CuZnSuperoxideDismutase_1hl5C_human'];
63191
+ ic.refpdbHash['RBPJ_6py8C_human_Unk-n2'] = ['RBPJ_6py8C_human_Unk-n2', 'ASF1A_2iijA_human'];
63192
+ ic.refpdbHash['TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
63193
+ ic.refpdbHash['IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria', 'CoAtomerGamma1_1r4xA_human'];
63194
+ ic.refpdbHash['LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'MPT63_1lmiA_bacteria'];
63195
+ ic.refpdbHash['CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
63196
+ */
63197
+ // round 1, 16 templates
63198
+ ic.refpdbArray = ['1InsulinR_8guyE_human_FN3-n1', '1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', '1CoAtomerGamma1_1r4xA_human', '1C3_2qkiD_human_n1', '1CuZnSuperoxideDismutase_1hl5C_human', '1ASF1A_2iijA_human', '1FAB-LIGHT_5esv_C1-n2', '1CD2_1hnfA_human_C2-n2', '1NaCaExchanger_2fwuA_dog_n2', '1FAB-HEAVY_5esv_V-n1', '1PDL1_4z18B_human_V-n1', '1BTLA_2aw2A_human_Iset', '1LaminAC_1ifrA_human', '1IsdA_2iteA_bacteria', '1TCRa_6jxrm_human_C1-n2', '1CD19_6al5A_human_C2orV-n1'];
63199
+
63200
+ // round 2
63201
+ ic.refpdbHash = {};
63202
+ ic.refpdbHash['1InsulinR_8guyE_human_FN3-n1'] = ['InsulinR_8guyE_human_FN3-n1', 'IL6Rb_1bquB_human_FN3-n3', 'Sidekick2_1wf5A_human_FN3-n7', 'InsulinR_8guyE_human_FN3-n2', 'Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n2'];
63203
+ ic.refpdbHash['1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'ICOS_6x4gA_human_V'];
63204
+ ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
63205
+ ic.refpdbHash['1C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'BArrestin1_4jqiA_rat_n1', 'RBPJ_6py8C_human_Unk-n1'];
63206
+ ic.refpdbHash['1CuZnSuperoxideDismutase_1hl5C_human'] = ['CuZnSuperoxideDismutase_1hl5C_human', 'TEAD1_3kysC_human'];
63207
+ ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human', 'MPT63_1lmiA_bacteria'];
63208
+ ic.refpdbHash['1FAB-LIGHT_5esv_C1-n2'] = ['FAB-LIGHT_5esv_C1-n2', 'GHR_1axiB_human_FN3-n1', 'VTCN1_Q7Z7D3_human_V-n2', 'B2Microglobulin_7phrL_human_C1', 'FAB-HEAVY_5esv_C1-n2', 'MHCIa_7phrH_human_C1'];
63209
+ ic.refpdbHash['1CD2_1hnfA_human_C2-n2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2'];
63210
+ ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
63211
+ ic.refpdbHash['1FAB-HEAVY_5esv_V-n1'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1', 'VNAR_1t6vN_shark_V', 'TCRa_6jxrm_human_V-n1', 'VISTA_6oilA_human_V', 'CD8a_1cd8A_human_V', 'PD1_4zqkB_human_V'];
63212
+ ic.refpdbHash['1PDL1_4z18B_human_V-n1'] = ['PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1', 'LAG3_7tzgD_human_V-n1'];
63213
+ ic.refpdbHash['1BTLA_2aw2A_human_Iset'] = ['BTLA_2aw2A_human_Iset', 'Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152', 'LAG3_7tzgD_human_C2-n2', 'JAM1_1nbqA_human_VorIset-n2', 'Contactin1_3s97C_human_C2-n2'];
63214
+ ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human'];
63215
+ ic.refpdbHash['1IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria'];
63216
+ ic.refpdbHash['1TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
63217
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
63218
+
63219
+ // use known ref structure
63220
+ ic.refpdbHash['5ESV'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2', 'FAB-LIGHT_5esv_C1-n2'];
63221
+ ic.refpdbHash['8GUY'] = ['InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2'];
63222
+ ic.refpdbHash['6JXR'] = ['TCRa_6jxrm_human_V-n1', 'TCRa_6jxrm_human_C1-n2'];
63223
+ ic.refpdbHash['1HNF'] = ['CD2_1hnfA_human_V-n1', 'CD2_1hnfA_human_C2-n2'];
63224
+ ic.refpdbHash['7TZG'] = ['LAG3_7tzgD_human_V-n1', 'LAG3_7tzgD_human_C2-n2'];
63225
+ ic.refpdbHash['6PY8'] = ['RBPJ_6py8C_human_Unk-n1', 'RBPJ_6py8C_human_Unk-n2'];
63226
+ ic.refpdbHash['1BQU'] = ['IL6Rb_1bquB_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n3'];
63227
+
63228
+ ic.refpdbHash['1R4X'] = ['CoAtomerGamma1_1r4xA_human'];
63229
+ ic.refpdbHash['6OIL'] = ['VISTA_6oilA_human_V'];
63230
+ ic.refpdbHash['2ZXE'] = ['NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
63231
+ ic.refpdbHash['1I8A'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
63232
+ ic.refpdbHash['2FWU'] = ['NaCaExchanger_2fwuA_dog_n2'];
63233
+ ic.refpdbHash['4JQI'] = ['BArrestin1_4jqiA_rat_n1'];
63234
+ ic.refpdbHash['1NBQ'] = ['JAM1_1nbqA_human_VorIset-n2'];
63235
+ ic.refpdbHash['1O75'] = ['TP47_1o75A_bacteria'];
63236
+ ic.refpdbHash['7PHR'] = ['MHCIa_7phrH_human_C1'];
63237
+ ic.refpdbHash['2IIJ'] = ['ASF1A_2iijA_human'];
63238
+ ic.refpdbHash['4Z18'] = ['PDL1_4z18B_human_V-n1'];
63239
+ ic.refpdbHash['1T6V'] = ['VNAR_1t6vN_shark_V'];
63240
+ ic.refpdbHash['2O6C'] = ['TP34_2o6cA_bacteria'];
63241
+ ic.refpdbHash['3KYS'] = ['TEAD1_3kysC_human'];
63242
+ ic.refpdbHash['7PHR'] = ['B2Microglobulin_7phrL_human_C1'];
63243
+ ic.refpdbHash['2AW2'] = ['BTLA_2aw2A_human_Iset'];
63244
+ ic.refpdbHash['1HL5'] = ['CuZnSuperoxideDismutase_1hl5C_human'];
63245
+ ic.refpdbHash['1WF5'] = ['Sidekick2_1wf5A_human_FN3-n7'];
63246
+ ic.refpdbHash['5J0B'] = ['Siglec3_5j0bB_human_C2-n2'];
63247
+ ic.refpdbHash['1IFR'] = ['LaminAC_1ifrA_human'];
63248
+ ic.refpdbHash['Q7Z7D3'] = ['VTCN1_Q7Z7D3_human_V-n2'];
63249
+ ic.refpdbHash['4ZQK'] = ['PD1_4zqkB_human_V'];
63250
+ ic.refpdbHash['2DM3'] = ['Palladin_2dm3A_human_Iset-n1'];
63251
+ ic.refpdbHash['2ITE'] = ['IsdA_2iteA_bacteria'];
63252
+ ic.refpdbHash['1XAK'] = ['ORF7a_1xakA_virus'];
63253
+ ic.refpdbHash['4ZT1'] = ['ECadherin_4zt1A_human_n2'];
63254
+ ic.refpdbHash['1LMI'] = ['MPT63_1lmiA_bacteria'];
63255
+ ic.refpdbHash['1CD8'] = ['CD8a_1cd8A_human_V'];
63256
+ ic.refpdbHash['3S97'] = ['Contactin1_3s97C_human_C2-n2'];
63257
+ ic.refpdbHash['1AXI'] = ['GHR_1axiB_human_FN3-n1'];
63258
+ ic.refpdbHash['6X4G'] = ['ICOS_6x4gA_human_V'];
63259
+ ic.refpdbHash['2EE2'] = ['Contactin1_2ee2A_human_FN3-n9'];
63260
+ ic.refpdbHash['4UOW'] = ['Titin_4uowM_human_Unk-n152'];
63261
+ ic.refpdbHash['6A15'] = ['CD19_6al5A_human_C2orV-n1'];
63262
+ ic.refpdbHash['2QKI'] = ['C3_2qkiD_human_n1'];
63263
+
63264
+ // if(ic.pdbDataArray) {
63265
+ // await thisClass.parseRefPdbData(ic.pdbDataArray);
63266
+ // }
63267
+ // else {
63005
63268
 
63006
- let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
63269
+ let pdbAjaxArray = [];
63270
+ for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
63271
+ //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
63272
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
63007
63273
 
63008
- pdbAjaxArray.push(pdbAjax);
63009
- }
63274
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
63010
63275
 
63011
- // try {
63012
- // if(!me.bNode) {
63013
- let allPromise = Promise.allSettled(pdbAjaxArray);
63014
- ic.pdbDataArray = await allPromise;
63015
- await thisClass.parseRefPdbData(ic.pdbDataArray);
63016
- // }
63017
- // else {
63018
- // ic.pdbDataArray = [];
63019
- // for(let i = 0, il = pdbAjaxArray.length; i < il; ++i) {
63020
- // try {
63021
- // let dataTmp = await pdbAjaxArray[i];
63022
- // ic.pdbDataArray.push({'value': dataTmp});
63023
- // }
63024
- // catch(err) {
63025
- // ic.pdbDataArray.push({'value': ''});
63026
- // }
63027
- // }
63028
-
63029
- // await thisClass.parseRefPdbData(ic.pdbDataArray);
63030
- // }
63031
- // }
63032
- // catch(err) {
63033
- // if(!me.bNode) alert("Error in retrieveing reference PDB data...");
63034
- // //alert("Error in retrieveing reference PDB data...");
63035
- // return;
63036
- // }
63037
- }
63276
+ pdbAjaxArray.push(pdbAjax);
63038
63277
  }
63278
+
63279
+ // try {
63280
+ let allPromise = Promise.allSettled(pdbAjaxArray);
63281
+ ic.pdbDataArray = await allPromise;
63282
+ await thisClass.parseRefPdbData(ic.pdbDataArray);
63283
+ // }
63284
+ // catch(err) {
63285
+ // if(!me.bNode) alert("Error in retrieveing reference PDB data...");
63286
+ // //alert("Error in retrieveing reference PDB data...");
63287
+ // return;
63288
+ // }
63289
+ // }
63290
+ // }
63039
63291
  }
63040
63292
 
63041
63293
  async parseRefPdbData(dataArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -63050,6 +63302,9 @@ class Dssp {
63050
63302
 
63051
63303
  // if(!ic.resid2domainid) ic.resid2domainid = {};
63052
63304
  ic.resid2domainid = {};
63305
+ ic.domainid2pdb = {};
63306
+
63307
+ let minResidues = 20;
63053
63308
 
63054
63309
  for(let i = 0, il = struArray.length; i < il; ++i) {
63055
63310
  let struct = struArray[i];
@@ -63060,7 +63315,7 @@ class Dssp {
63060
63315
 
63061
63316
  if(!ic.proteins.hasOwnProperty(ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chainid]).serial)
63062
63317
  && !ic.proteins.hasOwnProperty(ic.firstAtomObjCls.getMiddleAtomObj(ic.chains[chainid]).serial)) continue;
63063
- if(ic.chainsSeq[chainid].length < 50) continue; // peptide
63318
+ if(ic.chainsSeq[chainid].length < minResidues) continue; // peptide
63064
63319
 
63065
63320
  let currAtoms = me.hashUtilsCls.intHash(ic.chains[chainid], ic.hAtoms);
63066
63321
  if(Object.keys(currAtoms).length == 0) continue;
@@ -63077,11 +63332,6 @@ class Dssp {
63077
63332
  //domainAtomsArray.push(ic.chains[chainid]);
63078
63333
  domainAtomsArray.push(currAtoms);
63079
63334
 
63080
- // for(let n = 0, nl = ic.chainsSeq[chainid].length; n < nl; ++n) {
63081
- // let resid = chainid + '_' + ic.chainsSeq[chainid][n].resi;
63082
- // ic.resid2domainid[resid] = chainid + '-0';
63083
- // }
63084
-
63085
63335
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
63086
63336
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
63087
63337
  let resid = residueArray[n];
@@ -63108,10 +63358,11 @@ class Dssp {
63108
63358
  domainAtomsArray.push(domainAtoms);
63109
63359
  }
63110
63360
  }
63111
-
63361
+ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.length: " + domainAtomsArray.length);
63112
63362
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
63113
63363
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
63114
63364
  let domainid = chainid + '-' + k;
63365
+ ic.domainid2pdb[domainid] = pdb_target;
63115
63366
 
63116
63367
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
63117
63368
  let struct2 = ic.defaultPdbId + index;
@@ -63123,31 +63374,19 @@ class Dssp {
63123
63374
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
63124
63375
  ajaxArray.push(alignAjax);
63125
63376
 
63126
- domainidpairArray.push(domainid + "," + index);
63377
+ domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
63127
63378
  }
63128
63379
  }
63129
63380
  }
63130
- }
63381
+ }
63131
63382
 
63132
63383
  // try {
63133
63384
  let dataArray2 = [];
63134
- // if(!me.bNode) {
63135
- let allPromise = Promise.allSettled(ajaxArray);
63136
- dataArray2 = await allPromise;
63137
- // }
63138
- // else {
63139
- // for(let i = 0, il = ajaxArray.length; i < il; ++i) {
63140
- // try {
63141
- // let dataTmp = await ajaxArray[i];
63142
- // dataArray2.push({'value': dataTmp});
63143
- // }
63144
- // catch(err) {
63145
- // dataArray2.push({'value': []});
63146
- // }
63147
- // }
63148
- // }
63149
-
63150
- await thisClass.parseAlignData(dataArray2, domainidpairArray);
63385
+ let allPromise = Promise.allSettled(ajaxArray);
63386
+ dataArray2 = await allPromise;
63387
+
63388
+ let bRound1 = true;
63389
+ await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
63151
63390
 
63152
63391
  /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
63153
63392
  // }
@@ -63158,23 +63397,25 @@ class Dssp {
63158
63397
  // }
63159
63398
  }
63160
63399
 
63161
- async parseAlignData(dataArray, domainidpairArray) { let ic = this.icn3d, me = ic.icn3dui;
63400
+ async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
63162
63401
  let thisClass = this;
63163
63402
 
63164
- let tmscoreThreshold = 0.4; //0.5;
63403
+ let tmscoreThreshold = 0.4; // 0.4; //0.5;
63165
63404
 
63166
63405
  // find the best alignment for each chain
63167
63406
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
63168
63407
 
63169
- if(!ic.chainid2index) ic.chainid2index = {};
63170
- if(!ic.domainid2index) ic.domainid2index = {};
63171
- if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
63172
- if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
63408
+ // if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
63409
+ // if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
63410
+ // if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
63411
+ // if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
63173
63412
 
63174
- // ic.chainid2index = {};
63175
- // ic.domainid2index = {};
63176
- // ic.domainid2ig2kabat = {};
63177
- // ic.domainid2ig2imgt = {};
63413
+ ic.chainid2refpdbname = {};
63414
+ ic.domainid2refpdbname = {};
63415
+ ic.domainid2ig2kabat = {};
63416
+ ic.domainid2ig2imgt = {};
63417
+
63418
+ let minResidues = 20;
63178
63419
 
63179
63420
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
63180
63421
  let queryData = dataArray[i].value; //[0];
@@ -63185,12 +63426,16 @@ class Dssp {
63185
63426
  }
63186
63427
 
63187
63428
  if(queryData.length == 0) continue;
63429
+
63430
+ if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
63431
+ continue;
63432
+ }
63188
63433
 
63189
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < 50) continue;
63190
-
63191
- let domainid_index = domainidpairArray[i].split(',');
63192
- let domainid = domainid_index[0];
63193
- domainid.split('-')[0];
63434
+ //let domainid_index = domainidpairArray[i].split(',');
63435
+ //let domainid = domainid_index[0];
63436
+ let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
63437
+ let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
63438
+ //let chainid = domainid.split('-')[0];
63194
63439
 
63195
63440
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
63196
63441
  // Ig domain may require G (7050). But we'll leave that out for now.
@@ -63219,22 +63464,81 @@ class Dssp {
63219
63464
  if(!(bBstrand && bCstrand && bEstrand && bFstrand)) continue;
63220
63465
 
63221
63466
  if(!domainid2score.hasOwnProperty(domainid) || queryData[0].score > domainid2score[domainid]) {
63222
- domainid2score[domainid] = queryData[0].score;
63223
- if(!me.bNode) console.log(domainid + ' TM-score: ' + domainid2score[domainid] + ' matched ' + ic.refpdbArray[domainid_index[1]]);
63467
+ domainid2score[domainid] = queryData[0].score;
63224
63468
 
63225
- //ic.chainid2index[chainid] = domainid_index[1]; // could be several, just take the recent one for simplicity
63226
- ic.domainid2index[domainid] = domainid_index[1];
63469
+ ic.domainid2refpdbname[domainid] = refpdbname;
63227
63470
  domainid2segs[domainid] = queryData[0].segs;
63228
63471
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
63229
63472
  ic.domainid2ig2imgt[domainid] = queryData[0].ig2imgt;
63230
63473
  }
63231
63474
  }
63232
63475
 
63476
+ if(bRound1) {
63477
+ if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
63478
+
63479
+ // start round2
63480
+ let ajaxArray = [];
63481
+ let domainidpairArray3 = [];
63482
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
63483
+ for(let domainid in ic.domainid2refpdbname) {
63484
+ let pdbAjaxArray = [];
63485
+ let refpdbname = ic.domainid2refpdbname[domainid];
63486
+ let pdbid = domainid.substr(0, domainid.indexOf('_'));
63487
+
63488
+ if(ic.refpdbHash.hasOwnProperty(pdbid)) {
63489
+ // use itself as the ref structure
63490
+ refpdbname = pdbid;
63491
+
63492
+ if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
63493
+ }
63494
+
63495
+ if(!ic.refpdbHash[refpdbname]) {
63496
+ console.log("### refpdbname: " + refpdbname);
63497
+ continue;
63498
+ }
63499
+
63500
+ for(let k = 0, kl = ic.refpdbHash[refpdbname].length; k < kl; ++k) {
63501
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbHash[refpdbname][k];
63502
+
63503
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
63504
+
63505
+ pdbAjaxArray.push(pdbAjax);
63506
+ }
63507
+
63508
+ let allPromise2 = Promise.allSettled(pdbAjaxArray);
63509
+ ic.pdbDataArray = await allPromise2;
63510
+
63511
+ let pdb_target = ic.domainid2pdb[domainid];
63512
+ for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
63513
+ let struct2 = ic.defaultPdbId + index;
63514
+ let pdb_query = ic.pdbDataArray[index].value; //[0];
63515
+ let header = 'HEADER ' + struct2 + '\n';
63516
+ pdb_query = header + pdb_query;
63517
+
63518
+ let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbHash[refpdbname][index]};
63519
+ let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
63520
+ ajaxArray.push(alignAjax);
63521
+
63522
+ //domainidpairArray3.push(domainid + "," + refpdbname);
63523
+ domainidpairArray3.push(domainid + "|" + ic.refpdbHash[refpdbname][index]);
63524
+ }
63525
+ }
63526
+
63527
+ let dataArray3 = [];
63528
+ let allPromise = Promise.allSettled(ajaxArray);
63529
+ dataArray3 = await allPromise;
63530
+
63531
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3);
63532
+
63533
+ // end of round 2
63534
+ return;
63535
+ }
63536
+
63233
63537
  // combine domainid into chainid
63234
- for(let domainid in ic.domainid2index) {
63538
+ for(let domainid in ic.domainid2refpdbname) {
63235
63539
  let chainid = domainid.split('-')[0];
63236
- if(!ic.chainid2index.hasOwnProperty(chainid)) ic.chainid2index[chainid] = [];
63237
- ic.chainid2index[chainid].push(ic.domainid2index[domainid]);
63540
+ if(!ic.chainid2refpdbname.hasOwnProperty(chainid)) ic.chainid2refpdbname[chainid] = [];
63541
+ ic.chainid2refpdbname[chainid].push(ic.domainid2refpdbname[domainid]);
63238
63542
  }
63239
63543
 
63240
63544
  // combine domainid into chainid
@@ -63250,16 +63554,15 @@ if(!me.bNode) console.log(domainid + ' TM-score: ' + domainid2score[domainid] +
63250
63554
  if(!ic.chainsMapping) ic.chainsMapping = {};
63251
63555
  for(let chainid in chainid2segs) {
63252
63556
  let segArray = chainid2segs[chainid];
63253
- if(!me.bNode) {
63254
- let chainList = '';
63255
- for(let i = 0, il = ic.chainid2index[chainid].length; i < il; ++i) {
63256
- chainList += ic.refpdbArray[ic.chainid2index[chainid][i]] + " ";
63257
- }
63258
- console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
63259
- }
63557
+
63558
+ let chainList = '';
63559
+ for(let i = 0, il = ic.chainid2refpdbname[chainid].length; i < il; ++i) {
63560
+ chainList += ic.chainid2refpdbname[chainid][i] + " ";
63561
+ }
63562
+ if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
63260
63563
 
63261
63564
  let prevStrand;
63262
- let bCd19 = ic.chainid2index[chainid].length == 1 && ic.refpdbArray[ic.chainid2index[chainid][0]] == '6al5_cd19';
63565
+ let bCd19 = ic.chainid2refpdbname[chainid].length == 1 && ic.chainid2refpdbname[chainid][0] == 'CD19_6al5A_human_C2orV-n1';
63263
63566
  for(let i = 0, il = segArray.length; i < il; ++i) {
63264
63567
  let seg = segArray[i];
63265
63568
  let qStart = seg.q_start;
@@ -63429,6 +63732,10 @@ if(!me.bNode) {
63429
63732
  await ic.showAnnoCls.showAnnotations();
63430
63733
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
63431
63734
  }
63735
+
63736
+ rmStrandFromRefnumlabel(refnumLabel) {
63737
+ return refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
63738
+ }
63432
63739
  }
63433
63740
 
63434
63741
  /**
@@ -71411,7 +71718,7 @@ class iCn3DUI {
71411
71718
  //even when multiple iCn3D viewers are shown together.
71412
71719
  this.pre = this.cfg.divid + "_";
71413
71720
 
71414
- this.REVISION = '3.25.1';
71721
+ this.REVISION = '3.25.2';
71415
71722
 
71416
71723
  // In nodejs, iCn3D defines "window = {navigator: {}}"
71417
71724
  this.bNode = (Object.keys(window).length < 2) ? true : false;