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.js CHANGED
@@ -6235,19 +6235,19 @@ class ClickMenu {
6235
6235
  });
6236
6236
 
6237
6237
  me.myEventCls.onIds("#" + me.pre + "mn1_link_bind", "click", function(e) { let ic = me.icn3d; e.preventDefault();
6238
- url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_structure&from_uid=" + ic.inputid;
6238
+ let url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_structure&from_uid=" + ic.inputid;
6239
6239
  thisClass.setLogCmd("link to 3D protein structures bound to CID " + ic.inputid + ": " + url, false);
6240
6240
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
6241
6241
  window.open(url, urlTarget);
6242
6242
  });
6243
6243
 
6244
6244
  me.myEventCls.onIds("#" + me.pre + "mn1_link_vast", "click", function(e) { let ic = me.icn3d; e.preventDefault();
6245
- if(ic.inputid === undefined) {
6246
- url = "https://www.ncbi.nlm.nih.gov/pccompound?term=" + ic.molTitle;
6247
- thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
6245
+ let url;
6246
+ if(ic.inputid === undefined) {
6247
+ url = "https://www.ncbi.nlm.nih.gov/pccompound?term=" + ic.molTitle;
6248
+ thisClass.setLogCmd("link to compounds " + ic.molTitle + ": " + url, false);
6248
6249
  }
6249
6250
  else {
6250
- let url;
6251
6251
  if(me.cfg.cid !== undefined) {
6252
6252
  url = "https://www.ncbi.nlm.nih.gov/pccompound?LinkName=pccompound_pccompound_3d&from_uid=" + ic.inputid;
6253
6253
  thisClass.setLogCmd("link to compounds with structure similar to CID " + ic.inputid + ": " + url, false);
@@ -6271,8 +6271,8 @@ class ClickMenu {
6271
6271
  });
6272
6272
 
6273
6273
  me.myEventCls.onIds("#" + me.pre + "mn1_link_pubmed", "click", function(e) { let ic = me.icn3d; e.preventDefault();
6274
+ let url;
6274
6275
  if(ic.inputid === undefined) {
6275
- let url;
6276
6276
  url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.molTitle;
6277
6277
  thisClass.setLogCmd("link to literature about " + ic.molTitle + ": " + url, false);
6278
6278
  let urlTarget = (ic.structures && Object.keys(ic.structures).length > 0) ? '_blank' : '_self';
@@ -6280,7 +6280,6 @@ class ClickMenu {
6280
6280
  }
6281
6281
  else if(ic.pmid) {
6282
6282
  let idArray = ic.pmid.toString().split('_');
6283
- let url;
6284
6283
  if(idArray.length === 1) {
6285
6284
  url = "https://www.ncbi.nlm.nih.gov/pubmed/" + ic.pmid;
6286
6285
  thisClass.setLogCmd("link to PubMed ID " + ic.pmid + ": " + url, false);
@@ -6294,7 +6293,6 @@ class ClickMenu {
6294
6293
  }
6295
6294
  else if(isNaN(ic.inputid)) {
6296
6295
  let idArray = ic.inputid.toString().split('_');
6297
- let url;
6298
6296
  if(idArray.length === 1) {
6299
6297
  url = "https://www.ncbi.nlm.nih.gov/pubmed/?term=" + ic.inputid;
6300
6298
  thisClass.setLogCmd("link to literature about PDB " + ic.inputid + ": " + url, false);
@@ -11008,11 +11006,11 @@ class SetDialog {
11008
11006
 
11009
11007
  html += "<div>4. " + me.htmlCls.buttonStr + "applyhbonds'>3D Display Interactions</button></div><br>";
11010
11008
 
11011
- 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>";
11009
+ 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>";
11012
11010
 
11013
- 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>";
11011
+ 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>";
11014
11012
 
11015
- html += "<div style='text-indent:1.1em'>" + me.htmlCls.buttonStr + "hbondScatterplot'>2D Interaction Map</button> to show interactions as map</div><br>";
11013
+ 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>";
11016
11014
 
11017
11015
  tmpStr = ': </td><td><input style="margin-left:-12px" type="text" id="';
11018
11016
 
@@ -11780,7 +11778,7 @@ class Events {
11780
11778
  async searchSeq() { let me = this.icn3dui, ic = me.icn3d, thisClass = this;
11781
11779
  let select = $("#" + me.pre + "search_seq").val();
11782
11780
  if(isNaN(select) && select.indexOf('$') == -1 && select.indexOf('.') == -1 && select.indexOf(':') == -1
11783
- && select.indexOf('%') == -1 && select.indexOf('@') == -1) {
11781
+ && select.indexOf('@') == -1) {
11784
11782
  select = ':' + select;
11785
11783
  }
11786
11784
  let commandname = select.replace(/\s+/g, '_');
@@ -13425,11 +13423,29 @@ class Events {
13425
13423
  me.myEventCls.onIds("#" + me.pre + "hbondLineGraph", "click", async function(e) { let ic = me.icn3d;
13426
13424
  e.preventDefault();
13427
13425
 
13426
+ ic.bShownRefnum = false;
13427
+ thisClass.setLogCmd("hide ref number", true);
13428
13428
  await ic.showInterCls.showInteractions('linegraph');
13429
13429
  });
13430
+ me.myEventCls.onIds("#" + me.pre + "hbondLineGraph2", "click", async function(e) { let ic = me.icn3d;
13431
+ e.preventDefault();
13432
+
13433
+ ic.bShownRefnum = true;
13434
+ thisClass.setLogCmd("show ref number", true);
13435
+ await ic.showInterCls.showInteractions('linegraph');
13436
+ });
13430
13437
  me.myEventCls.onIds("#" + me.pre + "hbondScatterplot", "click", async function(e) { let ic = me.icn3d;
13438
+ e.preventDefault();
13439
+
13440
+ ic.bShownRefnum = false;
13441
+ thisClass.setLogCmd("hide ref number", true);
13442
+ await ic.showInterCls.showInteractions('scatterplot');
13443
+ });
13444
+ me.myEventCls.onIds("#" + me.pre + "hbondScatterplot2", "click", async function(e) { let ic = me.icn3d;
13431
13445
  e.preventDefault();
13432
13446
 
13447
+ ic.bShownRefnum = true;
13448
+ thisClass.setLogCmd("show ref number", true);
13433
13449
  await ic.showInterCls.showInteractions('scatterplot');
13434
13450
  });
13435
13451
  // select residues
@@ -14216,6 +14232,22 @@ class Events {
14216
14232
  thisClass.setLogCmd('define coil sets | chain ' + chainid, true);
14217
14233
  });
14218
14234
 
14235
+ $(document).on("click", ".icn3d-igstrandsets", function(e) { let ic = me.icn3d;
14236
+ e.stopImmediatePropagation();
14237
+ //e.preventDefault();
14238
+ let chainid = $(this).attr('chainid');
14239
+ ic.addTrackCls.defineIgstrand(chainid, 'igstrand');
14240
+ thisClass.setLogCmd('define igstrand sets | chain ' + chainid, true);
14241
+ });
14242
+
14243
+ $(document).on("click", ".icn3d-igloopsets", function(e) { let ic = me.icn3d;
14244
+ e.stopImmediatePropagation();
14245
+ //e.preventDefault();
14246
+ let chainid = $(this).attr('chainid');
14247
+ ic.addTrackCls.defineIgstrand(chainid, 'igloop');
14248
+ thisClass.setLogCmd('define igloop sets | chain ' + chainid, true);
14249
+ });
14250
+
14219
14251
  me.myEventCls.onIds("#" + me.pre + "deletesets", "click", function(e) { let ic = me.icn3d;
14220
14252
  ic.definedSetsCls.deleteSelectedSets();
14221
14253
  thisClass.setLogCmd("delete selected sets", true);
@@ -34687,7 +34719,7 @@ class SetColor {
34687
34719
  // color = me.parasCls.thr(me.htmlCls.GREYB);
34688
34720
  // }
34689
34721
  // else {
34690
- let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
34722
+ let refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
34691
34723
  let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
34692
34724
  color = ic.showSeqCls.getRefnumColor(currStrand);
34693
34725
 
@@ -34723,7 +34755,7 @@ class SetColor {
34723
34755
  color = me.parasCls.thr(me.htmlCls.GREYB);
34724
34756
  }
34725
34757
  else {
34726
- let refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
34758
+ let refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
34727
34759
  let currStrand = refnumLabel.replace(new RegExp(refnumStr,'g'), '');
34728
34760
  color = ic.showSeqCls.getProtodomainColor(currStrand);
34729
34761
 
@@ -39851,7 +39883,7 @@ class AddTrack {
39851
39883
  ++helixCnt;
39852
39884
 
39853
39885
  if(Object.keys(selectedResidues).length > 0) {
39854
- setName = currName + 'H' + helixCnt + ')';
39886
+ setName = currName + 'H' + helixCnt.toString().padStart(2, '0') + ')';
39855
39887
  if(type == 'coil') {
39856
39888
  ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
39857
39889
  if(!bUnion) bUnion = true;
@@ -39862,13 +39894,13 @@ class AddTrack {
39862
39894
 
39863
39895
  //zero =(index < 10) ? '0' : '';
39864
39896
  //currName = chainid + zero + index + '_H' + helixCnt;
39865
- currName = chainid + '_H' + helixCnt;
39897
+ currName = chainid + '_H' + helixCnt.toString().padStart(2, '0');
39866
39898
  selectedResidues[residueid] = 1;
39867
39899
 
39868
39900
  if(atom.ssend) {
39869
39901
  //zero =(index < 9) ? '0' : '';
39870
39902
  //prevName = chainid + zero +(index+1) + '_L(H' + helixCnt;
39871
- prevName = chainid + '_C(H' + helixCnt;
39903
+ prevName = chainid + '_C(H' + helixCnt.toString().padStart(2, '0');
39872
39904
  if(type == 'helix') {
39873
39905
  ic.selectionCls.selectResidueList(selectedResidues, currName, currName, bUnion, bUpdateHighlight);
39874
39906
  if(!bUnion) bUnion = true;
@@ -39881,7 +39913,7 @@ class AddTrack {
39881
39913
  ++sheetCnt;
39882
39914
 
39883
39915
  if(Object.keys(selectedResidues).length > 0) {
39884
- setName = currName + 'S' + sheetCnt + ')';
39916
+ setName = currName + 'S' + sheetCnt.toString().padStart(2, '0') + ')';
39885
39917
  if(type == 'coil') {
39886
39918
  ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
39887
39919
  if(!bUnion) bUnion = true;
@@ -39892,13 +39924,13 @@ class AddTrack {
39892
39924
 
39893
39925
  //zero =(index < 10) ? '0' : '';
39894
39926
  //currName = chainid + zero + index + '_S' + sheetCnt;
39895
- currName = chainid + '_S' + sheetCnt;
39927
+ currName = chainid + '_S' + sheetCnt.toString().padStart(2, '0');
39896
39928
  selectedResidues[residueid] = 1;
39897
39929
 
39898
39930
  if(atom.ssend) {
39899
39931
  //zero =(index < 9) ? '0' : '';
39900
39932
  //prevName = chainid + zero +(index+1) + '_L(S' + sheetCnt;
39901
- prevName = chainid + '_C(S' + sheetCnt;
39933
+ prevName = chainid + '_C(S' + sheetCnt.toString().padStart(2, '0');
39902
39934
  if(type == 'sheet') {
39903
39935
  ic.selectionCls.selectResidueList(selectedResidues, currName, currName, bUnion, bUpdateHighlight);
39904
39936
  if(!bUnion) bUnion = true;
@@ -39921,6 +39953,90 @@ class AddTrack {
39921
39953
  }
39922
39954
  }
39923
39955
 
39956
+ // type: igstrand, igloop
39957
+ defineIgstrand(chainid, type) { let ic = this.icn3d, me = ic.icn3dui;
39958
+ if(!$('#' + ic.pre + 'dl_definedsets').hasClass('ui-dialog-content') || !$('#' + ic.pre + 'dl_definedsets').dialog( 'isOpen' )) {
39959
+ me.htmlCls.dialogCls.openDlg('dl_definedsets', 'Select sets');
39960
+ $("#" + ic.pre + "atomsCustom").resizable();
39961
+ }
39962
+
39963
+ let selectedResidues = {};
39964
+ let bUnion = false, bUpdateHighlight = true;
39965
+
39966
+ let strandCnt = 0, loopCnt = 0;
39967
+ let setName, currStrand, prevStrand, prevStrandReal, currType, prevType;
39968
+
39969
+ // clear selection
39970
+ ic.hAtoms = {};
39971
+
39972
+ let bStart = false;
39973
+
39974
+ for(let i = 0, il = ic.chainsSeq[chainid].length; i < il; ++i) {
39975
+ let currResi = ic.chainsSeq[chainid][i].resi;
39976
+ let resid = chainid + '_' + currResi;
39977
+
39978
+ if(!ic.residues.hasOwnProperty(resid) ) continue;
39979
+
39980
+ let refnumLabel, refnumStr;
39981
+ refnumLabel = ic.resid2refnum[resid];
39982
+ if(!refnumLabel) continue;
39983
+
39984
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
39985
+ currStrand = refnumLabel.replace(refnumStr, '');
39986
+
39987
+ if(ic.residIgLoop.hasOwnProperty(resid)) {
39988
+ currType = 'igloop';
39989
+ }
39990
+ else {
39991
+ currType = 'igstrand';
39992
+ }
39993
+
39994
+ if(bStart && currType != prevType && Object.keys(selectedResidues).length > 0) {
39995
+ if(prevType == 'igstrand') {
39996
+ ++strandCnt;
39997
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
39998
+ setName = setName.replace(/'/g, '`');
39999
+ if(type == 'igstrand') {
40000
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40001
+ if(!bUnion) bUnion = true;
40002
+ }
40003
+ prevStrandReal = prevStrand;
40004
+ }
40005
+ else if(prevType == 'igloop') {
40006
+ ++loopCnt;
40007
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40008
+ setName = setName.replace(/'/g, '`');
40009
+ if(type == 'igloop') {
40010
+ ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40011
+ if(!bUnion) bUnion = true;
40012
+ }
40013
+ }
40014
+
40015
+ selectedResidues = {};
40016
+ }
40017
+
40018
+ selectedResidues[resid] = 1;
40019
+
40020
+ prevStrand = currStrand;
40021
+ prevType = currType;
40022
+
40023
+ bStart = true;
40024
+ } // for loop
40025
+
40026
+ if(prevType == 'igstrand') {
40027
+ ++strandCnt;
40028
+ setName = 'Strand-' + prevStrand + '-' + chainid + '-' + strandCnt.toString().padStart(3, '0');
40029
+ setName = setName.replace(/'/g, '`');
40030
+ if(type == 'igstrand') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40031
+ }
40032
+ else if(prevType == 'igloop') {
40033
+ ++loopCnt;
40034
+ setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40035
+ setName = setName.replace(/'/g, '`');
40036
+ if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
40037
+ }
40038
+ }
40039
+
39924
40040
  simplifyText(text) { let ic = this.icn3d; ic.icn3dui;
39925
40041
  let out = ''; // 1-based text positions
39926
40042
  let bFoundText = false;
@@ -40930,6 +41046,11 @@ class ShowAnno {
40930
41046
  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;"
40931
41047
  + 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;"
40932
41048
  + 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);
41049
+
41050
+ if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid)) {
41051
+ 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;"
41052
+ + 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);
41053
+ }
40933
41054
  $("#" + ic.pre + "dl_annotations").append(chainHtml);
40934
41055
  //let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'domain', 'site', 'ptm', 'interaction', 'custom', 'ssbond', 'crosslink', 'transmem'];
40935
41056
  let itemArray = ['giseq', 'cdd', 'clinvar', 'snp', 'site', 'ptm', 'ssbond', 'crosslink', 'transmem', 'domain', 'custom', 'interaction'];
@@ -40988,7 +41109,7 @@ class ShowAnno {
40988
41109
  }
40989
41110
  catch(err) {
40990
41111
  thisClass.enableHlSeq();
40991
- if(!me.bNode) console.log( "No data were found for the protein " + chnidBaseArray + "..." );
41112
+ if(!me.bNode) console.log( "No sequence data were found for the protein " + chnidBaseArray + "..." );
40992
41113
  for(let chnid in ic.protein_chainid) {
40993
41114
  let chnidBase = ic.protein_chainid[chnid];
40994
41115
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
@@ -41114,7 +41235,7 @@ class ShowAnno {
41114
41235
  }
41115
41236
  }
41116
41237
  else {
41117
- if(!me.bNode) console.log( "No data were found for the chain " + chnid + "..." );
41238
+ if(!me.bNode) console.log( "No sequence data were found for the chain " + chnid + "..." );
41118
41239
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
41119
41240
  }
41120
41241
 
@@ -41823,7 +41944,7 @@ class ShowSeq {
41823
41944
  html += '</div>';
41824
41945
  html3 += '</div></div>';
41825
41946
  }
41826
- else if(ic.bShowRefnum && ic.chainid2index.hasOwnProperty(chnid)) {
41947
+ else if(ic.bShowRefnum && ic.chainid2refpdbname.hasOwnProperty(chnid)) {
41827
41948
  let result = this.showRefNum(giSeq, chnid);
41828
41949
  html += result.html;
41829
41950
  html3 += result.html3;
@@ -41866,10 +41987,10 @@ class ShowSeq {
41866
41987
  let html = '', html3 = '';
41867
41988
 
41868
41989
  let chainList = '';
41869
- if(!ic.chainid2index[chnid]) return {html: html, html3: html3};
41990
+ if(!ic.chainid2refpdbname[chnid]) return {html: html, html3: html3};
41870
41991
 
41871
- for(let i = 0, il = ic.chainid2index[chnid].length; i < il; ++i) {
41872
- chainList += ic.refpdbArray[ic.chainid2index[chnid][i]] + " ";
41992
+ for(let i = 0, il = ic.chainid2refpdbname[chnid].length; i < il; ++i) {
41993
+ chainList += ic.chainid2refpdbname[chnid][i] + " ";
41873
41994
  }
41874
41995
 
41875
41996
  let refStruTitle = (chainList) ? "based on " + chainList : "";
@@ -41930,13 +42051,23 @@ class ShowSeq {
41930
42051
 
41931
42052
  // sometimes one chain may have several Ig domains,set an index for each IgDomain
41932
42053
  let index = 1, bStart = false;
41933
-
42054
+
42055
+ if(!bCustom && !kabat_or_imgt) {
42056
+ // reset ic.residIgLoop for the current selection, which could be the second round of ref num assignment
42057
+ let residHash = ic.firstAtomObjCls.getResiduesFromAtoms(ic.hAtoms);
42058
+ for(let resid in residHash) {
42059
+ // not in loop any more if you assign ref numbers multiple times
42060
+ delete ic.residIgLoop[resid];
42061
+ }
42062
+ }
42063
+
41934
42064
  // 1. get the range of each strand excluding loops
41935
42065
  let strandArray = [], strandHash = {}, strandCnt = 0, resCnt = 0, resCntBfAnchor = 0, resCntAtAnchor = 0;
41936
42066
  if(!bCustom && !kabat_or_imgt) {
41937
42067
  for(let i = 0, il = giSeq.length; i < il; ++i, ++resCnt, ++resCntBfAnchor, ++resCntAtAnchor) {
41938
42068
  let currResi = ic.ParserUtilsCls.getResi(chnid, i);
41939
42069
  let residueid = chnid + '_' + currResi;
42070
+
41940
42071
  refnumLabel = ic.resid2refnum[residueid];
41941
42072
 
41942
42073
  let firstChar = (refnumLabel) ? refnumLabel.substr(0,1) : ' ';
@@ -41950,7 +42081,7 @@ class ShowSeq {
41950
42081
  }
41951
42082
 
41952
42083
  if(refnumLabel) {
41953
- refnumStr_ori = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
42084
+ refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
41954
42085
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
41955
42086
  refnumStr_ori.substr(0, 1);
41956
42087
 
@@ -42058,7 +42189,7 @@ class ShowSeq {
42058
42189
  currStrand = strandArray[strandCnt].strand;
42059
42190
 
42060
42191
  if(refnumLabel) {
42061
- refnumStr = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
42192
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42062
42193
  currRefnum = parseInt(refnumStr);
42063
42194
  refnumLabelNoPostfix = currStrand + currRefnum;
42064
42195
 
@@ -42140,7 +42271,7 @@ class ShowSeq {
42140
42271
  }
42141
42272
  else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
42142
42273
  // not in loop any more if you assign ref numbers multiple times
42143
- delete ic.residIgLoop[residueid];
42274
+ //delete ic.residIgLoop[residueid];
42144
42275
 
42145
42276
  bBeforeAstrand = false;
42146
42277
 
@@ -42230,7 +42361,7 @@ class ShowSeq {
42230
42361
  let bHidelabel = false;
42231
42362
 
42232
42363
  if(refnumLabel) {
42233
- refnumStr_ori = refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
42364
+ refnumStr_ori = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42234
42365
  currStrand = refnumLabel.replace(new RegExp(refnumStr_ori,'g'), '');
42235
42366
  currStrand_ori = currStrand;
42236
42367
 
@@ -44186,6 +44317,11 @@ class GetGraph {
44186
44317
  if(!bVertical) adjusty += 4 * r;
44187
44318
  }
44188
44319
 
44320
+ // show reference numbers
44321
+ if(ic.bShownRefnum && ic.resid2refnum[resid]) {
44322
+ nodeName = ic.resid2refnum[resid];
44323
+ }
44324
+
44189
44325
  let strokecolor = '#000';
44190
44326
  let strokewidth = '1';
44191
44327
  let textcolor = '#000';
@@ -53828,7 +53964,9 @@ class SetSeqAlign {
53828
53964
  if(!ic.chainsMapping[chainid2]) ic.chainsMapping[chainid2] = {};
53829
53965
 
53830
53966
  let posChain1 = {}, posChain2 = {};
53831
-
53967
+ console.log("###bRealign: " + bRealign);
53968
+ console.log(ic.qt_start_end[chainIndex]);
53969
+
53832
53970
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
53833
53971
  let start1, start2, end1, end2;
53834
53972
  if(bRealign) { // real residue numbers are stored, could be "100a"
@@ -53943,10 +54081,14 @@ class SetSeqAlign {
53943
54081
 
53944
54082
  let resi1, resi2, resn1, resn2;
53945
54083
  if(bRealign) { // tmalign: just one residue in this for loop
53946
- // resi1 = j + start1;
53947
- // resi2 = j + start2;
53948
- resi1 = ic.qt_start_end[chainIndex][i].t_start;
53949
- resi2 = ic.qt_start_end[chainIndex][i].q_start;
54084
+ if(me.cfg.aligntool == 'tmalign') {
54085
+ resi1 = ic.qt_start_end[chainIndex][i].t_start;
54086
+ resi2 = ic.qt_start_end[chainIndex][i].q_start;
54087
+ }
54088
+ else {
54089
+ resi1 = j + start1;
54090
+ resi2 = j + start2;
54091
+ }
53950
54092
 
53951
54093
  resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
53952
54094
  resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
@@ -54223,7 +54365,12 @@ class SetSeqAlign {
54223
54365
  resObject.mmdbid = chainid.substr(0, pos);
54224
54366
  resObject.chain = chainid.substr(pos+1);
54225
54367
  resObject.resi = (bGap) ? '' : resi; // resi will be empty if there is no coordinates
54226
- resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
54368
+ if(!resn) {
54369
+ resObject.resn = '-';
54370
+ }
54371
+ else {
54372
+ resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
54373
+ }
54227
54374
  resObject.aligned = (bGap) ? false : bAligned;
54228
54375
  resObject.color = (bGap || !bAligned) ? me.htmlCls.GREYC : ((resn == resn_t) ? "#FF0000" : "#0000FF"); // color by identity
54229
54376
  resObject.color2 = (bGap || !bAligned) ? me.htmlCls.GREYC : '#' + ic.showAnnoCls.getColorhexFromBlosum62(resn, resn_t); // color by conservation
@@ -56926,6 +57073,18 @@ class ApplyCommand {
56926
57073
 
56927
57074
  ic.addTrackCls.defineSecondary(chainid, 'coil');
56928
57075
  }
57076
+ else if(commandOri.indexOf('define igstrand sets') == 0) {
57077
+ let chainStr = commandOri.split(' | ')[1];
57078
+ let chainid = chainStr.split(' ')[1];
57079
+
57080
+ ic.addTrackCls.defineIgstrand(chainid, 'igstrand');
57081
+ }
57082
+ else if(commandOri.indexOf('define igloop sets') == 0) {
57083
+ let chainStr = commandOri.split(' | ')[1];
57084
+ let chainid = chainStr.split(' ')[1];
57085
+
57086
+ ic.addTrackCls.defineIgstrand(chainid, 'igloop');
57087
+ }
56929
57088
  else if(commandOri.indexOf('select interaction') == 0) {
56930
57089
  let idArray = commandOri.substr(commandOri.lastIndexOf(' ') + 1).split(',');
56931
57090
  if(idArray !== null) {
@@ -57692,6 +57851,12 @@ class ApplyCommand {
57692
57851
  let dataStr = paraArray[1].replace(/\\n/g, '\n');
57693
57852
  await ic.refnumCls.parseCustomRefFile(dataStr);
57694
57853
  }
57854
+ else if(command.indexOf('show ref number') == 0) {
57855
+ ic.bShownRefnum = true;
57856
+ }
57857
+ else if(command.indexOf('hide ref number') == 0) {
57858
+ ic.bShownRefnum = false;
57859
+ }
57695
57860
 
57696
57861
  // special, select ==========
57697
57862
 
@@ -59726,6 +59891,7 @@ class SelectByCommand {
59726
59891
  // $1,2,3: Structure
59727
59892
  // .A,B,C: chain
59728
59893
  // :5-10,K,chemicals: residues, could be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
59894
+ // :ref_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
59729
59895
  // @CA,C,C*: atoms
59730
59896
  // wild card * can be used to select all
59731
59897
  //var currHighlightAtoms = {}
@@ -59733,7 +59899,7 @@ class SelectByCommand {
59733
59899
  let dollarPos = commandArray[i].indexOf('$');
59734
59900
  let periodPos = commandArray[i].indexOf('.');
59735
59901
  let colonPos = commandArray[i].indexOf(':');
59736
- let colonPos2 = commandArray[i].indexOf('%'); // for reference numbers
59902
+ let colonPos2 = commandArray[i].indexOf(':ref_'); // for reference numbers
59737
59903
  let atPos = commandArray[i].indexOf('@');
59738
59904
 
59739
59905
  let moleculeStr, chainStr, residueStr, refResStr, atomStrArray;
@@ -59750,14 +59916,14 @@ class SelectByCommand {
59750
59916
  if(colonPos === -1 && colonPos2 === -1 ) {
59751
59917
  residueStr = "*";
59752
59918
  }
59919
+ else if(colonPos2 != -1) {
59920
+ refResStr = testStr.substr(colonPos2 + 5);
59921
+ testStr = testStr.substr(0, colonPos2);
59922
+ }
59753
59923
  else if(colonPos != -1) {
59754
59924
  residueStr = testStr.substr(colonPos + 1);
59755
59925
  testStr = testStr.substr(0, colonPos);
59756
59926
  }
59757
- else if(colonPos2 != -1) {
59758
- refResStr = testStr.substr(colonPos2 + 1);
59759
- testStr = testStr.substr(0, colonPos2);
59760
- }
59761
59927
 
59762
59928
  if(periodPos === -1) {
59763
59929
  chainStr = "*";
@@ -59851,7 +60017,9 @@ class SelectByCommand {
59851
60017
  else if(residueStrArray[j] === '*') { // all resiues
59852
60018
  bAllResidues = true;
59853
60019
  }
59854
- else if(residueStrArray[j] !== 'proteins' && residueStrArray[j] !== 'nucleotides' && residueStrArray[j] !== 'chemicals' && residueStrArray[j] !== 'ions' && residueStrArray[j] !== 'water') { // residue name
60020
+ else if(residueStrArray[j] !== 'proteins' && residueStrArray[j] !== 'nucleotides'
60021
+ && residueStrArray[j] !== 'chemicals' && residueStrArray[j] !== 'ions' && residueStrArray[j] !== 'water'
60022
+ && residueStrArray[j] !== 'anchors' && residueStrArray[j] !== 'strands' && residueStrArray[j] !== 'loops') { // residue name
59855
60023
  let tmpStr = residueStrArray[j].toUpperCase();
59856
60024
  //oneLetterResidue =(residueStrArray[j].length === 1) ? tmpStr : me.utilsCls.residueName2Abbr(tmpStr);
59857
60025
  oneLetterResidueStr = tmpStr;
@@ -59920,6 +60088,16 @@ class SelectByCommand {
59920
60088
  for(let m in chainAtomHash) {
59921
60089
  // residue could also be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
59922
60090
  ic.atoms[m].resn.substr(0,3).toUpperCase();
60091
+ let resid = molecule_chain + '_' + ic.atoms[m].resi;
60092
+ let refnumLabel, refnumStr, refnum;
60093
+ if(bRefnum) {
60094
+ refnumLabel = ic.resid2refnum[resid];
60095
+ if(refnumLabel) {
60096
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
60097
+ refnum = parseInt(refnumStr);
60098
+ }
60099
+ }
60100
+
59923
60101
  if(bAllResidues
59924
60102
  //|| me.utilsCls.residueName2Abbr(tmpStr) === oneLetterResidue
59925
60103
  ||(residueStrArray[j] === 'proteins' && m in ic.proteins)
@@ -59927,32 +60105,23 @@ class SelectByCommand {
59927
60105
  ||(residueStrArray[j] === 'chemicals' && m in ic.chemicals)
59928
60106
  ||(residueStrArray[j] === 'ions' && m in ic.ions)
59929
60107
  ||(residueStrArray[j] === 'water' && m in ic.water)
60108
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'anchors' && refnum % 100 == 50)
60109
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'strands' && !ic.residIgLoop.hasOwnProperty(resid))
60110
+ ||(bRefnum && refnumLabel && residueStrArray[j] === 'loops' && ic.residIgLoop.hasOwnProperty(resid))
59930
60111
  ) {
59931
60112
  // many duplicates
59932
60113
  if(i === 0) {
59933
- residueHash[molecule_chain + '_' + ic.atoms[m].resi] = 1;
60114
+ residueHash[resid] = 1;
59934
60115
  }
59935
60116
  else {
59936
- let residTmp = molecule_chain + '_' + ic.atoms[m].resi;
59937
- //if(!residueHash.hasOwnProperty(residTmp)) residueHash[residTmp] = undefined;
59938
- if(!residueHash.hasOwnProperty(residTmp)) delete residueHash[residTmp];
60117
+ if(!residueHash.hasOwnProperty(resid)) delete residueHash[resid];
59939
60118
  }
59940
60119
 
59941
60120
  for(let n = 0, nl = atomStrArray.length; n < nl; ++n) {
59942
60121
  let atomStr = atomStrArray[n];
59943
60122
 
59944
60123
  atomHash = this.processAtomStr(atomStr, atomHash, i, m);
59945
-
59946
- // if(atomStr === '*' || atomStr === ic.atoms[m].name) {
59947
- // if(i === 0) {
59948
- // atomHash[m] = 1;
59949
- // }
59950
- // else {
59951
- // if(!atomHash.hasOwnProperty(m)) delete atomHash[m];
59952
- // }
59953
- // }
59954
60124
  }
59955
-
59956
60125
  }
59957
60126
  } // end for(let m in atomHash) {
59958
60127
 
@@ -62069,72 +62238,155 @@ class Dssp {
62069
62238
  async showIgRefNum() { let ic = this.icn3d, me = ic.icn3dui;
62070
62239
  let thisClass = this;
62071
62240
 
62072
- // if(ic.resid2refnum && Object.keys(ic.resid2refnum).length > 0) {
62073
- // ic.bShowRefnum = true;
62074
-
62075
- // // open sequence view
62076
- // ic.hAtomsRefnum = {};
62077
- // ic.bResetAnno = true;
62078
- // await ic.showAnnoCls.showAnnotations();
62079
- // ic.annotationCls.setAnnoViewAndDisplay('detailed view');
62241
+ // if(ic.pdbDataArray) {
62242
+ // await thisClass.parseRefPdbData(ic.pdbDataArray);
62080
62243
  // }
62081
- if(ic.pdbDataArray) {
62082
- await thisClass.parseRefPdbData(ic.pdbDataArray);
62083
- }
62084
- else {
62085
- //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'];
62086
-
62087
- //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'];
62088
-
62089
- //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'];
62090
-
62091
- //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'];
62092
-
62093
- 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'];
62094
-
62095
- if(ic.pdbDataArray) {
62096
- await thisClass.parseRefPdbData(ic.pdbDataArray);
62097
- }
62098
- else {
62099
-
62100
- let pdbAjaxArray = [];
62101
- for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
62102
- //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
62103
- let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
62244
+ // else {
62245
+ //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'];
62246
+
62247
+ //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'];
62248
+
62249
+ /*
62250
+ // round 1
62251
+ 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'];
62252
+ // round 2
62253
+ ic.refpdbHash = {};
62254
+
62255
+ 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'];
62256
+ 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'];
62257
+ 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'];
62258
+ 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'];
62259
+ 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'];
62260
+ 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'];
62261
+ 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'];
62262
+ ic.refpdbHash['CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62263
+ ic.refpdbHash['TP47_1o75A_bacteria'] = ['TP47_1o75A_bacteria', 'TEAD1_3kysC_human', 'RBPJ_6py8C_human_Unk-n2', 'CuZnSuperoxideDismutase_1hl5C_human', 'ASF1A_2iijA_human'];
62264
+ 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'];
62265
+ */
62266
+ /*
62267
+ // round 1
62268
+ 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'];
62269
+
62270
+ // round 2
62271
+ ic.refpdbHash = {};
62272
+ ic.refpdbHash['NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62273
+ ic.refpdbHash['C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1', 'BArrestin1_4jqiA_rat_n1'];
62274
+ ic.refpdbHash['Siglec3_5j0bB_human_C2-n2'] = ['Siglec3_5j0bB_human_C2-n2', 'CD2_1hnfA_human_C2-n2', 'GHR_1axiB_human_FN3-n1'];
62275
+ ic.refpdbHash['ICOS_6x4gA_human_V'] = ['ICOS_6x4gA_human_V', 'Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
62276
+ ic.refpdbHash['B2Microglobulin_7phrL_human_C1'] = ['B2Microglobulin_7phrL_human_C1', 'FAB-HEAVY_5esv_C1-n2', 'MHCIa_7phrH_human_C1'];
62277
+ ic.refpdbHash['VTCN1_Q7Z7D3_human_V-n2'] = ['VTCN1_Q7Z7D3_human_V-n2', 'FAB-LIGHT_5esv_C1-n2'];
62278
+ ic.refpdbHash['Contactin1_2ee2A_human_FN3-n9'] = ['Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n3', 'Sidekick2_1wf5A_human_FN3-n7'];
62279
+ ic.refpdbHash['InsulinR_8guyE_human_FN3-n1'] = ['InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n2'];
62280
+ ic.refpdbHash['JAM1_1nbqA_human_VorIset-n2'] = ['JAM1_1nbqA_human_VorIset-n2', 'Contactin1_3s97C_human_C2-n2'];
62281
+ ic.refpdbHash['LAG3_7tzgD_human_C2-n2'] = ['LAG3_7tzgD_human_C2-n2', 'BTLA_2aw2A_human_Iset'];
62282
+ ic.refpdbHash['Palladin_2dm3A_human_Iset-n1'] = ['Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152'];
62283
+ ic.refpdbHash['PD1_4zqkB_human_V'] = ['PD1_4zqkB_human_V', 'TCRa_6jxrm_human_V-n1', 'FAB-LIGHT_5esv_V-n1'];
62284
+ ic.refpdbHash['CD8a_1cd8A_human_V'] = ['CD8a_1cd8A_human_V', 'FAB-HEAVY_5esv_V-n1', 'VNAR_1t6vN_shark_V'];
62285
+ ic.refpdbHash['VISTA_6oilA_human_V'] = ['VISTA_6oilA_human_V', 'PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1'];
62286
+ ic.refpdbHash['LAG3_7tzgD_human_V-n1'] = ['LAG3_7tzgD_human_V-n1'];
62287
+ ic.refpdbHash['TP47_1o75A_bacteria'] = ['TP47_1o75A_bacteria'];
62288
+ ic.refpdbHash['TP34_2o6cA_bacteria'] = ['TP34_2o6cA_bacteria'];
62289
+ ic.refpdbHash['TEAD1_3kysC_human'] = ['TEAD1_3kysC_human', 'CuZnSuperoxideDismutase_1hl5C_human'];
62290
+ ic.refpdbHash['RBPJ_6py8C_human_Unk-n2'] = ['RBPJ_6py8C_human_Unk-n2', 'ASF1A_2iijA_human'];
62291
+ ic.refpdbHash['TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
62292
+ ic.refpdbHash['IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria', 'CoAtomerGamma1_1r4xA_human'];
62293
+ ic.refpdbHash['LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'MPT63_1lmiA_bacteria'];
62294
+ ic.refpdbHash['CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62295
+ */
62296
+ // round 1, 16 templates
62297
+ 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'];
62298
+
62299
+ // round 2
62300
+ ic.refpdbHash = {};
62301
+ 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'];
62302
+ ic.refpdbHash['1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'ICOS_6x4gA_human_V'];
62303
+ ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
62304
+ ic.refpdbHash['1C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'BArrestin1_4jqiA_rat_n1', 'RBPJ_6py8C_human_Unk-n1'];
62305
+ ic.refpdbHash['1CuZnSuperoxideDismutase_1hl5C_human'] = ['CuZnSuperoxideDismutase_1hl5C_human', 'TEAD1_3kysC_human'];
62306
+ ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human', 'MPT63_1lmiA_bacteria'];
62307
+ 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'];
62308
+ ic.refpdbHash['1CD2_1hnfA_human_C2-n2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2'];
62309
+ ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62310
+ 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'];
62311
+ ic.refpdbHash['1PDL1_4z18B_human_V-n1'] = ['PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1', 'LAG3_7tzgD_human_V-n1'];
62312
+ 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'];
62313
+ ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human'];
62314
+ ic.refpdbHash['1IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria'];
62315
+ ic.refpdbHash['1TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
62316
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62317
+
62318
+ // use known ref structure
62319
+ ic.refpdbHash['5ESV'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2', 'FAB-LIGHT_5esv_C1-n2'];
62320
+ ic.refpdbHash['8GUY'] = ['InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2'];
62321
+ ic.refpdbHash['6JXR'] = ['TCRa_6jxrm_human_V-n1', 'TCRa_6jxrm_human_C1-n2'];
62322
+ ic.refpdbHash['1HNF'] = ['CD2_1hnfA_human_V-n1', 'CD2_1hnfA_human_C2-n2'];
62323
+ ic.refpdbHash['7TZG'] = ['LAG3_7tzgD_human_V-n1', 'LAG3_7tzgD_human_C2-n2'];
62324
+ ic.refpdbHash['6PY8'] = ['RBPJ_6py8C_human_Unk-n1', 'RBPJ_6py8C_human_Unk-n2'];
62325
+ ic.refpdbHash['1BQU'] = ['IL6Rb_1bquB_human_FN3-n2', 'IL6Rb_1bquB_human_FN3-n3'];
62326
+
62327
+ ic.refpdbHash['1R4X'] = ['CoAtomerGamma1_1r4xA_human'];
62328
+ ic.refpdbHash['6OIL'] = ['VISTA_6oilA_human_V'];
62329
+ ic.refpdbHash['2ZXE'] = ['NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62330
+ ic.refpdbHash['1I8A'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
62331
+ ic.refpdbHash['2FWU'] = ['NaCaExchanger_2fwuA_dog_n2'];
62332
+ ic.refpdbHash['4JQI'] = ['BArrestin1_4jqiA_rat_n1'];
62333
+ ic.refpdbHash['1NBQ'] = ['JAM1_1nbqA_human_VorIset-n2'];
62334
+ ic.refpdbHash['1O75'] = ['TP47_1o75A_bacteria'];
62335
+ ic.refpdbHash['7PHR'] = ['MHCIa_7phrH_human_C1'];
62336
+ ic.refpdbHash['2IIJ'] = ['ASF1A_2iijA_human'];
62337
+ ic.refpdbHash['4Z18'] = ['PDL1_4z18B_human_V-n1'];
62338
+ ic.refpdbHash['1T6V'] = ['VNAR_1t6vN_shark_V'];
62339
+ ic.refpdbHash['2O6C'] = ['TP34_2o6cA_bacteria'];
62340
+ ic.refpdbHash['3KYS'] = ['TEAD1_3kysC_human'];
62341
+ ic.refpdbHash['7PHR'] = ['B2Microglobulin_7phrL_human_C1'];
62342
+ ic.refpdbHash['2AW2'] = ['BTLA_2aw2A_human_Iset'];
62343
+ ic.refpdbHash['1HL5'] = ['CuZnSuperoxideDismutase_1hl5C_human'];
62344
+ ic.refpdbHash['1WF5'] = ['Sidekick2_1wf5A_human_FN3-n7'];
62345
+ ic.refpdbHash['5J0B'] = ['Siglec3_5j0bB_human_C2-n2'];
62346
+ ic.refpdbHash['1IFR'] = ['LaminAC_1ifrA_human'];
62347
+ ic.refpdbHash['Q7Z7D3'] = ['VTCN1_Q7Z7D3_human_V-n2'];
62348
+ ic.refpdbHash['4ZQK'] = ['PD1_4zqkB_human_V'];
62349
+ ic.refpdbHash['2DM3'] = ['Palladin_2dm3A_human_Iset-n1'];
62350
+ ic.refpdbHash['2ITE'] = ['IsdA_2iteA_bacteria'];
62351
+ ic.refpdbHash['1XAK'] = ['ORF7a_1xakA_virus'];
62352
+ ic.refpdbHash['4ZT1'] = ['ECadherin_4zt1A_human_n2'];
62353
+ ic.refpdbHash['1LMI'] = ['MPT63_1lmiA_bacteria'];
62354
+ ic.refpdbHash['1CD8'] = ['CD8a_1cd8A_human_V'];
62355
+ ic.refpdbHash['3S97'] = ['Contactin1_3s97C_human_C2-n2'];
62356
+ ic.refpdbHash['1AXI'] = ['GHR_1axiB_human_FN3-n1'];
62357
+ ic.refpdbHash['6X4G'] = ['ICOS_6x4gA_human_V'];
62358
+ ic.refpdbHash['2EE2'] = ['Contactin1_2ee2A_human_FN3-n9'];
62359
+ ic.refpdbHash['4UOW'] = ['Titin_4uowM_human_Unk-n152'];
62360
+ ic.refpdbHash['6A15'] = ['CD19_6al5A_human_C2orV-n1'];
62361
+ ic.refpdbHash['2QKI'] = ['C3_2qkiD_human_n1'];
62362
+
62363
+ // if(ic.pdbDataArray) {
62364
+ // await thisClass.parseRefPdbData(ic.pdbDataArray);
62365
+ // }
62366
+ // else {
62104
62367
 
62105
- let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
62368
+ let pdbAjaxArray = [];
62369
+ for(let k = 0, kl = ic.refpdbArray.length; k < kl; ++k) {
62370
+ //let urlpdb = me.htmlCls.baseUrl + "icn3d/refpdb/" + ic.refpdbArray[k] + ".pdb";
62371
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbArray[k];
62106
62372
 
62107
- pdbAjaxArray.push(pdbAjax);
62108
- }
62373
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
62109
62374
 
62110
- // try {
62111
- // if(!me.bNode) {
62112
- let allPromise = Promise.allSettled(pdbAjaxArray);
62113
- ic.pdbDataArray = await allPromise;
62114
- await thisClass.parseRefPdbData(ic.pdbDataArray);
62115
- // }
62116
- // else {
62117
- // ic.pdbDataArray = [];
62118
- // for(let i = 0, il = pdbAjaxArray.length; i < il; ++i) {
62119
- // try {
62120
- // let dataTmp = await pdbAjaxArray[i];
62121
- // ic.pdbDataArray.push({'value': dataTmp});
62122
- // }
62123
- // catch(err) {
62124
- // ic.pdbDataArray.push({'value': ''});
62125
- // }
62126
- // }
62127
-
62128
- // await thisClass.parseRefPdbData(ic.pdbDataArray);
62129
- // }
62130
- // }
62131
- // catch(err) {
62132
- // if(!me.bNode) var aaa = 1; //alert("Error in retrieveing reference PDB data...");
62133
- // //var aaa = 1; //alert("Error in retrieveing reference PDB data...");
62134
- // return;
62135
- // }
62136
- }
62375
+ pdbAjaxArray.push(pdbAjax);
62137
62376
  }
62377
+
62378
+ // try {
62379
+ let allPromise = Promise.allSettled(pdbAjaxArray);
62380
+ ic.pdbDataArray = await allPromise;
62381
+ await thisClass.parseRefPdbData(ic.pdbDataArray);
62382
+ // }
62383
+ // catch(err) {
62384
+ // if(!me.bNode) var aaa = 1; //alert("Error in retrieveing reference PDB data...");
62385
+ // //var aaa = 1; //alert("Error in retrieveing reference PDB data...");
62386
+ // return;
62387
+ // }
62388
+ // }
62389
+ // }
62138
62390
  }
62139
62391
 
62140
62392
  async parseRefPdbData(dataArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -62149,6 +62401,9 @@ class Dssp {
62149
62401
 
62150
62402
  // if(!ic.resid2domainid) ic.resid2domainid = {};
62151
62403
  ic.resid2domainid = {};
62404
+ ic.domainid2pdb = {};
62405
+
62406
+ let minResidues = 20;
62152
62407
 
62153
62408
  for(let i = 0, il = struArray.length; i < il; ++i) {
62154
62409
  let struct = struArray[i];
@@ -62159,7 +62414,7 @@ class Dssp {
62159
62414
 
62160
62415
  if(!ic.proteins.hasOwnProperty(ic.firstAtomObjCls.getFirstAtomObj(ic.chains[chainid]).serial)
62161
62416
  && !ic.proteins.hasOwnProperty(ic.firstAtomObjCls.getMiddleAtomObj(ic.chains[chainid]).serial)) continue;
62162
- if(ic.chainsSeq[chainid].length < 50) continue; // peptide
62417
+ if(ic.chainsSeq[chainid].length < minResidues) continue; // peptide
62163
62418
 
62164
62419
  let currAtoms = me.hashUtilsCls.intHash(ic.chains[chainid], ic.hAtoms);
62165
62420
  if(Object.keys(currAtoms).length == 0) continue;
@@ -62176,11 +62431,6 @@ class Dssp {
62176
62431
  //domainAtomsArray.push(ic.chains[chainid]);
62177
62432
  domainAtomsArray.push(currAtoms);
62178
62433
 
62179
- // for(let n = 0, nl = ic.chainsSeq[chainid].length; n < nl; ++n) {
62180
- // let resid = chainid + '_' + ic.chainsSeq[chainid][n].resi;
62181
- // ic.resid2domainid[resid] = chainid + '-0';
62182
- // }
62183
-
62184
62434
  let residueArray = ic.resid2specCls.atoms2residues(Object.keys(currAtoms));
62185
62435
  for(let n = 0, nl = residueArray.length; n < nl; ++n) {
62186
62436
  let resid = residueArray[n];
@@ -62207,10 +62457,11 @@ class Dssp {
62207
62457
  domainAtomsArray.push(domainAtoms);
62208
62458
  }
62209
62459
  }
62210
-
62460
+ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.length: " + domainAtomsArray.length);
62211
62461
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
62212
62462
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
62213
62463
  let domainid = chainid + '-' + k;
62464
+ ic.domainid2pdb[domainid] = pdb_target;
62214
62465
 
62215
62466
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
62216
62467
  let struct2 = ic.defaultPdbId + index;
@@ -62222,31 +62473,19 @@ class Dssp {
62222
62473
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
62223
62474
  ajaxArray.push(alignAjax);
62224
62475
 
62225
- domainidpairArray.push(domainid + "," + index);
62476
+ domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
62226
62477
  }
62227
62478
  }
62228
62479
  }
62229
- }
62480
+ }
62230
62481
 
62231
62482
  // try {
62232
62483
  let dataArray2 = [];
62233
- // if(!me.bNode) {
62234
- let allPromise = Promise.allSettled(ajaxArray);
62235
- dataArray2 = await allPromise;
62236
- // }
62237
- // else {
62238
- // for(let i = 0, il = ajaxArray.length; i < il; ++i) {
62239
- // try {
62240
- // let dataTmp = await ajaxArray[i];
62241
- // dataArray2.push({'value': dataTmp});
62242
- // }
62243
- // catch(err) {
62244
- // dataArray2.push({'value': []});
62245
- // }
62246
- // }
62247
- // }
62248
-
62249
- await thisClass.parseAlignData(dataArray2, domainidpairArray);
62484
+ let allPromise = Promise.allSettled(ajaxArray);
62485
+ dataArray2 = await allPromise;
62486
+
62487
+ let bRound1 = true;
62488
+ await thisClass.parseAlignData(dataArray2, domainidpairArray, bRound1);
62250
62489
 
62251
62490
  /// if(ic.deferredRefnum !== undefined) ic.deferredRefnum.resolve();
62252
62491
  // }
@@ -62257,23 +62496,25 @@ class Dssp {
62257
62496
  // }
62258
62497
  }
62259
62498
 
62260
- async parseAlignData(dataArray, domainidpairArray) { let ic = this.icn3d, me = ic.icn3dui;
62499
+ async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
62261
62500
  let thisClass = this;
62262
62501
 
62263
- let tmscoreThreshold = 0.4; //0.5;
62502
+ let tmscoreThreshold = 0.4; // 0.4; //0.5;
62264
62503
 
62265
62504
  // find the best alignment for each chain
62266
62505
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
62267
62506
 
62268
- if(!ic.chainid2index) ic.chainid2index = {};
62269
- if(!ic.domainid2index) ic.domainid2index = {};
62270
- if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
62271
- if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
62507
+ // if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
62508
+ // if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
62509
+ // if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
62510
+ // if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
62272
62511
 
62273
- // ic.chainid2index = {};
62274
- // ic.domainid2index = {};
62275
- // ic.domainid2ig2kabat = {};
62276
- // ic.domainid2ig2imgt = {};
62512
+ ic.chainid2refpdbname = {};
62513
+ ic.domainid2refpdbname = {};
62514
+ ic.domainid2ig2kabat = {};
62515
+ ic.domainid2ig2imgt = {};
62516
+
62517
+ let minResidues = 20;
62277
62518
 
62278
62519
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
62279
62520
  let queryData = dataArray[i].value; //[0];
@@ -62284,12 +62525,16 @@ class Dssp {
62284
62525
  }
62285
62526
 
62286
62527
  if(queryData.length == 0) continue;
62528
+
62529
+ if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
62530
+ continue;
62531
+ }
62287
62532
 
62288
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < 50) continue;
62289
-
62290
- let domainid_index = domainidpairArray[i].split(',');
62291
- let domainid = domainid_index[0];
62292
- domainid.split('-')[0];
62533
+ //let domainid_index = domainidpairArray[i].split(',');
62534
+ //let domainid = domainid_index[0];
62535
+ let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
62536
+ let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
62537
+ //let chainid = domainid.split('-')[0];
62293
62538
 
62294
62539
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
62295
62540
  // Ig domain may require G (7050). But we'll leave that out for now.
@@ -62318,22 +62563,81 @@ class Dssp {
62318
62563
  if(!(bBstrand && bCstrand && bEstrand && bFstrand)) continue;
62319
62564
 
62320
62565
  if(!domainid2score.hasOwnProperty(domainid) || queryData[0].score > domainid2score[domainid]) {
62321
- domainid2score[domainid] = queryData[0].score;
62322
- if(!me.bNode) console.log(domainid + ' TM-score: ' + domainid2score[domainid] + ' matched ' + ic.refpdbArray[domainid_index[1]]);
62566
+ domainid2score[domainid] = queryData[0].score;
62323
62567
 
62324
- //ic.chainid2index[chainid] = domainid_index[1]; // could be several, just take the recent one for simplicity
62325
- ic.domainid2index[domainid] = domainid_index[1];
62568
+ ic.domainid2refpdbname[domainid] = refpdbname;
62326
62569
  domainid2segs[domainid] = queryData[0].segs;
62327
62570
  ic.domainid2ig2kabat[domainid] = queryData[0].ig2kabat;
62328
62571
  ic.domainid2ig2imgt[domainid] = queryData[0].ig2imgt;
62329
62572
  }
62330
62573
  }
62331
62574
 
62575
+ if(bRound1) {
62576
+ if(!me.bNode) console.log("Start round 2 alignment with the reference culsters " + JSON.stringify(ic.domainid2refpdbname));
62577
+
62578
+ // start round2
62579
+ let ajaxArray = [];
62580
+ let domainidpairArray3 = [];
62581
+ let urltmalign = me.htmlCls.baseUrl + "tmalign/tmalign.cgi";
62582
+ for(let domainid in ic.domainid2refpdbname) {
62583
+ let pdbAjaxArray = [];
62584
+ let refpdbname = ic.domainid2refpdbname[domainid];
62585
+ let pdbid = domainid.substr(0, domainid.indexOf('_'));
62586
+
62587
+ if(ic.refpdbHash.hasOwnProperty(pdbid)) {
62588
+ // use itself as the ref structure
62589
+ refpdbname = pdbid;
62590
+
62591
+ if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
62592
+ }
62593
+
62594
+ if(!ic.refpdbHash[refpdbname]) {
62595
+ console.log("### refpdbname: " + refpdbname);
62596
+ continue;
62597
+ }
62598
+
62599
+ for(let k = 0, kl = ic.refpdbHash[refpdbname].length; k < kl; ++k) {
62600
+ let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbHash[refpdbname][k];
62601
+
62602
+ let pdbAjax = me.getAjaxPromise(urlpdb, 'text');
62603
+
62604
+ pdbAjaxArray.push(pdbAjax);
62605
+ }
62606
+
62607
+ let allPromise2 = Promise.allSettled(pdbAjaxArray);
62608
+ ic.pdbDataArray = await allPromise2;
62609
+
62610
+ let pdb_target = ic.domainid2pdb[domainid];
62611
+ for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
62612
+ let struct2 = ic.defaultPdbId + index;
62613
+ let pdb_query = ic.pdbDataArray[index].value; //[0];
62614
+ let header = 'HEADER ' + struct2 + '\n';
62615
+ pdb_query = header + pdb_query;
62616
+
62617
+ let dataObj = {'pdb_query': pdb_query, 'pdb_target': pdb_target, "queryid": ic.refpdbHash[refpdbname][index]};
62618
+ let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
62619
+ ajaxArray.push(alignAjax);
62620
+
62621
+ //domainidpairArray3.push(domainid + "," + refpdbname);
62622
+ domainidpairArray3.push(domainid + "|" + ic.refpdbHash[refpdbname][index]);
62623
+ }
62624
+ }
62625
+
62626
+ let dataArray3 = [];
62627
+ let allPromise = Promise.allSettled(ajaxArray);
62628
+ dataArray3 = await allPromise;
62629
+
62630
+ await thisClass.parseAlignData(dataArray3, domainidpairArray3);
62631
+
62632
+ // end of round 2
62633
+ return;
62634
+ }
62635
+
62332
62636
  // combine domainid into chainid
62333
- for(let domainid in ic.domainid2index) {
62637
+ for(let domainid in ic.domainid2refpdbname) {
62334
62638
  let chainid = domainid.split('-')[0];
62335
- if(!ic.chainid2index.hasOwnProperty(chainid)) ic.chainid2index[chainid] = [];
62336
- ic.chainid2index[chainid].push(ic.domainid2index[domainid]);
62639
+ if(!ic.chainid2refpdbname.hasOwnProperty(chainid)) ic.chainid2refpdbname[chainid] = [];
62640
+ ic.chainid2refpdbname[chainid].push(ic.domainid2refpdbname[domainid]);
62337
62641
  }
62338
62642
 
62339
62643
  // combine domainid into chainid
@@ -62349,16 +62653,15 @@ if(!me.bNode) console.log(domainid + ' TM-score: ' + domainid2score[domainid] +
62349
62653
  if(!ic.chainsMapping) ic.chainsMapping = {};
62350
62654
  for(let chainid in chainid2segs) {
62351
62655
  let segArray = chainid2segs[chainid];
62352
- if(!me.bNode) {
62353
- let chainList = '';
62354
- for(let i = 0, il = ic.chainid2index[chainid].length; i < il; ++i) {
62355
- chainList += ic.refpdbArray[ic.chainid2index[chainid][i]] + " ";
62356
- }
62357
- console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
62358
- }
62656
+
62657
+ let chainList = '';
62658
+ for(let i = 0, il = ic.chainid2refpdbname[chainid].length; i < il; ++i) {
62659
+ chainList += ic.chainid2refpdbname[chainid][i] + " ";
62660
+ }
62661
+ if(!me.bNode) console.log("The reference PDB(s) for chain " + chainid + " are " + chainList);
62359
62662
 
62360
62663
  let prevStrand;
62361
- let bCd19 = ic.chainid2index[chainid].length == 1 && ic.refpdbArray[ic.chainid2index[chainid][0]] == '6al5_cd19';
62664
+ let bCd19 = ic.chainid2refpdbname[chainid].length == 1 && ic.chainid2refpdbname[chainid][0] == 'CD19_6al5A_human_C2orV-n1';
62362
62665
  for(let i = 0, il = segArray.length; i < il; ++i) {
62363
62666
  let seg = segArray[i];
62364
62667
  let qStart = seg.q_start;
@@ -62528,6 +62831,10 @@ if(!me.bNode) {
62528
62831
  await ic.showAnnoCls.showAnnotations();
62529
62832
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
62530
62833
  }
62834
+
62835
+ rmStrandFromRefnumlabel(refnumLabel) {
62836
+ return refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
62837
+ }
62531
62838
  }
62532
62839
 
62533
62840
  /**
@@ -70510,7 +70817,7 @@ class iCn3DUI {
70510
70817
  //even when multiple iCn3D viewers are shown together.
70511
70818
  this.pre = this.cfg.divid + "_";
70512
70819
 
70513
- this.REVISION = '3.25.1';
70820
+ this.REVISION = '3.25.2';
70514
70821
 
70515
70822
  // In nodejs, iCn3D defines "window = {navigator: {}}"
70516
70823
  this.bNode = (Object.keys(window).length < 2) ? true : false;