icn3d 3.25.12 → 3.25.14

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
 
@@ -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
@@ -32147,7 +32163,7 @@ class Alternate {
32147
32163
 
32148
32164
  ic.dAtoms = {};
32149
32165
 
32150
- let bMutation = moleculeArray.length == 2 && moleculeArray[1].replace(moleculeArray[0], '') == '2';
32166
+ let bMutation = ic.bScap; //moleculeArray.length == 2 && moleculeArray[1].replace(moleculeArray[0], '') == '2';
32151
32167
 
32152
32168
  for(let i = 0, il = moleculeArray.length; i < il; ++i) {
32153
32169
  let structure = moleculeArray[i];
@@ -35776,7 +35792,12 @@ class AnnoCddSite {
35776
35792
  || (Object.keys(ic.structures).length == 2 && me.cfg.align) ) {
35777
35793
  let data = {};
35778
35794
  try {
35779
- data.value = await me.getAjaxPromise(url, 'jsonp');
35795
+ if(me.bNode) {
35796
+ data = await me.getAjaxPromise(url, 'jsonp');
35797
+ }
35798
+ else {
35799
+ data.value = await me.getAjaxPromise(url, 'jsonp');
35800
+ }
35780
35801
 
35781
35802
  thisClass.parseCddData([data], chnidArray);
35782
35803
  /// if(ic.deferredAnnoCddSite !== undefined) ic.deferredAnnoCddSite.resolve();
@@ -35834,7 +35855,9 @@ class AnnoCddSite {
35834
35855
 
35835
35856
  for(let i = 0, il = dataArray.length; i < il; ++i) {
35836
35857
  //let data = (bSeq) ? dataArray[i][0] : dataArray[i];
35837
- let data = dataArray[i].value;
35858
+ let data = (me.bNode) ? dataArray[i] : dataArray[i].value;
35859
+
35860
+ if(!data) continue;
35838
35861
 
35839
35862
  for(let chainI = 0, chainLen = data.data.length; chainI < chainLen; ++chainI) {
35840
35863
  let cddData = data.data[chainI];
@@ -38576,49 +38599,48 @@ class Domain3d {
38576
38599
  let residueArray = Object.keys(residueHash);
38577
38600
  let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
38578
38601
 
38602
+ if(!ic.posid2resid) ic.posid2resid = {};
38603
+
38579
38604
  let substructItem = {};
38580
38605
  let pos2resi = {};
38581
38606
  for(let i = 0; i < residueArray.length; ++i) {
38582
38607
  let resid = residueArray[i];
38583
38608
 
38584
38609
  let resi = resid.substr(resid.lastIndexOf('_') + 1);
38585
- /*
38586
- if(i == 0) {
38587
- resiOffset = resi - 1;
38588
-
38589
- for(let j = 0; j < resiOffset; ++j) {
38590
- x0.push(undefined);
38591
- y0.push(undefined);
38592
- z0.push(undefined);
38593
- }
38594
- }
38595
- */
38596
38610
 
38597
38611
  //let resid = chnid + "_" + resi;
38598
38612
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
38599
38613
 
38600
- if(!atom) continue;
38601
- /*
38602
38614
  if(atom) {
38603
38615
  x0.push(atom.coord.x);
38604
38616
  y0.push(atom.coord.y);
38605
38617
  z0.push(atom.coord.z);
38606
38618
  }
38607
38619
  else {
38608
- x0.push(undefined);
38609
- y0.push(undefined);
38610
- z0.push(undefined);
38620
+ // x0.push(dummyCoord);
38621
+ // y0.push(dummyCoord);
38622
+ // z0.push(dummyCoord);
38623
+
38624
+ continue;
38611
38625
  }
38612
- */
38613
- //if(!atom) continue;
38614
-
38615
- x0.push(atom.coord.x);
38616
- y0.push(atom.coord.y);
38617
- z0.push(atom.coord.z);
38626
+
38627
+ // if(!atom) {
38628
+ // // continue;
38629
+ // }
38630
+
38631
+ // x0.push(atom.coord.x);
38632
+ // y0.push(atom.coord.y);
38633
+ // z0.push(atom.coord.z);
38634
+
38618
38635
  //resiArray.push(resi);
38619
38636
  resiArray.push(i+1);
38620
38637
  pos2resi[i+1] = resi;
38621
38638
 
38639
+ ic.posid2resid[atom.structure + '_' + atom.chain + '_' + (i+1).toString()] = resid;
38640
+ // let residNCBI = ic.resid2ncbi[resid];
38641
+ // let pos = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
38642
+ // pos2resi[pos] = resi;
38643
+
38622
38644
  if(atom.ssend) {
38623
38645
  //substructItem.To = parseInt(resi);
38624
38646
  substructItem.To = i + 1;
@@ -39037,8 +39059,8 @@ class Domain3d {
39037
39059
  ic.tddomains[domainName][resid] = 1;
39038
39060
  }
39039
39061
  }
39040
- }
39041
-
39062
+ }
39063
+
39042
39064
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
39043
39065
  } // end c2b_NewSplitChain
39044
39066
 
@@ -39056,9 +39078,14 @@ class Domain3d {
39056
39078
  //the whole structure is also considered as a large domain
39057
39079
  //if(subdomains.length == 0) {
39058
39080
  //subdomains.push([parseInt(ic.chainsSeq[chnid][0].resi), parseInt(ic.chainsSeq[chnid][ic.chainsSeq[chnid].length - 1].resi)]);
39059
- subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
39060
- parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
39061
- //}
39081
+
39082
+ // subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
39083
+ // parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
39084
+
39085
+ // use position based
39086
+ subdomains.push([1, residueArray.length]);
39087
+
39088
+ //}
39062
39089
 
39063
39090
  // m_domains1: {"data": [ {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]], "domain": [[1,43,x,y,z],[2,58,x,y,z], ...]}, {"ss": [[1,20,30,x,y,z,x,y,z], [2,50,60,x,y,z,x,y,z]],"domain": [[1,43,x,y,z],[2,58,x,y,z], ...]} ] }
39064
39091
  let jsonStr = '{"data": [';
@@ -39078,6 +39105,10 @@ class Domain3d {
39078
39105
  let from = pos2resi[substruct[k].From];
39079
39106
  let to = pos2resi[substruct[k].To];
39080
39107
 
39108
+ // 1-based residue numbers
39109
+ let fromPos = substruct[k].From;
39110
+ let toPos = substruct[k].To;
39111
+
39081
39112
  let residFrom = chnid + "_" + from;
39082
39113
  let atomFrom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residFrom]);
39083
39114
  if(!atomFrom || !ic.hAtoms.hasOwnProperty(atomFrom.serial)) continue;
@@ -39086,9 +39117,9 @@ class Domain3d {
39086
39117
  let atomTo = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residTo]);
39087
39118
  if(!atomTo || !ic.hAtoms.hasOwnProperty(atomTo.serial)) continue;
39088
39119
 
39089
- if(from >= start && to <= end) {
39120
+ if(fromPos >= start && toPos <= end) {
39090
39121
  if(ssCnt > 0) jsonStr += ', ';
39091
- jsonStr += '[' + sstype + ',' + from + ',' + to + ',' + substruct[k].x1.toFixed(2) + ',' + substruct[k].y1.toFixed(2) + ','
39122
+ jsonStr += '[' + sstype + ',' + fromPos + ',' + toPos + ',' + substruct[k].x1.toFixed(2) + ',' + substruct[k].y1.toFixed(2) + ','
39092
39123
  + substruct[k].z1.toFixed(2) + ',' + substruct[k].x2.toFixed(2) + ',' + substruct[k].y2.toFixed(2) + ',' + substruct[k].z2.toFixed(2) + ']';
39093
39124
  ++ssCnt;
39094
39125
  }
@@ -39106,7 +39137,10 @@ class Domain3d {
39106
39137
  for(let k = 0, kl = residueArray.length; k < kl; ++k) {
39107
39138
  let resid = residueArray[k];
39108
39139
 
39109
- let resi = resid.substr(resid.lastIndexOf('_') + 1);
39140
+ // let resi = resid.substr(resid.lastIndexOf('_') + 1);
39141
+ // let residNCBI = ic.resid2ncbi[resid];
39142
+ // let pos = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
39143
+ let pos = k + 1;
39110
39144
 
39111
39145
  //let resid = chnid + "_" + resi;
39112
39146
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
@@ -39116,9 +39150,9 @@ class Domain3d {
39116
39150
 
39117
39151
  //domain: resi, restype, x, y, z
39118
39152
  let restype = me.parasCls.resn2restype[atom.resn];
39119
- if(restype !== undefined && resi >= start && resi <= end) {
39153
+ if(restype !== undefined && pos >= start && pos <= end) {
39120
39154
  if(domainCnt > 0) jsonStr += ', ';
39121
- jsonStr += '[' + resi + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
39155
+ jsonStr += '[' + pos + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
39122
39156
  + atom.coord.y.toFixed(2) + ',' + atom.coord.z.toFixed(2) + ']';
39123
39157
  ++domainCnt;
39124
39158
  }
@@ -39948,7 +39982,7 @@ class AddTrack {
39948
39982
  let bUnion = false, bUpdateHighlight = true;
39949
39983
 
39950
39984
  let strandCnt = 0, loopCnt = 0;
39951
- let setName, currStrand, prevStrand, prevStrandReal, currType, prevType;
39985
+ let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
39952
39986
 
39953
39987
  // clear selection
39954
39988
  ic.hAtoms = {};
@@ -40015,6 +40049,7 @@ class AddTrack {
40015
40049
  }
40016
40050
  else if(prevType == 'igloop') {
40017
40051
  ++loopCnt;
40052
+ currStrand = 'CT';
40018
40053
  setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40019
40054
  setName = setName.replace(/'/g, '`');
40020
40055
  if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
@@ -41093,7 +41128,7 @@ class ShowAnno {
41093
41128
  }
41094
41129
  catch(err) {
41095
41130
  thisClass.enableHlSeq();
41096
- if(!me.bNode) console.log( "No data were found for the protein " + chnidBaseArray + "..." );
41131
+ if(!me.bNode) console.log( "No sequence data were found for the protein " + chnidBaseArray + "..." );
41097
41132
  for(let chnid in ic.protein_chainid) {
41098
41133
  let chnidBase = ic.protein_chainid[chnid];
41099
41134
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
@@ -41219,7 +41254,7 @@ class ShowAnno {
41219
41254
  }
41220
41255
  }
41221
41256
  else {
41222
- if(!me.bNode) console.log( "No data were found for the chain " + chnid + "..." );
41257
+ if(!me.bNode) console.log( "No sequence data were found for the chain " + chnid + "..." );
41223
41258
  ic.showSeqCls.setAlternativeSeq(chnid, chnidBase);
41224
41259
  }
41225
41260
 
@@ -42313,6 +42348,8 @@ class ShowSeq {
42313
42348
  // assign the adjusted reference numbers
42314
42349
  ic.resid2refnum[residueid] = refnumLabel;
42315
42350
 
42351
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42352
+
42316
42353
  if(!ic.refnum2residArray.hasOwnProperty(refnumStr)) {
42317
42354
  ic.refnum2residArray[refnumStr] = [residueid];
42318
42355
  }
@@ -44301,6 +44338,11 @@ class GetGraph {
44301
44338
  if(!bVertical) adjusty += 4 * r;
44302
44339
  }
44303
44340
 
44341
+ // show reference numbers
44342
+ if(ic.bShownRefnum && ic.resid2refnum[resid]) {
44343
+ nodeName = ic.resid2refnum[resid];
44344
+ }
44345
+
44304
44346
  let strokecolor = '#000';
44305
44347
  let strokewidth = '1';
44306
44348
  let textcolor = '#000';
@@ -44489,7 +44531,8 @@ class GetGraph {
44489
44531
  let complement = firstSetAtoms;
44490
44532
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44491
44533
  let bSaltbridge = false;
44492
- ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44534
+ // let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44535
+ ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44493
44536
  resid2ResidhashHbond = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44494
44537
  }
44495
44538
 
@@ -44506,7 +44549,8 @@ class GetGraph {
44506
44549
  let complement = firstSetAtoms;
44507
44550
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44508
44551
  let bSaltbridge = false;
44509
- ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44552
+ // let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44553
+ ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
44510
44554
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44511
44555
  }
44512
44556
  let ionicStr = this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.ionicInsideColor, labelType, me.htmlCls.ionicInsideValue);
@@ -44519,19 +44563,22 @@ class GetGraph {
44519
44563
  let halogenpiStr = '', threshold;
44520
44564
  threshold = parseFloat($("#" + ic.pre + "halogenthreshold" ).val());
44521
44565
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44522
- ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'halogen', true );
44566
+ // let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'halogen', true );
44567
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'halogen', true );
44523
44568
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44524
44569
  }
44525
44570
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.halogenInsideColor, labelType, me.htmlCls.halogenInsideValue);
44526
44571
  threshold = parseFloat($("#" + ic.pre + "picationthreshold" ).val());
44527
44572
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44528
- ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-cation', true );
44573
+ // let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-cation', true );
44574
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-cation', true );
44529
44575
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44530
44576
  }
44531
44577
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.picationInsideColor, labelType, me.htmlCls.picationInsideValue);
44532
44578
  threshold = parseFloat($("#" + ic.pre + "pistackingthreshold" ).val());
44533
44579
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44534
- ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-stacking', true );
44580
+ // let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-stacking', true );
44581
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-stacking', true );
44535
44582
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44536
44583
  }
44537
44584
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.pistackingInsideColor, labelType, me.htmlCls.pistackingInsideValue);
@@ -44689,6 +44736,15 @@ class ShowInter {
44689
44736
  async showInteractions(type) { let ic = this.icn3d, me = ic.icn3dui;
44690
44737
  let nameArray = $("#" + ic.pre + "atomsCustomHbond").val();
44691
44738
  let nameArray2 = $("#" + ic.pre + "atomsCustomHbond2").val();
44739
+
44740
+ let atoms, atoms2;
44741
+ atoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
44742
+ atoms2 = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
44743
+
44744
+ // add the interacting atoms to display
44745
+ ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms);
44746
+ ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms2);
44747
+
44692
44748
  if(nameArray2.length == 0) {
44693
44749
  var aaa = 1; //alert("Please select the first set");
44694
44750
  }
@@ -44774,7 +44830,8 @@ class ShowInter {
44774
44830
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44775
44831
 
44776
44832
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44777
- let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44833
+ // let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44834
+ let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44778
44835
  let commanddesc;
44779
44836
  if(bSaltbridge) {
44780
44837
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -44901,7 +44958,8 @@ class ShowInter {
44901
44958
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
44902
44959
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44903
44960
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44904
- let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44961
+ // let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44962
+ let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
44905
44963
  let commanddesc;
44906
44964
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44907
44965
  commanddesc = 'all atoms that have ionic interactions with the selected atoms';
@@ -44936,7 +44994,8 @@ class ShowInter {
44936
44994
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
44937
44995
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44938
44996
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44939
- let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), type, interactionType );
44997
+ // let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), type, interactionType );
44998
+ let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), type, interactionType );
44940
44999
  let commanddesc;
44941
45000
  if(interactionType == 'halogen') {
44942
45001
  ic.resid2ResidhashHalogen = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -45061,7 +45120,8 @@ class ShowInter {
45061
45120
  pickCustomSphere_base(radius, atomlistTarget, otherAtoms, bSphereCalc, bInteraction, type, select, bGetPairs, bIncludeTarget) { let ic = this.icn3d, me = ic.icn3dui; // ic.pAtom is set already
45062
45121
  let atoms;
45063
45122
  if(bInteraction) {
45064
- atoms = ic.contactCls.getAtomsWithinAtom(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, otherAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, atomlistTarget, ic.atoms), parseFloat(radius), bGetPairs, bInteraction, undefined, bIncludeTarget);
45123
+ // atoms = ic.contactCls.getAtomsWithinAtom(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, otherAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, atomlistTarget, ic.atoms), parseFloat(radius), bGetPairs, bInteraction, undefined, bIncludeTarget);
45124
+ atoms = ic.contactCls.getAtomsWithinAtom(me.hashUtilsCls.hash2Atoms(otherAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(atomlistTarget, ic.atoms), parseFloat(radius), bGetPairs, bInteraction, undefined, bIncludeTarget);
45065
45125
  ic.resid2ResidhashInteractions = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45066
45126
  }
45067
45127
  else {
@@ -46772,8 +46832,8 @@ class AlignParser {
46772
46832
  let dataArray = await allPromise;
46773
46833
 
46774
46834
  let data2 = data;
46775
- let data3 = dataArray[0].value; //v3[0];
46776
- let data4 = dataArray[1].value; //v4[0];
46835
+ let data3 = (me.bNode) ? dataArray[0] : dataArray[0].value; //v3[0];
46836
+ let data4 = (me.bNode) ? dataArray[1] : dataArray[1].value; //v4[0];
46777
46837
 
46778
46838
  if(data3.atoms !== undefined && data4.atoms !== undefined) {
46779
46839
  // ic.deferredOpm = $.Deferred(function() {
@@ -46935,7 +46995,7 @@ class AlignParser {
46935
46995
 
46936
46996
  let bFound = false;
46937
46997
  for(let i = 0, il = dataArray.length; i < il; ++i) {
46938
- let opmdata = dataArray[i].value;
46998
+ let opmdata = (me.bNode) ? dataArray[i] : dataArray[i].value;
46939
46999
 
46940
47000
  if(!opmdata) continue;
46941
47001
 
@@ -47095,7 +47155,7 @@ class ChainalignParser {
47095
47155
 
47096
47156
  // modify the previous trans and rotation matrix
47097
47157
  for(let i = 0, il = dataArray.length; i < il; ++i) {
47098
- let align = dataArray[i].value;//[0];
47158
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
47099
47159
 
47100
47160
  let mmdbid_q = struArray[i];
47101
47161
  let index = indexArray[i];
@@ -47173,7 +47233,7 @@ class ChainalignParser {
47173
47233
  return hAtomsAll;
47174
47234
  }
47175
47235
 
47176
- downloadChainalignmentPart2bRealign(dataArray, chainidPairArray) { let ic = this.icn3d, me = ic.icn3dui;
47236
+ downloadChainalignmentPart2bRealign(dataArray, chainidPairArray, bReverse) { let ic = this.icn3d, me = ic.icn3dui;
47177
47237
  // set trans and rotation matrix
47178
47238
  ic.t_trans_add = [];
47179
47239
  ic.q_trans_sub = [];
@@ -47187,7 +47247,7 @@ class ChainalignParser {
47187
47247
 
47188
47248
  let bFoundAlignment = false;
47189
47249
  for(let i = 0, il = dataArray.length; i < il; ++i) {
47190
- let align = dataArray[i].value;//[0];
47250
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
47191
47251
 
47192
47252
  let bEqualMmdbid = false;
47193
47253
  let bEqualChain = false;
@@ -47215,9 +47275,16 @@ class ChainalignParser {
47215
47275
  }
47216
47276
 
47217
47277
  if(!bFoundAlignment) {
47218
- /// if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
47219
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned...");
47220
- return;
47278
+ // sometimes VAST align works for the reversed pair
47279
+ if(!bReverse) {
47280
+ ic.realignParserCls.realignOnStructAlign(true);
47281
+ return;
47282
+ }
47283
+ else {
47284
+ /// if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
47285
+ if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned...");
47286
+ return;
47287
+ }
47221
47288
  }
47222
47289
 
47223
47290
  // find the max aligned mmdbid as mmdbid_t
@@ -47572,7 +47639,7 @@ class ChainalignParser {
47572
47639
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
47573
47640
  //var data2 = v2[0];
47574
47641
  // index = 0: the mmdb data of target
47575
- let targetData = dataArray[0].value; //[0];
47642
+ let targetData = (me.bNode) ? dataArray[0] : dataArray[0].value; //[0];
47576
47643
  let header = 'HEADER ' + mmdbid_t + '\n';
47577
47644
  if(isNaN(mmdbid_t) && mmdbid_t.length > 5) targetData = header + targetData;
47578
47645
 
@@ -47590,7 +47657,7 @@ class ChainalignParser {
47590
47657
  let queryDataArray = [];
47591
47658
 
47592
47659
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
47593
- let queryData = dataArray[index].value;//[0];
47660
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
47594
47661
 
47595
47662
  let pos = chainidArray[index].indexOf('_');
47596
47663
  let mmdbid_q = chainidArray[index].substr(0, pos).toUpperCase();
@@ -47636,7 +47703,7 @@ class ChainalignParser {
47636
47703
  ic.qt_start_end[index-1] = undefined;
47637
47704
  }
47638
47705
  else {
47639
- let align = dataArray[index2 - missedChainCnt].value;//[0];
47706
+ let align = (me.bNode) ? dataArray[index2 - missedChainCnt] : dataArray[index2 - missedChainCnt].value;//[0];
47640
47707
 
47641
47708
  let bEqualMmdbid = (mmdbid_q == mmdbid_t);
47642
47709
  let bEqualChain = (chain_q == chain_t);
@@ -47854,7 +47921,7 @@ class ChainalignParser {
47854
47921
 
47855
47922
  let queryDataArray = [];
47856
47923
  for(let index = 0, indexl = structArray.length; index < indexl; ++index) {
47857
- let queryData = dataArray[index].value;//[0];
47924
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
47858
47925
  let header = 'HEADER ' + structArray[index] + '\n';
47859
47926
  if(isNaN(structArray[index]) && structArray[index].length > 5) queryData = header + queryData;
47860
47927
 
@@ -50306,7 +50373,7 @@ class RealignParser {
50306
50373
  //var data2 = v2[0];
50307
50374
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
50308
50375
  // for(let index = 1, indexl = dataArray.length; index < indexl; ++index) {
50309
- let data = dataArray[index].value;//[0];
50376
+ let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
50310
50377
  if(!data) continue;
50311
50378
 
50312
50379
  let fromStruct = chainidArray[index + 1].substr(0, chainidArray[index + 1].indexOf('_')); //.toUpperCase();
@@ -50489,7 +50556,7 @@ class RealignParser {
50489
50556
  await this.realignChainOnSeqAlign(undefined, chainidArray, bRealign);
50490
50557
  }
50491
50558
 
50492
- async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
50559
+ async realignOnStructAlign(bReverse) { let ic = this.icn3d, me = ic.icn3dui;
50493
50560
  // each 3D domain should have at least 3 secondary structures
50494
50561
  let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
50495
50562
  let struct2domain = {};
@@ -50516,6 +50583,8 @@ class RealignParser {
50516
50583
 
50517
50584
  //let cnt = 0;
50518
50585
  let structArray = Object.keys(struct2domain);
50586
+ if(bReverse) structArray = structArray.reverse();
50587
+
50519
50588
  for(let s = 0, sl = structArray.length; s < sl; ++s) {
50520
50589
  let struct1 = structArray[s];
50521
50590
  let chainidArray1 = Object.keys(struct2domain[struct1]);
@@ -50559,14 +50628,14 @@ class RealignParser {
50559
50628
  }
50560
50629
 
50561
50630
  let allPromise = Promise.allSettled(ajaxArray);
50562
- try {
50631
+ // try {
50563
50632
  let dataArray = await allPromise;
50564
50633
  ic.qt_start_end = []; // reset the alignment
50565
- await ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray);
50566
- }
50567
- catch(err) {
50568
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50569
- }
50634
+ await ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray, bReverse);
50635
+ // }
50636
+ // catch(err) {
50637
+ // if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50638
+ // }
50570
50639
  }
50571
50640
 
50572
50641
  async realignOnStructAlignMsa(nameArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -50628,7 +50697,7 @@ class RealignParser {
50628
50697
  }
50629
50698
 
50630
50699
  let allPromise = Promise.allSettled(ajaxArray);
50631
- try {
50700
+ // try {
50632
50701
  let dataArray = await allPromise;
50633
50702
 
50634
50703
  // set trans and rotation matrix
@@ -50642,10 +50711,10 @@ class RealignParser {
50642
50711
 
50643
50712
  await ic.chainalignParserCls.downloadChainalignmentPart2b(undefined, nameArray, undefined, dataArray,
50644
50713
  indexArray, struct1, struArray);
50645
- }
50646
- catch(err) {
50647
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50648
- }
50714
+ // }
50715
+ // catch(err) {
50716
+ // if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50717
+ // }
50649
50718
  }
50650
50719
 
50651
50720
  async realignChainOnSeqAlign(chainresiCalphaHash2, chainidArray, bRealign, bPredefined) { let ic = this.icn3d, me = ic.icn3dui;
@@ -52154,13 +52223,13 @@ class ParserUtils {
52154
52223
  let allPromise = Promise.allSettled([prms1, prms2]);
52155
52224
  let dataArray = await allPromise;
52156
52225
 
52157
- ic.interactionData1 = dataArray[0].value;
52226
+ ic.interactionData1 = (me.bNode) ? dataArray[0] : dataArray[0].value;
52158
52227
  ic.html2ddgm = '';
52159
52228
  ic.diagram2dCls.draw2Ddgm(ic.interactionData1, mmdbid1, 0);
52160
52229
  if(me.cfg.show2d) me.htmlCls.dialogCls.openDlg('dl_2ddgm', 'Interactions');
52161
52230
 
52162
52231
 
52163
- ic.interactionData2 = dataArray[1].value;
52232
+ ic.interactionData2 = (me.bNode) ? dataArray[1] : dataArray[1].value;
52164
52233
  ic.diagram2dCls.draw2Ddgm(ic.interactionData2, mmdbid2, 1);
52165
52234
 
52166
52235
  ic.html2ddgm += "<br>" + ic.diagram2dCls.set2DdgmNote(true);
@@ -52208,7 +52277,7 @@ class ParserUtils {
52208
52277
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
52209
52278
  //var data2 = v2[0];
52210
52279
  for(let index = 0, indexl = chainidArray.length; index < indexl; ++index) {
52211
- let data = dataArray[index].value;//[0];
52280
+ let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
52212
52281
  let mmdbid = chainidArray[index].substr(0, chainidArray[index].indexOf('_'));
52213
52282
 
52214
52283
  ic.diagram2dCls.draw2Ddgm(data, mmdbid, 0);
@@ -53821,7 +53890,8 @@ class SetSeqAlign {
53821
53890
  return pos;
53822
53891
  }
53823
53892
 
53824
- getResnFromResi(chainid, resi) { let ic = this.icn3d, me = ic.icn3dui;
53893
+ getResnFromResi(chainid, resi) { let ic = this.icn3d; ic.icn3dui;
53894
+ /*
53825
53895
  let pos = this.getPosFromResi(chainid, resi);
53826
53896
  if(!pos) return '?';
53827
53897
 
@@ -53836,6 +53906,28 @@ class SetSeqAlign {
53836
53906
  }
53837
53907
 
53838
53908
  return resn;
53909
+ */
53910
+
53911
+ let resid = chainid + '_' + resi;
53912
+ return ic.residueId2Name[resid];
53913
+ }
53914
+
53915
+ getResiAferAlign(chainid, bRealign, pos) { let ic = this.icn3d, me = ic.icn3dui;
53916
+ let resi;
53917
+ if(bRealign && me.cfg.aligntool == 'tmalign') {
53918
+ resi = pos;
53919
+ }
53920
+ else {
53921
+ if(ic.posid2resid) {
53922
+ let resid = ic.posid2resid[chainid + '_' + pos];
53923
+ resi = resid.substr(resid.lastIndexOf('_') + 1);
53924
+ }
53925
+ else {
53926
+ resi = ic.chainsSeq[chainid][pos].resi;
53927
+ }
53928
+ }
53929
+
53930
+ return resi;
53839
53931
  }
53840
53932
 
53841
53933
  setSeqAlignChain(chainid, chainIndex, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -53943,10 +54035,10 @@ class SetSeqAlign {
53943
54035
  if(!ic.chainsMapping[chainid2]) ic.chainsMapping[chainid2] = {};
53944
54036
 
53945
54037
  let posChain1 = {}, posChain2 = {};
53946
-
54038
+
53947
54039
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
53948
54040
  let start1, start2, end1, end2;
53949
- if(bRealign) { // real residue numbers are stored, could be "100a"
54041
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored, could be "100a"
53950
54042
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
53951
54043
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
53952
54044
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -53968,7 +54060,7 @@ class SetSeqAlign {
53968
54060
 
53969
54061
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
53970
54062
  let start1, start2, end1, end2;
53971
- if(bRealign) { // real residue numbers are stored
54063
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
53972
54064
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
53973
54065
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
53974
54066
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -53990,8 +54082,9 @@ class SetSeqAlign {
53990
54082
 
53991
54083
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
53992
54084
 
53993
- let resi = (bRealign) ? j : ic.chainsSeq[chainid1][j].resi;
53994
- let resn = (bRealign) ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54085
+ let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
54086
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54087
+ let resn = this.getResnFromResi(chainid1, resi).toLowerCase();
53995
54088
 
53996
54089
  if(resn == '?') continue;
53997
54090
 
@@ -54009,11 +54102,11 @@ class SetSeqAlign {
54009
54102
  posChain2[j] = 1;
54010
54103
 
54011
54104
  if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54012
-
54013
- //let resi = ic.chainsSeq[chainid2][j].resi;
54014
- //let resn = ic.chainsSeq[chainid2][j].name.toLowerCase();
54015
- let resi = (bRealign) ? j : ic.chainsSeq[chainid2][j].resi;
54016
- let resn = (bRealign) ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
54105
+
54106
+ let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
54107
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
54108
+ let resn = this.getResnFromResi(chainid2, resi).toLowerCase();
54109
+
54017
54110
 
54018
54111
  if(resn == '?') continue;
54019
54112
 
@@ -54057,9 +54150,24 @@ class SetSeqAlign {
54057
54150
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54058
54151
 
54059
54152
  let resi1, resi2, resn1, resn2;
54153
+ /*
54060
54154
  if(bRealign) { // tmalign: just one residue in this for loop
54061
- // resi1 = j + start1;
54062
- // resi2 = j + start2;
54155
+ if(me.cfg.aligntool == 'tmalign') {
54156
+ resi1 = ic.qt_start_end[chainIndex][i].t_start;
54157
+ resi2 = ic.qt_start_end[chainIndex][i].q_start;
54158
+ }
54159
+ else {
54160
+ resi1 = j + start1;
54161
+ resi2 = j + start2;
54162
+ }
54163
+
54164
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54165
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54166
+
54167
+ if(resn1 == '?' || resn2 == '?') continue;
54168
+ }
54169
+ */
54170
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // tmalign: just one residue in this for loop
54063
54171
  resi1 = ic.qt_start_end[chainIndex][i].t_start;
54064
54172
  resi2 = ic.qt_start_end[chainIndex][i].q_start;
54065
54173
 
@@ -54071,10 +54179,15 @@ class SetSeqAlign {
54071
54179
  else {
54072
54180
  if(ic.chainsSeq[chainid1][j + start1] === undefined || ic.chainsSeq[chainid2][j + start2] === undefined) continue;
54073
54181
 
54074
- resi1 = ic.chainsSeq[chainid1][j + start1].resi;
54075
- resi2 = ic.chainsSeq[chainid2][j + start2].resi;
54076
- resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
54077
- resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
54182
+ // resi1 = ic.chainsSeq[chainid1][j + start1].resi;
54183
+ // resi2 = ic.chainsSeq[chainid2][j + start2].resi;
54184
+ // resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
54185
+ // resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
54186
+
54187
+ resi1 = this.getResiAferAlign(chainid1, bRealign, j + start1 + 1);
54188
+ resi2 = this.getResiAferAlign(chainid2, bRealign, j + start2 + 1);
54189
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54190
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54078
54191
  }
54079
54192
 
54080
54193
  if(resn1 === resn2) {
@@ -54338,7 +54451,12 @@ class SetSeqAlign {
54338
54451
  resObject.mmdbid = chainid.substr(0, pos);
54339
54452
  resObject.chain = chainid.substr(pos+1);
54340
54453
  resObject.resi = (bGap) ? '' : resi; // resi will be empty if there is no coordinates
54341
- resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
54454
+ if(!resn) {
54455
+ resObject.resn = '-';
54456
+ }
54457
+ else {
54458
+ resObject.resn = (bGap) ? '-' : ((bAligned) ? resn.toUpperCase() : resn.toLowerCase());
54459
+ }
54342
54460
  resObject.aligned = (bGap) ? false : bAligned;
54343
54461
  resObject.color = (bGap || !bAligned) ? me.htmlCls.GREYC : ((resn == resn_t) ? "#FF0000" : "#0000FF"); // color by identity
54344
54462
  resObject.color2 = (bGap || !bAligned) ? me.htmlCls.GREYC : '#' + ic.showAnnoCls.getColorhexFromBlosum62(resn, resn_t); // color by conservation
@@ -54372,9 +54490,9 @@ class SetSeqAlign {
54372
54490
  return resn;
54373
54491
  }
54374
54492
 
54375
- getResnFromResid(resid) { let ic = this.icn3d; ic.icn3dui;
54376
- return ic.residueId2Name[resid];
54377
- }
54493
+ // getResnFromResid(resid) { let ic = this.icn3d, me = ic.icn3dui;
54494
+ // return ic.residueId2Name[resid];
54495
+ // }
54378
54496
 
54379
54497
  getResiPosInTemplate(chainid1, resi_t) { let ic = this.icn3d; ic.icn3dui;
54380
54498
  // check the number of gaps before resiStart1 (nGap), and insert 'notAlnLen2 - notAlnLen1 - nGap' gaps
@@ -54503,7 +54621,7 @@ class SetSeqAlign {
54503
54621
 
54504
54622
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
54505
54623
  let start1, start2, end1, end2, resiStart1, start1Pos, end1Pos;
54506
- if(bRealign) { // real residue numbers are stored
54624
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
54507
54625
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
54508
54626
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
54509
54627
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -54587,8 +54705,8 @@ class SetSeqAlign {
54587
54705
  else {
54588
54706
  let resi1 = (bRealign) ? start1 + k : ic.ParserUtilsCls.getResi(chainid1, start1 + k);
54589
54707
  let resi2 = (bRealign) ? start2 + k : ic.ParserUtilsCls.getResi(chainid2, start2 + k);
54590
- let resn1 = this.getResnFromResid(chainid1 + '_' + resi1); //this.getResn(chainid1, start1 + k);
54591
- let resn2 = this.getResnFromResid(chainid2 + '_' + resi2); //this.getResn(chainid2, start2 + k);
54708
+ let resn1 = this.getResnFromResi(chainid1, resi1); //this.getResn(chainid1, start1 + k);
54709
+ let resn2 = this.getResnFromResi(chainid2, resi2); //this.getResn(chainid2, start2 + k);
54592
54710
 
54593
54711
  let bAlign = true;
54594
54712
  let resObject = this.getResObject(chainid2, false, bAlign, resi2, resn2, resn1);
@@ -55851,7 +55969,7 @@ class Vastplus {
55851
55969
 
55852
55970
  let queryDataArray = [];
55853
55971
  for(let index = 0, indexl = chainidpairArray.length; index < indexl; ++index) {
55854
- let queryData = dataArray[index].value; //[0];
55972
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
55855
55973
 
55856
55974
  queryDataArray.push(queryData);
55857
55975
  /*
@@ -57819,6 +57937,12 @@ class ApplyCommand {
57819
57937
  let dataStr = paraArray[1].replace(/\\n/g, '\n');
57820
57938
  await ic.refnumCls.parseCustomRefFile(dataStr);
57821
57939
  }
57940
+ else if(command.indexOf('show ref number') == 0) {
57941
+ ic.bShownRefnum = true;
57942
+ }
57943
+ else if(command.indexOf('hide ref number') == 0) {
57944
+ ic.bShownRefnum = false;
57945
+ }
57822
57946
 
57823
57947
  // special, select ==========
57824
57948
 
@@ -59853,7 +59977,7 @@ class SelectByCommand {
59853
59977
  // $1,2,3: Structure
59854
59978
  // .A,B,C: chain
59855
59979
  // :5-10,K,chemicals: residues, could be 'proteins', 'nucleotides', 'chemicals', 'ions', and 'water'
59856
- // :refnum_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
59980
+ // :ref_1250,anchors,strands,loops: reference numbers 1250, anchor residues (e.g., 2250), residues in strands, residues in loops
59857
59981
  // @CA,C,C*: atoms
59858
59982
  // wild card * can be used to select all
59859
59983
  //var currHighlightAtoms = {}
@@ -60001,7 +60125,7 @@ class SelectByCommand {
60001
60125
  let residArray = [];
60002
60126
 
60003
60127
  if(bRefnum) {
60004
- let residArrayTmp = (ic.refnum2residArray[k]) ? ic.refnum2residArray[k] : [];
60128
+ let residArrayTmp = (ic.refnum2residArray[k.toString()]) ? ic.refnum2residArray[k.toString()] : [];
60005
60129
  for(let m = 0, ml = residArrayTmp.length; m < ml; ++m) {
60006
60130
  let residueId = residArrayTmp[m];
60007
60131
  if(residueId.substr(0, residueId.lastIndexOf('_')) == molecule_chain) {
@@ -62059,14 +62183,14 @@ class Dssp {
62059
62183
  }
62060
62184
  }
62061
62185
 
62062
- async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d; ic.icn3dui;
62186
+ async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
62063
62187
  //var dataArray =(struArray.length == 1) ? [data] : data;
62064
62188
 
62065
62189
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
62066
62190
  //var data2 = v2[0];
62067
62191
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
62068
62192
  //let ssHash = dataArray[index][0];
62069
- let ssHash = dataArray[index].value;
62193
+ let ssHash = (me.bNode) ? dataArray[index] : dataArray[index].value;
62070
62194
 
62071
62195
  if(ssHash !== undefined && JSON.stringify(ssHash).indexOf('Oops there was a problem') === -1) {
62072
62196
  for(let chainNum in ic.chainsSeq) {
@@ -62192,8 +62316,19 @@ class Dssp {
62192
62316
  ic.bShowRefnum = false;
62193
62317
 
62194
62318
  ic.hAtoms = {};
62195
- ic.bResetAnno = true;
62196
- await ic.showAnnoCls.showAnnotations();
62319
+ //ic.bResetAnno = true;
62320
+
62321
+ // await ic.showAnnoCls.showAnnotations();
62322
+ if(ic.bAnnoShown) {
62323
+ for(let chain in ic.protein_chainid) {
62324
+ let chainidBase = ic.protein_chainid[chain];
62325
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
62326
+ }
62327
+ }
62328
+ else {
62329
+ await ic.showAnnoCls.showAnnotations();
62330
+ }
62331
+
62197
62332
  ic.hlUpdateCls.updateHlAll();
62198
62333
  }
62199
62334
 
@@ -62230,7 +62365,7 @@ class Dssp {
62230
62365
  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'];
62231
62366
 
62232
62367
  // round 2
62233
- ic.refpdbHash = {};
62368
+ ic.refpdbHash = {};
62234
62369
  ic.refpdbHash['NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62235
62370
  ic.refpdbHash['C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1', 'BArrestin1_4jqiA_rat_n1'];
62236
62371
  ic.refpdbHash['Siglec3_5j0bB_human_C2-n2'] = ['Siglec3_5j0bB_human_C2-n2', 'CD2_1hnfA_human_C2-n2', 'GHR_1axiB_human_FN3-n1'];
@@ -62255,40 +62390,27 @@ class Dssp {
62255
62390
  ic.refpdbHash['LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human', 'MPT63_1lmiA_bacteria'];
62256
62391
  ic.refpdbHash['CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62257
62392
  */
62258
- // round 1
62259
- ic.refpdbArray = ['1FAB-HEAVY_5esv_V-n1', '1CD2_1hnfA_human_V-n1', '1LAG3_7tzgD_human_C2-n2', '1BTLA_2aw2A_human_Iset', '1JAM1_1nbqA_human_VorIset-n2', '1Palladin_2dm3A_human_Iset-n1', '1FAB-HEAVY_5esv_C1-n2', '1FAB-LIGHT_5esv_C1-n2', '1BArrestin1_4jqiA_rat_n1', '1IL6Rb_1bquB_human_FN3-n3', '1Contactin1_2ee2A_human_FN3-n9', '1InsulinR_8guyE_human_FN3-n1', '1NaCaExchanger_2fwuA_dog_n2', '1CuZnSuperoxideDismutase_1hl5C_human', '1CoAtomerGamma1_1r4xA_human', '1RBPJ_6py8C_human_Unk-n2', '1CD2_1hnfA_human_C2-n2', '1GHR_1axiB_human_FN3-n1', '1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', '1ICOS_6x4gA_human_V', '1TCRa_6jxrm_human_C1-n2', '1LaminAC_1ifrA_human', '1IsdA_2iteA_bacteria', '1MPT63_1lmiA_bacteria', '1CD19_6al5A_human_C2orV-n1', '1ORF7a_1xakA_virus', '1ECadherin_4zt1A_human_n2', '1ASF1A_2iijA_human'];
62393
+ // round 1, 16 templates
62394
+ 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'];
62260
62395
 
62261
62396
  // round 2
62262
62397
  ic.refpdbHash = {};
62263
- ic.refpdbHash['1FAB-HEAVY_5esv_V-n1'] = ['FAB-HEAVY_5esv_V-n1', 'CD8a_1cd8A_human_V', 'FAB-LIGHT_5esv_V-n1', 'VNAR_1t6vN_shark_V'];
62264
- ic.refpdbHash['1CD2_1hnfA_human_V-n1'] = ['CD2_1hnfA_human_V-n1', 'Contactin1_3s97C_human_C2-n2', 'LAG3_7tzgD_human_V-n1'];
62265
- ic.refpdbHash['1LAG3_7tzgD_human_C2-n2'] = ['LAG3_7tzgD_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2'];
62266
- ic.refpdbHash['1BTLA_2aw2A_human_Iset'] = ['BTLA_2aw2A_human_Iset', 'PD1_4zqkB_human_V', 'TCRa_6jxrm_human_V-n1'];
62267
- ic.refpdbHash['1JAM1_1nbqA_human_VorIset-n2'] = ['JAM1_1nbqA_human_VorIset-n2', 'PDL1_4z18B_human_V-n1'];
62268
- ic.refpdbHash['1Palladin_2dm3A_human_Iset-n1'] = ['Palladin_2dm3A_human_Iset-n1', 'Titin_4uowM_human_Unk-n152', 'VISTA_6oilA_human_V'];
62269
- ic.refpdbHash['1FAB-HEAVY_5esv_C1-n2'] = ['FAB-HEAVY_5esv_C1-n2', 'B2Microglobulin_7phrL_human_C1', 'MHCIa_7phrH_human_C1'];
62270
- ic.refpdbHash['1FAB-LIGHT_5esv_C1-n2'] = ['FAB-LIGHT_5esv_C1-n2', 'VTCN1_Q7Z7D3_human_V-n2'];
62271
- ic.refpdbHash['1BArrestin1_4jqiA_rat_n1'] = ['BArrestin1_4jqiA_rat_n1', 'C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1'];
62272
- ic.refpdbHash['1IL6Rb_1bquB_human_FN3-n3'] = ['IL6Rb_1bquB_human_FN3-n3', 'Sidekick2_1wf5A_human_FN3-n7'];
62273
- ic.refpdbHash['1Contactin1_2ee2A_human_FN3-n9'] = ['Contactin1_2ee2A_human_FN3-n9', 'IL6Rb_1bquB_human_FN3-n2'];
62274
- ic.refpdbHash['1InsulinR_8guyE_human_FN3-n1'] = ['InsulinR_8guyE_human_FN3-n1', 'InsulinR_8guyE_human_FN3-n2'];
62275
- ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62398
+ 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'];
62399
+ ic.refpdbHash['1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4', 'ICOS_6x4gA_human_V'];
62400
+ ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria', 'RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
62401
+ ic.refpdbHash['1C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'BArrestin1_4jqiA_rat_n1', 'RBPJ_6py8C_human_Unk-n1'];
62276
62402
  ic.refpdbHash['1CuZnSuperoxideDismutase_1hl5C_human'] = ['CuZnSuperoxideDismutase_1hl5C_human', 'TEAD1_3kysC_human'];
62277
- ic.refpdbHash['1CoAtomerGamma1_1r4xA_human'] = ['CoAtomerGamma1_1r4xA_human', 'TP34_2o6cA_bacteria'];
62278
- ic.refpdbHash['1RBPJ_6py8C_human_Unk-n2'] = ['RBPJ_6py8C_human_Unk-n2', 'TP47_1o75A_bacteria'];
62279
-
62280
- ic.refpdbHash['1CD2_1hnfA_human_C2-n2'] = ['CD2_1hnfA_human_C2-n2'];
62281
- ic.refpdbHash['1GHR_1axiB_human_FN3-n1'] = ['GHR_1axiB_human_FN3-n1'];
62282
- ic.refpdbHash['1Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'] = ['Endo-1,4-BetaXylanase10A_1i8aA_bacteria_n4'];
62283
- ic.refpdbHash['1ICOS_6x4gA_human_V'] = ['ICOS_6x4gA_human_V'];
62284
- ic.refpdbHash['1TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
62403
+ ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human', 'MPT63_1lmiA_bacteria'];
62404
+ 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'];
62405
+ ic.refpdbHash['1CD2_1hnfA_human_C2-n2'] = ['CD2_1hnfA_human_C2-n2', 'Siglec3_5j0bB_human_C2-n2'];
62406
+ ic.refpdbHash['1NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62407
+ 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'];
62408
+ ic.refpdbHash['1PDL1_4z18B_human_V-n1'] = ['PDL1_4z18B_human_V-n1', 'CD2_1hnfA_human_V-n1', 'LAG3_7tzgD_human_V-n1'];
62409
+ 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'];
62285
62410
  ic.refpdbHash['1LaminAC_1ifrA_human'] = ['LaminAC_1ifrA_human'];
62286
62411
  ic.refpdbHash['1IsdA_2iteA_bacteria'] = ['IsdA_2iteA_bacteria'];
62287
- ic.refpdbHash['1MPT63_1lmiA_bacteria'] = ['MPT63_1lmiA_bacteria'];
62288
- ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62289
- ic.refpdbHash['1ORF7a_1xakA_virus'] = ['ORF7a_1xakA_virus'];
62290
- ic.refpdbHash['1ECadherin_4zt1A_human_n2'] = ['ECadherin_4zt1A_human_n2'];
62291
- ic.refpdbHash['1ASF1A_2iijA_human'] = ['ASF1A_2iijA_human'];
62412
+ ic.refpdbHash['1TCRa_6jxrm_human_C1-n2'] = ['TCRa_6jxrm_human_C1-n2'];
62413
+ ic.refpdbHash['1CD19_6al5A_human_C2orV-n1'] = ['CD19_6al5A_human_C2orV-n1'];
62292
62414
 
62293
62415
  // use known ref structure
62294
62416
  ic.refpdbHash['5ESV'] = ['FAB-HEAVY_5esv_V-n1', 'FAB-LIGHT_5esv_V-n1', 'FAB-HEAVY_5esv_C1-n2', 'FAB-LIGHT_5esv_C1-n2'];
@@ -62432,15 +62554,16 @@ class Dssp {
62432
62554
  domainAtomsArray.push(domainAtoms);
62433
62555
  }
62434
62556
  }
62435
-
62557
+
62436
62558
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
62437
62559
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
62438
- let domainid = chainid + '-' + k;
62560
+ // ig strand for any subset will have the same k, use the number of residue to separate them
62561
+ let domainid = chainid + '-' + k + '_' + domainAtomsArray[k].length;
62439
62562
  ic.domainid2pdb[domainid] = pdb_target;
62440
62563
 
62441
62564
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
62442
62565
  let struct2 = ic.defaultPdbId + index;
62443
- let pdb_query = dataArray[index].value; //[0];
62566
+ let pdb_query = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
62444
62567
  let header = 'HEADER ' + struct2 + '\n';
62445
62568
  pdb_query = header + pdb_query;
62446
62569
 
@@ -62448,7 +62571,7 @@ class Dssp {
62448
62571
  let alignAjax = me.getAjaxPostPromise(urltmalign, dataObj);
62449
62572
  ajaxArray.push(alignAjax);
62450
62573
 
62451
- domainidpairArray.push(domainid + "," + ic.refpdbArray[index]);
62574
+ domainidpairArray.push(domainid + "|" + ic.refpdbArray[index]);
62452
62575
  }
62453
62576
  }
62454
62577
  }
@@ -62474,7 +62597,7 @@ class Dssp {
62474
62597
  async parseAlignData(dataArray, domainidpairArray, bRound1) { let ic = this.icn3d, me = ic.icn3dui;
62475
62598
  let thisClass = this;
62476
62599
 
62477
- let tmscoreThreshold = 0.4; //0.5;
62600
+ let tmscoreThreshold = 0.4; // 0.4; //0.5;
62478
62601
 
62479
62602
  // find the best alignment for each chain
62480
62603
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
@@ -62492,7 +62615,7 @@ class Dssp {
62492
62615
  let minResidues = 20;
62493
62616
 
62494
62617
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
62495
- let queryData = dataArray[i].value; //[0];
62618
+ let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
62496
62619
 
62497
62620
  if(!queryData) {
62498
62621
  if(!me.bNode) console.log("The alignment data for " + domainidpairArray[i] + " is unavailable...");
@@ -62501,12 +62624,14 @@ class Dssp {
62501
62624
 
62502
62625
  if(queryData.length == 0) continue;
62503
62626
 
62504
- if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) continue;
62627
+ if(queryData[0].score < tmscoreThreshold || queryData[0].num_res < minResidues) {
62628
+ continue;
62629
+ }
62505
62630
 
62506
62631
  //let domainid_index = domainidpairArray[i].split(',');
62507
62632
  //let domainid = domainid_index[0];
62508
- let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf(','));
62509
- let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf(',') + 1);
62633
+ let domainid = domainidpairArray[i].substr(0, domainidpairArray[i].indexOf('|'));
62634
+ let refpdbname = domainidpairArray[i].substr(domainidpairArray[i].indexOf('|') + 1);
62510
62635
  //let chainid = domainid.split('-')[0];
62511
62636
 
62512
62637
  // Ig-like domains: B (2150, 2150a, 2150b), C (3150, 3250), E (7150, 7250), F (8150, 8250) strands
@@ -62564,6 +62689,10 @@ class Dssp {
62564
62689
  if(!me.bNode) console.log("Adjusted refpdbname for domainid " + domainid + ": " + refpdbname);
62565
62690
  }
62566
62691
 
62692
+ if(!ic.refpdbHash[refpdbname]) {
62693
+ continue;
62694
+ }
62695
+
62567
62696
  for(let k = 0, kl = ic.refpdbHash[refpdbname].length; k < kl; ++k) {
62568
62697
  let urlpdb = me.htmlCls.baseUrl + "mmcifparser/mmcifparser.cgi?refpdbid=" + ic.refpdbHash[refpdbname][k];
62569
62698
 
@@ -62578,7 +62707,7 @@ class Dssp {
62578
62707
  let pdb_target = ic.domainid2pdb[domainid];
62579
62708
  for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
62580
62709
  let struct2 = ic.defaultPdbId + index;
62581
- let pdb_query = ic.pdbDataArray[index].value; //[0];
62710
+ let pdb_query = (me.bNode) ? ic.pdbDataArray[index] : ic.pdbDataArray[index].value; //[0];
62582
62711
  let header = 'HEADER ' + struct2 + '\n';
62583
62712
  pdb_query = header + pdb_query;
62584
62713
 
@@ -62587,7 +62716,7 @@ class Dssp {
62587
62716
  ajaxArray.push(alignAjax);
62588
62717
 
62589
62718
  //domainidpairArray3.push(domainid + "," + refpdbname);
62590
- domainidpairArray3.push(domainid + "," + ic.refpdbHash[refpdbname][index]);
62719
+ domainidpairArray3.push(domainid + "|" + ic.refpdbHash[refpdbname][index]);
62591
62720
  }
62592
62721
  }
62593
62722
 
@@ -62675,8 +62804,17 @@ class Dssp {
62675
62804
 
62676
62805
  // open sequence view
62677
62806
  ic.hAtomsRefnum = {};
62678
- ic.bResetAnno = true;
62679
- await ic.showAnnoCls.showAnnotations();
62807
+ //ic.bResetAnno = true;
62808
+ if(ic.bAnnoShown) {
62809
+ for(let chain in ic.protein_chainid) {
62810
+ let chainidBase = ic.protein_chainid[chain];
62811
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
62812
+ }
62813
+ }
62814
+ else {
62815
+ await ic.showAnnoCls.showAnnotations();
62816
+ }
62817
+
62680
62818
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
62681
62819
  }
62682
62820
  else {
@@ -62801,7 +62939,7 @@ class Dssp {
62801
62939
  }
62802
62940
 
62803
62941
  rmStrandFromRefnumlabel(refnumLabel) {
62804
- return refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
62942
+ return (!refnumLabel) ? refnumLabel : refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
62805
62943
  }
62806
62944
  }
62807
62945
 
@@ -62862,6 +63000,8 @@ class Scap {
62862
63000
  async retrieveScap(snp, bInteraction, bPdb) { let ic = this.icn3d, me = ic.icn3dui;
62863
63001
  let thisClass = this;
62864
63002
 
63003
+ ic.bScap = true;
63004
+
62865
63005
  //snp: 6M0J_E_484_K,6M0J_E_501_Y,6M0J_E_417_N
62866
63006
  let snpStr = '';
62867
63007
  let snpArray = snp.split(','); //stru_chain_resi_snp
@@ -70785,7 +70925,7 @@ class iCn3DUI {
70785
70925
  //even when multiple iCn3D viewers are shown together.
70786
70926
  this.pre = this.cfg.divid + "_";
70787
70927
 
70788
- this.REVISION = '3.25.1';
70928
+ this.REVISION = '3.25.3';
70789
70929
 
70790
70930
  // In nodejs, iCn3D defines "window = {navigator: {}}"
70791
70931
  this.bNode = (Object.keys(window).length < 2) ? true : false;