icn3d 3.25.13 → 3.25.15

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
@@ -32163,7 +32163,7 @@ class Alternate {
32163
32163
 
32164
32164
  ic.dAtoms = {};
32165
32165
 
32166
- 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';
32167
32167
 
32168
32168
  for(let i = 0, il = moleculeArray.length; i < il; ++i) {
32169
32169
  let structure = moleculeArray[i];
@@ -35792,7 +35792,12 @@ class AnnoCddSite {
35792
35792
  || (Object.keys(ic.structures).length == 2 && me.cfg.align) ) {
35793
35793
  let data = {};
35794
35794
  try {
35795
- 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
+ }
35796
35801
 
35797
35802
  thisClass.parseCddData([data], chnidArray);
35798
35803
  /// if(ic.deferredAnnoCddSite !== undefined) ic.deferredAnnoCddSite.resolve();
@@ -35850,7 +35855,9 @@ class AnnoCddSite {
35850
35855
 
35851
35856
  for(let i = 0, il = dataArray.length; i < il; ++i) {
35852
35857
  //let data = (bSeq) ? dataArray[i][0] : dataArray[i];
35853
- let data = dataArray[i].value;
35858
+ let data = (me.bNode) ? dataArray[i] : dataArray[i].value;
35859
+
35860
+ if(!data) continue;
35854
35861
 
35855
35862
  for(let chainI = 0, chainLen = data.data.length; chainI < chainLen; ++chainI) {
35856
35863
  let cddData = data.data[chainI];
@@ -38592,49 +38599,48 @@ class Domain3d {
38592
38599
  let residueArray = Object.keys(residueHash);
38593
38600
  let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
38594
38601
 
38602
+ if(!ic.posid2resid) ic.posid2resid = {};
38603
+
38595
38604
  let substructItem = {};
38596
38605
  let pos2resi = {};
38597
38606
  for(let i = 0; i < residueArray.length; ++i) {
38598
38607
  let resid = residueArray[i];
38599
38608
 
38600
38609
  let resi = resid.substr(resid.lastIndexOf('_') + 1);
38601
- /*
38602
- if(i == 0) {
38603
- resiOffset = resi - 1;
38604
-
38605
- for(let j = 0; j < resiOffset; ++j) {
38606
- x0.push(undefined);
38607
- y0.push(undefined);
38608
- z0.push(undefined);
38609
- }
38610
- }
38611
- */
38612
38610
 
38613
38611
  //let resid = chnid + "_" + resi;
38614
38612
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
38615
38613
 
38616
- if(!atom) continue;
38617
- /*
38618
38614
  if(atom) {
38619
38615
  x0.push(atom.coord.x);
38620
38616
  y0.push(atom.coord.y);
38621
38617
  z0.push(atom.coord.z);
38622
38618
  }
38623
38619
  else {
38624
- x0.push(undefined);
38625
- y0.push(undefined);
38626
- z0.push(undefined);
38620
+ // x0.push(dummyCoord);
38621
+ // y0.push(dummyCoord);
38622
+ // z0.push(dummyCoord);
38623
+
38624
+ continue;
38627
38625
  }
38628
- */
38629
- //if(!atom) continue;
38630
-
38631
- x0.push(atom.coord.x);
38632
- y0.push(atom.coord.y);
38633
- 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
+
38634
38635
  //resiArray.push(resi);
38635
38636
  resiArray.push(i+1);
38636
38637
  pos2resi[i+1] = resi;
38637
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
+
38638
38644
  if(atom.ssend) {
38639
38645
  //substructItem.To = parseInt(resi);
38640
38646
  substructItem.To = i + 1;
@@ -39053,8 +39059,8 @@ class Domain3d {
39053
39059
  ic.tddomains[domainName][resid] = 1;
39054
39060
  }
39055
39061
  }
39056
- }
39057
-
39062
+ }
39063
+
39058
39064
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
39059
39065
  } // end c2b_NewSplitChain
39060
39066
 
@@ -39072,9 +39078,14 @@ class Domain3d {
39072
39078
  //the whole structure is also considered as a large domain
39073
39079
  //if(subdomains.length == 0) {
39074
39080
  //subdomains.push([parseInt(ic.chainsSeq[chnid][0].resi), parseInt(ic.chainsSeq[chnid][ic.chainsSeq[chnid].length - 1].resi)]);
39075
- subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
39076
- parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
39077
- //}
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
+ //}
39078
39089
 
39079
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], ...]} ] }
39080
39091
  let jsonStr = '{"data": [';
@@ -39094,6 +39105,10 @@ class Domain3d {
39094
39105
  let from = pos2resi[substruct[k].From];
39095
39106
  let to = pos2resi[substruct[k].To];
39096
39107
 
39108
+ // 1-based residue numbers
39109
+ let fromPos = substruct[k].From;
39110
+ let toPos = substruct[k].To;
39111
+
39097
39112
  let residFrom = chnid + "_" + from;
39098
39113
  let atomFrom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residFrom]);
39099
39114
  if(!atomFrom || !ic.hAtoms.hasOwnProperty(atomFrom.serial)) continue;
@@ -39102,9 +39117,9 @@ class Domain3d {
39102
39117
  let atomTo = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residTo]);
39103
39118
  if(!atomTo || !ic.hAtoms.hasOwnProperty(atomTo.serial)) continue;
39104
39119
 
39105
- if(from >= start && to <= end) {
39120
+ if(fromPos >= start && toPos <= end) {
39106
39121
  if(ssCnt > 0) jsonStr += ', ';
39107
- 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) + ','
39108
39123
  + substruct[k].z1.toFixed(2) + ',' + substruct[k].x2.toFixed(2) + ',' + substruct[k].y2.toFixed(2) + ',' + substruct[k].z2.toFixed(2) + ']';
39109
39124
  ++ssCnt;
39110
39125
  }
@@ -39122,7 +39137,10 @@ class Domain3d {
39122
39137
  for(let k = 0, kl = residueArray.length; k < kl; ++k) {
39123
39138
  let resid = residueArray[k];
39124
39139
 
39125
- 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;
39126
39144
 
39127
39145
  //let resid = chnid + "_" + resi;
39128
39146
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
@@ -39132,9 +39150,9 @@ class Domain3d {
39132
39150
 
39133
39151
  //domain: resi, restype, x, y, z
39134
39152
  let restype = me.parasCls.resn2restype[atom.resn];
39135
- if(restype !== undefined && resi >= start && resi <= end) {
39153
+ if(restype !== undefined && pos >= start && pos <= end) {
39136
39154
  if(domainCnt > 0) jsonStr += ', ';
39137
- jsonStr += '[' + resi + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
39155
+ jsonStr += '[' + pos + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
39138
39156
  + atom.coord.y.toFixed(2) + ',' + atom.coord.z.toFixed(2) + ']';
39139
39157
  ++domainCnt;
39140
39158
  }
@@ -39964,7 +39982,7 @@ class AddTrack {
39964
39982
  let bUnion = false, bUpdateHighlight = true;
39965
39983
 
39966
39984
  let strandCnt = 0, loopCnt = 0;
39967
- let setName, currStrand, prevStrand, prevStrandReal, currType, prevType;
39985
+ let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
39968
39986
 
39969
39987
  // clear selection
39970
39988
  ic.hAtoms = {};
@@ -40031,6 +40049,7 @@ class AddTrack {
40031
40049
  }
40032
40050
  else if(prevType == 'igloop') {
40033
40051
  ++loopCnt;
40052
+ currStrand = 'CT';
40034
40053
  setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40035
40054
  setName = setName.replace(/'/g, '`');
40036
40055
  if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
@@ -42329,6 +42348,8 @@ class ShowSeq {
42329
42348
  // assign the adjusted reference numbers
42330
42349
  ic.resid2refnum[residueid] = refnumLabel;
42331
42350
 
42351
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
42352
+
42332
42353
  if(!ic.refnum2residArray.hasOwnProperty(refnumStr)) {
42333
42354
  ic.refnum2residArray[refnumStr] = [residueid];
42334
42355
  }
@@ -44510,7 +44531,8 @@ class GetGraph {
44510
44531
  let complement = firstSetAtoms;
44511
44532
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44512
44533
  let bSaltbridge = false;
44513
- 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 );
44514
44536
  resid2ResidhashHbond = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44515
44537
  }
44516
44538
 
@@ -44527,7 +44549,8 @@ class GetGraph {
44527
44549
  let complement = firstSetAtoms;
44528
44550
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44529
44551
  let bSaltbridge = false;
44530
- 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 );
44531
44554
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44532
44555
  }
44533
44556
  let ionicStr = this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.ionicInsideColor, labelType, me.htmlCls.ionicInsideValue);
@@ -44540,19 +44563,22 @@ class GetGraph {
44540
44563
  let halogenpiStr = '', threshold;
44541
44564
  threshold = parseFloat($("#" + ic.pre + "halogenthreshold" ).val());
44542
44565
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44543
- 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 );
44544
44568
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44545
44569
  }
44546
44570
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.halogenInsideColor, labelType, me.htmlCls.halogenInsideValue);
44547
44571
  threshold = parseFloat($("#" + ic.pre + "picationthreshold" ).val());
44548
44572
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44549
- 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 );
44550
44575
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44551
44576
  }
44552
44577
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.picationInsideColor, labelType, me.htmlCls.picationInsideValue);
44553
44578
  threshold = parseFloat($("#" + ic.pre + "pistackingthreshold" ).val());
44554
44579
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44555
- 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 );
44556
44582
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44557
44583
  }
44558
44584
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.pistackingInsideColor, labelType, me.htmlCls.pistackingInsideValue);
@@ -44710,6 +44736,15 @@ class ShowInter {
44710
44736
  async showInteractions(type) { let ic = this.icn3d, me = ic.icn3dui;
44711
44737
  let nameArray = $("#" + ic.pre + "atomsCustomHbond").val();
44712
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
+
44713
44748
  if(nameArray2.length == 0) {
44714
44749
  var aaa = 1; //alert("Please select the first set");
44715
44750
  }
@@ -44795,7 +44830,8 @@ class ShowInter {
44795
44830
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44796
44831
 
44797
44832
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44798
- 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 );
44799
44835
  let commanddesc;
44800
44836
  if(bSaltbridge) {
44801
44837
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -44922,7 +44958,8 @@ class ShowInter {
44922
44958
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
44923
44959
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44924
44960
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44925
- 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 );
44926
44963
  let commanddesc;
44927
44964
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
44928
44965
  commanddesc = 'all atoms that have ionic interactions with the selected atoms';
@@ -44957,7 +44994,8 @@ class ShowInter {
44957
44994
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
44958
44995
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
44959
44996
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
44960
- 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 );
44961
44999
  let commanddesc;
44962
45000
  if(interactionType == 'halogen') {
44963
45001
  ic.resid2ResidhashHalogen = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -45082,7 +45120,8 @@ class ShowInter {
45082
45120
  pickCustomSphere_base(radius, atomlistTarget, otherAtoms, bSphereCalc, bInteraction, type, select, bGetPairs, bIncludeTarget) { let ic = this.icn3d, me = ic.icn3dui; // ic.pAtom is set already
45083
45121
  let atoms;
45084
45122
  if(bInteraction) {
45085
- 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);
45086
45125
  ic.resid2ResidhashInteractions = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45087
45126
  }
45088
45127
  else {
@@ -46793,8 +46832,8 @@ class AlignParser {
46793
46832
  let dataArray = await allPromise;
46794
46833
 
46795
46834
  let data2 = data;
46796
- let data3 = dataArray[0].value; //v3[0];
46797
- 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];
46798
46837
 
46799
46838
  if(data3.atoms !== undefined && data4.atoms !== undefined) {
46800
46839
  // ic.deferredOpm = $.Deferred(function() {
@@ -46956,7 +46995,7 @@ class AlignParser {
46956
46995
 
46957
46996
  let bFound = false;
46958
46997
  for(let i = 0, il = dataArray.length; i < il; ++i) {
46959
- let opmdata = dataArray[i].value;
46998
+ let opmdata = (me.bNode) ? dataArray[i] : dataArray[i].value;
46960
46999
 
46961
47000
  if(!opmdata) continue;
46962
47001
 
@@ -47116,7 +47155,7 @@ class ChainalignParser {
47116
47155
 
47117
47156
  // modify the previous trans and rotation matrix
47118
47157
  for(let i = 0, il = dataArray.length; i < il; ++i) {
47119
- let align = dataArray[i].value;//[0];
47158
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
47120
47159
 
47121
47160
  let mmdbid_q = struArray[i];
47122
47161
  let index = indexArray[i];
@@ -47194,7 +47233,7 @@ class ChainalignParser {
47194
47233
  return hAtomsAll;
47195
47234
  }
47196
47235
 
47197
- downloadChainalignmentPart2bRealign(dataArray, chainidPairArray) { let ic = this.icn3d, me = ic.icn3dui;
47236
+ downloadChainalignmentPart2bRealign(dataArray, chainidPairArray, bReverse) { let ic = this.icn3d, me = ic.icn3dui;
47198
47237
  // set trans and rotation matrix
47199
47238
  ic.t_trans_add = [];
47200
47239
  ic.q_trans_sub = [];
@@ -47208,7 +47247,7 @@ class ChainalignParser {
47208
47247
 
47209
47248
  let bFoundAlignment = false;
47210
47249
  for(let i = 0, il = dataArray.length; i < il; ++i) {
47211
- let align = dataArray[i].value;//[0];
47250
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
47212
47251
 
47213
47252
  let bEqualMmdbid = false;
47214
47253
  let bEqualChain = false;
@@ -47236,9 +47275,16 @@ class ChainalignParser {
47236
47275
  }
47237
47276
 
47238
47277
  if(!bFoundAlignment) {
47239
- /// if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
47240
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned...");
47241
- 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
+ }
47242
47288
  }
47243
47289
 
47244
47290
  // find the max aligned mmdbid as mmdbid_t
@@ -47593,7 +47639,7 @@ class ChainalignParser {
47593
47639
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
47594
47640
  //var data2 = v2[0];
47595
47641
  // index = 0: the mmdb data of target
47596
- let targetData = dataArray[0].value; //[0];
47642
+ let targetData = (me.bNode) ? dataArray[0] : dataArray[0].value; //[0];
47597
47643
  let header = 'HEADER ' + mmdbid_t + '\n';
47598
47644
  if(isNaN(mmdbid_t) && mmdbid_t.length > 5) targetData = header + targetData;
47599
47645
 
@@ -47611,7 +47657,7 @@ class ChainalignParser {
47611
47657
  let queryDataArray = [];
47612
47658
 
47613
47659
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
47614
- let queryData = dataArray[index].value;//[0];
47660
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
47615
47661
 
47616
47662
  let pos = chainidArray[index].indexOf('_');
47617
47663
  let mmdbid_q = chainidArray[index].substr(0, pos).toUpperCase();
@@ -47657,7 +47703,7 @@ class ChainalignParser {
47657
47703
  ic.qt_start_end[index-1] = undefined;
47658
47704
  }
47659
47705
  else {
47660
- let align = dataArray[index2 - missedChainCnt].value;//[0];
47706
+ let align = (me.bNode) ? dataArray[index2 - missedChainCnt] : dataArray[index2 - missedChainCnt].value;//[0];
47661
47707
 
47662
47708
  let bEqualMmdbid = (mmdbid_q == mmdbid_t);
47663
47709
  let bEqualChain = (chain_q == chain_t);
@@ -47875,7 +47921,7 @@ class ChainalignParser {
47875
47921
 
47876
47922
  let queryDataArray = [];
47877
47923
  for(let index = 0, indexl = structArray.length; index < indexl; ++index) {
47878
- let queryData = dataArray[index].value;//[0];
47924
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
47879
47925
  let header = 'HEADER ' + structArray[index] + '\n';
47880
47926
  if(isNaN(structArray[index]) && structArray[index].length > 5) queryData = header + queryData;
47881
47927
 
@@ -50327,7 +50373,7 @@ class RealignParser {
50327
50373
  //var data2 = v2[0];
50328
50374
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
50329
50375
  // for(let index = 1, indexl = dataArray.length; index < indexl; ++index) {
50330
- let data = dataArray[index].value;//[0];
50376
+ let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
50331
50377
  if(!data) continue;
50332
50378
 
50333
50379
  let fromStruct = chainidArray[index + 1].substr(0, chainidArray[index + 1].indexOf('_')); //.toUpperCase();
@@ -50510,7 +50556,7 @@ class RealignParser {
50510
50556
  await this.realignChainOnSeqAlign(undefined, chainidArray, bRealign);
50511
50557
  }
50512
50558
 
50513
- async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
50559
+ async realignOnStructAlign(bReverse) { let ic = this.icn3d, me = ic.icn3dui;
50514
50560
  // each 3D domain should have at least 3 secondary structures
50515
50561
  let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
50516
50562
  let struct2domain = {};
@@ -50537,6 +50583,8 @@ class RealignParser {
50537
50583
 
50538
50584
  //let cnt = 0;
50539
50585
  let structArray = Object.keys(struct2domain);
50586
+ if(bReverse) structArray = structArray.reverse();
50587
+
50540
50588
  for(let s = 0, sl = structArray.length; s < sl; ++s) {
50541
50589
  let struct1 = structArray[s];
50542
50590
  let chainidArray1 = Object.keys(struct2domain[struct1]);
@@ -50580,14 +50628,14 @@ class RealignParser {
50580
50628
  }
50581
50629
 
50582
50630
  let allPromise = Promise.allSettled(ajaxArray);
50583
- try {
50631
+ // try {
50584
50632
  let dataArray = await allPromise;
50585
50633
  ic.qt_start_end = []; // reset the alignment
50586
- await ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray);
50587
- }
50588
- catch(err) {
50589
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50590
- }
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
+ // }
50591
50639
  }
50592
50640
 
50593
50641
  async realignOnStructAlignMsa(nameArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -50649,7 +50697,7 @@ class RealignParser {
50649
50697
  }
50650
50698
 
50651
50699
  let allPromise = Promise.allSettled(ajaxArray);
50652
- try {
50700
+ // try {
50653
50701
  let dataArray = await allPromise;
50654
50702
 
50655
50703
  // set trans and rotation matrix
@@ -50663,10 +50711,10 @@ class RealignParser {
50663
50711
 
50664
50712
  await ic.chainalignParserCls.downloadChainalignmentPart2b(undefined, nameArray, undefined, dataArray,
50665
50713
  indexArray, struct1, struArray);
50666
- }
50667
- catch(err) {
50668
- if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50669
- }
50714
+ // }
50715
+ // catch(err) {
50716
+ // if(ic.bRender) var aaa = 1; //alert("These structures can NOT be aligned to each other...");
50717
+ // }
50670
50718
  }
50671
50719
 
50672
50720
  async realignChainOnSeqAlign(chainresiCalphaHash2, chainidArray, bRealign, bPredefined) { let ic = this.icn3d, me = ic.icn3dui;
@@ -52175,12 +52223,14 @@ class ParserUtils {
52175
52223
  let allPromise = Promise.allSettled([prms1, prms2]);
52176
52224
  let dataArray = await allPromise;
52177
52225
 
52226
+ // ic.interactionData1 = (me.bNode) ? dataArray[0] : dataArray[0].value;
52178
52227
  ic.interactionData1 = dataArray[0].value;
52179
52228
  ic.html2ddgm = '';
52180
52229
  ic.diagram2dCls.draw2Ddgm(ic.interactionData1, mmdbid1, 0);
52181
52230
  if(me.cfg.show2d) me.htmlCls.dialogCls.openDlg('dl_2ddgm', 'Interactions');
52182
52231
 
52183
52232
 
52233
+ // ic.interactionData2 = (me.bNode) ? dataArray[1] : dataArray[1].value;
52184
52234
  ic.interactionData2 = dataArray[1].value;
52185
52235
  ic.diagram2dCls.draw2Ddgm(ic.interactionData2, mmdbid2, 1);
52186
52236
 
@@ -52229,6 +52279,7 @@ class ParserUtils {
52229
52279
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
52230
52280
  //var data2 = v2[0];
52231
52281
  for(let index = 0, indexl = chainidArray.length; index < indexl; ++index) {
52282
+ // let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
52232
52283
  let data = dataArray[index].value;//[0];
52233
52284
  let mmdbid = chainidArray[index].substr(0, chainidArray[index].indexOf('_'));
52234
52285
 
@@ -53842,7 +53893,8 @@ class SetSeqAlign {
53842
53893
  return pos;
53843
53894
  }
53844
53895
 
53845
- getResnFromResi(chainid, resi) { let ic = this.icn3d, me = ic.icn3dui;
53896
+ getResnFromResi(chainid, resi) { let ic = this.icn3d; ic.icn3dui;
53897
+ /*
53846
53898
  let pos = this.getPosFromResi(chainid, resi);
53847
53899
  if(!pos) return '?';
53848
53900
 
@@ -53857,6 +53909,28 @@ class SetSeqAlign {
53857
53909
  }
53858
53910
 
53859
53911
  return resn;
53912
+ */
53913
+
53914
+ let resid = chainid + '_' + resi;
53915
+ return ic.residueId2Name[resid];
53916
+ }
53917
+
53918
+ getResiAferAlign(chainid, bRealign, pos) { let ic = this.icn3d, me = ic.icn3dui;
53919
+ let resi;
53920
+ if(bRealign && me.cfg.aligntool == 'tmalign') {
53921
+ resi = pos;
53922
+ }
53923
+ else {
53924
+ if(ic.posid2resid) {
53925
+ let resid = ic.posid2resid[chainid + '_' + pos];
53926
+ resi = resid.substr(resid.lastIndexOf('_') + 1);
53927
+ }
53928
+ else {
53929
+ resi = ic.chainsSeq[chainid][pos].resi;
53930
+ }
53931
+ }
53932
+
53933
+ return resi;
53860
53934
  }
53861
53935
 
53862
53936
  setSeqAlignChain(chainid, chainIndex, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -53964,12 +54038,10 @@ class SetSeqAlign {
53964
54038
  if(!ic.chainsMapping[chainid2]) ic.chainsMapping[chainid2] = {};
53965
54039
 
53966
54040
  let posChain1 = {}, posChain2 = {};
53967
- console.log("###bRealign: " + bRealign);
53968
- console.log(ic.qt_start_end[chainIndex]);
53969
54041
 
53970
54042
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
53971
54043
  let start1, start2, end1, end2;
53972
- if(bRealign) { // real residue numbers are stored, could be "100a"
54044
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored, could be "100a"
53973
54045
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
53974
54046
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
53975
54047
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -53991,7 +54063,7 @@ console.log("###bRealign: " + bRealign);
53991
54063
 
53992
54064
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
53993
54065
  let start1, start2, end1, end2;
53994
- if(bRealign) { // real residue numbers are stored
54066
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
53995
54067
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
53996
54068
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
53997
54069
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -54013,8 +54085,9 @@ console.log("###bRealign: " + bRealign);
54013
54085
 
54014
54086
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
54015
54087
 
54016
- let resi = (bRealign) ? j : ic.chainsSeq[chainid1][j].resi;
54017
- let resn = (bRealign) ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54088
+ let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
54089
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54090
+ let resn = this.getResnFromResi(chainid1, resi).toLowerCase();
54018
54091
 
54019
54092
  if(resn == '?') continue;
54020
54093
 
@@ -54032,11 +54105,11 @@ console.log("###bRealign: " + bRealign);
54032
54105
  posChain2[j] = 1;
54033
54106
 
54034
54107
  if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54035
-
54036
- //let resi = ic.chainsSeq[chainid2][j].resi;
54037
- //let resn = ic.chainsSeq[chainid2][j].name.toLowerCase();
54038
- let resi = (bRealign) ? j : ic.chainsSeq[chainid2][j].resi;
54039
- let resn = (bRealign) ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
54108
+
54109
+ let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
54110
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
54111
+ let resn = this.getResnFromResi(chainid2, resi).toLowerCase();
54112
+
54040
54113
 
54041
54114
  if(resn == '?') continue;
54042
54115
 
@@ -54080,6 +54153,7 @@ console.log("###bRealign: " + bRealign);
54080
54153
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54081
54154
 
54082
54155
  let resi1, resi2, resn1, resn2;
54156
+ /*
54083
54157
  if(bRealign) { // tmalign: just one residue in this for loop
54084
54158
  if(me.cfg.aligntool == 'tmalign') {
54085
54159
  resi1 = ic.qt_start_end[chainIndex][i].t_start;
@@ -54093,15 +54167,30 @@ console.log("###bRealign: " + bRealign);
54093
54167
  resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54094
54168
  resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54095
54169
 
54170
+ if(resn1 == '?' || resn2 == '?') continue;
54171
+ }
54172
+ */
54173
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // tmalign: just one residue in this for loop
54174
+ resi1 = ic.qt_start_end[chainIndex][i].t_start;
54175
+ resi2 = ic.qt_start_end[chainIndex][i].q_start;
54176
+
54177
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54178
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54179
+
54096
54180
  if(resn1 == '?' || resn2 == '?') continue;
54097
54181
  }
54098
54182
  else {
54099
54183
  if(ic.chainsSeq[chainid1][j + start1] === undefined || ic.chainsSeq[chainid2][j + start2] === undefined) continue;
54100
54184
 
54101
- resi1 = ic.chainsSeq[chainid1][j + start1].resi;
54102
- resi2 = ic.chainsSeq[chainid2][j + start2].resi;
54103
- resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
54104
- resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
54185
+ // resi1 = ic.chainsSeq[chainid1][j + start1].resi;
54186
+ // resi2 = ic.chainsSeq[chainid2][j + start2].resi;
54187
+ // resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
54188
+ // resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
54189
+
54190
+ resi1 = this.getResiAferAlign(chainid1, bRealign, j + start1 + 1);
54191
+ resi2 = this.getResiAferAlign(chainid2, bRealign, j + start2 + 1);
54192
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54193
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54105
54194
  }
54106
54195
 
54107
54196
  if(resn1 === resn2) {
@@ -54404,9 +54493,9 @@ console.log("###bRealign: " + bRealign);
54404
54493
  return resn;
54405
54494
  }
54406
54495
 
54407
- getResnFromResid(resid) { let ic = this.icn3d; ic.icn3dui;
54408
- return ic.residueId2Name[resid];
54409
- }
54496
+ // getResnFromResid(resid) { let ic = this.icn3d, me = ic.icn3dui;
54497
+ // return ic.residueId2Name[resid];
54498
+ // }
54410
54499
 
54411
54500
  getResiPosInTemplate(chainid1, resi_t) { let ic = this.icn3d; ic.icn3dui;
54412
54501
  // check the number of gaps before resiStart1 (nGap), and insert 'notAlnLen2 - notAlnLen1 - nGap' gaps
@@ -54535,7 +54624,7 @@ console.log("###bRealign: " + bRealign);
54535
54624
 
54536
54625
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
54537
54626
  let start1, start2, end1, end2, resiStart1, start1Pos, end1Pos;
54538
- if(bRealign) { // real residue numbers are stored
54627
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
54539
54628
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
54540
54629
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
54541
54630
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -54619,8 +54708,8 @@ console.log("###bRealign: " + bRealign);
54619
54708
  else {
54620
54709
  let resi1 = (bRealign) ? start1 + k : ic.ParserUtilsCls.getResi(chainid1, start1 + k);
54621
54710
  let resi2 = (bRealign) ? start2 + k : ic.ParserUtilsCls.getResi(chainid2, start2 + k);
54622
- let resn1 = this.getResnFromResid(chainid1 + '_' + resi1); //this.getResn(chainid1, start1 + k);
54623
- let resn2 = this.getResnFromResid(chainid2 + '_' + resi2); //this.getResn(chainid2, start2 + k);
54711
+ let resn1 = this.getResnFromResi(chainid1, resi1); //this.getResn(chainid1, start1 + k);
54712
+ let resn2 = this.getResnFromResi(chainid2, resi2); //this.getResn(chainid2, start2 + k);
54624
54713
 
54625
54714
  let bAlign = true;
54626
54715
  let resObject = this.getResObject(chainid2, false, bAlign, resi2, resn2, resn1);
@@ -55883,6 +55972,7 @@ class Vastplus {
55883
55972
 
55884
55973
  let queryDataArray = [];
55885
55974
  for(let index = 0, indexl = chainidpairArray.length; index < indexl; ++index) {
55975
+ // let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
55886
55976
  let queryData = dataArray[index].value; //[0];
55887
55977
 
55888
55978
  queryDataArray.push(queryData);
@@ -60039,7 +60129,7 @@ class SelectByCommand {
60039
60129
  let residArray = [];
60040
60130
 
60041
60131
  if(bRefnum) {
60042
- let residArrayTmp = (ic.refnum2residArray[k]) ? ic.refnum2residArray[k] : [];
60132
+ let residArrayTmp = (ic.refnum2residArray[k.toString()]) ? ic.refnum2residArray[k.toString()] : [];
60043
60133
  for(let m = 0, ml = residArrayTmp.length; m < ml; ++m) {
60044
60134
  let residueId = residArrayTmp[m];
60045
60135
  if(residueId.substr(0, residueId.lastIndexOf('_')) == molecule_chain) {
@@ -62097,14 +62187,14 @@ class Dssp {
62097
62187
  }
62098
62188
  }
62099
62189
 
62100
- async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d; ic.icn3dui;
62190
+ async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
62101
62191
  //var dataArray =(struArray.length == 1) ? [data] : data;
62102
62192
 
62103
62193
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
62104
62194
  //var data2 = v2[0];
62105
62195
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
62106
62196
  //let ssHash = dataArray[index][0];
62107
- let ssHash = dataArray[index].value;
62197
+ let ssHash = (me.bNode) ? dataArray[index] : dataArray[index].value;
62108
62198
 
62109
62199
  if(ssHash !== undefined && JSON.stringify(ssHash).indexOf('Oops there was a problem') === -1) {
62110
62200
  for(let chainNum in ic.chainsSeq) {
@@ -62230,8 +62320,19 @@ class Dssp {
62230
62320
  ic.bShowRefnum = false;
62231
62321
 
62232
62322
  ic.hAtoms = {};
62233
- ic.bResetAnno = true;
62234
- await ic.showAnnoCls.showAnnotations();
62323
+ //ic.bResetAnno = true;
62324
+
62325
+ // await ic.showAnnoCls.showAnnotations();
62326
+ if(ic.bAnnoShown) {
62327
+ for(let chain in ic.protein_chainid) {
62328
+ let chainidBase = ic.protein_chainid[chain];
62329
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
62330
+ }
62331
+ }
62332
+ else {
62333
+ await ic.showAnnoCls.showAnnotations();
62334
+ }
62335
+
62235
62336
  ic.hlUpdateCls.updateHlAll();
62236
62337
  }
62237
62338
 
@@ -62268,7 +62369,7 @@ class Dssp {
62268
62369
  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
62370
 
62270
62371
  // round 2
62271
- ic.refpdbHash = {};
62372
+ ic.refpdbHash = {};
62272
62373
  ic.refpdbHash['NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
62273
62374
  ic.refpdbHash['C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1', 'BArrestin1_4jqiA_rat_n1'];
62274
62375
  ic.refpdbHash['Siglec3_5j0bB_human_C2-n2'] = ['Siglec3_5j0bB_human_C2-n2', 'CD2_1hnfA_human_C2-n2', 'GHR_1axiB_human_FN3-n1'];
@@ -62457,15 +62558,16 @@ class Dssp {
62457
62558
  domainAtomsArray.push(domainAtoms);
62458
62559
  }
62459
62560
  }
62460
- console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.length: " + domainAtomsArray.length);
62561
+
62461
62562
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
62462
62563
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
62463
- let domainid = chainid + '-' + k;
62564
+ // ig strand for any subset will have the same k, use the number of residue to separate them
62565
+ let domainid = chainid + '-' + k + '_' + domainAtomsArray[k].length;
62464
62566
  ic.domainid2pdb[domainid] = pdb_target;
62465
62567
 
62466
62568
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
62467
62569
  let struct2 = ic.defaultPdbId + index;
62468
- let pdb_query = dataArray[index].value; //[0];
62570
+ let pdb_query = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
62469
62571
  let header = 'HEADER ' + struct2 + '\n';
62470
62572
  pdb_query = header + pdb_query;
62471
62573
 
@@ -62504,20 +62606,20 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
62504
62606
  // find the best alignment for each chain
62505
62607
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
62506
62608
 
62507
- // if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
62508
- // if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
62509
- // if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
62510
- // if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
62609
+ if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
62610
+ if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
62611
+ if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
62612
+ if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
62511
62613
 
62512
- ic.chainid2refpdbname = {};
62513
- ic.domainid2refpdbname = {};
62514
- ic.domainid2ig2kabat = {};
62515
- ic.domainid2ig2imgt = {};
62614
+ // ic.chainid2refpdbname = {};
62615
+ // ic.domainid2refpdbname = {};
62616
+ // ic.domainid2ig2kabat = {};
62617
+ // ic.domainid2ig2imgt = {};
62516
62618
 
62517
62619
  let minResidues = 20;
62518
62620
 
62519
62621
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
62520
- let queryData = dataArray[i].value; //[0];
62622
+ let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
62521
62623
 
62522
62624
  if(!queryData) {
62523
62625
  if(!me.bNode) console.log("The alignment data for " + domainidpairArray[i] + " is unavailable...");
@@ -62592,7 +62694,6 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
62592
62694
  }
62593
62695
 
62594
62696
  if(!ic.refpdbHash[refpdbname]) {
62595
- console.log("### refpdbname: " + refpdbname);
62596
62697
  continue;
62597
62698
  }
62598
62699
 
@@ -62610,7 +62711,7 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
62610
62711
  let pdb_target = ic.domainid2pdb[domainid];
62611
62712
  for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
62612
62713
  let struct2 = ic.defaultPdbId + index;
62613
- let pdb_query = ic.pdbDataArray[index].value; //[0];
62714
+ let pdb_query = (me.bNode) ? ic.pdbDataArray[index] : ic.pdbDataArray[index].value; //[0];
62614
62715
  let header = 'HEADER ' + struct2 + '\n';
62615
62716
  pdb_query = header + pdb_query;
62616
62717
 
@@ -62707,8 +62808,17 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
62707
62808
 
62708
62809
  // open sequence view
62709
62810
  ic.hAtomsRefnum = {};
62710
- ic.bResetAnno = true;
62711
- await ic.showAnnoCls.showAnnotations();
62811
+ //ic.bResetAnno = true;
62812
+ if(ic.bAnnoShown) {
62813
+ for(let chain in ic.protein_chainid) {
62814
+ let chainidBase = ic.protein_chainid[chain];
62815
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
62816
+ }
62817
+ }
62818
+ else {
62819
+ await ic.showAnnoCls.showAnnotations();
62820
+ }
62821
+
62712
62822
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
62713
62823
  }
62714
62824
  else {
@@ -62833,7 +62943,7 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
62833
62943
  }
62834
62944
 
62835
62945
  rmStrandFromRefnumlabel(refnumLabel) {
62836
- return refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
62946
+ return (!refnumLabel) ? refnumLabel : refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
62837
62947
  }
62838
62948
  }
62839
62949
 
@@ -62894,6 +63004,8 @@ class Scap {
62894
63004
  async retrieveScap(snp, bInteraction, bPdb) { let ic = this.icn3d, me = ic.icn3dui;
62895
63005
  let thisClass = this;
62896
63006
 
63007
+ ic.bScap = true;
63008
+
62897
63009
  //snp: 6M0J_E_484_K,6M0J_E_501_Y,6M0J_E_417_N
62898
63010
  let snpStr = '';
62899
63011
  let snpArray = snp.split(','); //stru_chain_resi_snp
@@ -70817,7 +70929,7 @@ class iCn3DUI {
70817
70929
  //even when multiple iCn3D viewers are shown together.
70818
70930
  this.pre = this.cfg.divid + "_";
70819
70931
 
70820
- this.REVISION = '3.25.2';
70932
+ this.REVISION = '3.25.3';
70821
70933
 
70822
70934
  // In nodejs, iCn3D defines "window = {navigator: {}}"
70823
70935
  this.bNode = (Object.keys(window).length < 2) ? true : false;
@@ -71145,25 +71257,35 @@ iCn3DUI.prototype.show3DStructure = async function(pdbStr) { let me = this;
71145
71257
  let data = await me.getAjaxPromise(url, 'json', false, 'The RID ' + me.cfg.rid + ' may have expired...');
71146
71258
 
71147
71259
  for(let q = 0, ql = data.BlastOutput2.length; q < ql; ++q) {
71148
- if(data.BlastOutput2[q].report.results.search.query_id != me.cfg.query_id) continue;
71149
- let hitArray = data.BlastOutput2[q].report.results.search.hits;
71260
+
71261
+ let hitArray;
71262
+ if(data.BlastOutput2[q].report.results.iterations) { // psi-blast may have "iterations". Use the last iteration.
71263
+ let nIterations = data.BlastOutput2[q].report.results.iterations.length;
71264
+ if(data.BlastOutput2[q].report.results.iterations[nIterations - 1].search.query_id != me.cfg.query_id) continue;
71265
+ hitArray = data.BlastOutput2[q].report.results.iterations[nIterations - 1].search.hits;
71266
+ }
71267
+ else { // blastp may not have "iterations"
71268
+ if(data.BlastOutput2[q].report.results.search.query_id != me.cfg.query_id) continue;
71269
+ hitArray = data.BlastOutput2[q].report.results.search.hits;
71270
+ }
71271
+
71150
71272
  let qseq = undefined;
71151
71273
  for(let i = 0, il = hitArray.length; i < il; ++i) {
71152
- let hit = hitArray[i];
71153
- let bFound = false;
71154
- for(let j = 0, jl = hit.description.length; j < jl; ++j) {
71155
- let acc = hit.description[j].accession;
71156
- if(acc == me.cfg.blast_rep_id) {
71157
- bFound = true;
71158
- break;
71274
+ let hit = hitArray[i];
71275
+ let bFound = false;
71276
+ for(let j = 0, jl = hit.description.length; j < jl; ++j) {
71277
+ let acc = hit.description[j].accession;
71278
+ if(acc == me.cfg.blast_rep_id) {
71279
+ bFound = true;
71280
+ break;
71281
+ }
71282
+ }
71283
+ if(bFound) {
71284
+ qseq = hit.hsps[0].qseq;
71285
+ //remove gap '-'
71286
+ qseq = qseq.replace(/-/g, '');
71287
+ break;
71159
71288
  }
71160
- }
71161
- if(bFound) {
71162
- qseq = hit.hsps[0].qseq;
71163
- //remove gap '-'
71164
- qseq = qseq.replace(/-/g, '');
71165
- break;
71166
- }
71167
71289
  }
71168
71290
  if(qseq !== undefined) me.cfg.query_id = qseq;
71169
71291
  ic.inputid = me.cfg.query_id + '_' + me.cfg.blast_rep_id;