icn3d 3.25.13 → 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.module.js CHANGED
@@ -33064,7 +33064,7 @@ class Alternate {
33064
33064
 
33065
33065
  ic.dAtoms = {};
33066
33066
 
33067
- let bMutation = moleculeArray.length == 2 && moleculeArray[1].replace(moleculeArray[0], '') == '2';
33067
+ let bMutation = ic.bScap; //moleculeArray.length == 2 && moleculeArray[1].replace(moleculeArray[0], '') == '2';
33068
33068
 
33069
33069
  for(let i = 0, il = moleculeArray.length; i < il; ++i) {
33070
33070
  let structure = moleculeArray[i];
@@ -36693,7 +36693,12 @@ class AnnoCddSite {
36693
36693
  || (Object.keys(ic.structures).length == 2 && me.cfg.align) ) {
36694
36694
  let data = {};
36695
36695
  try {
36696
- data.value = await me.getAjaxPromise(url, 'jsonp');
36696
+ if(me.bNode) {
36697
+ data = await me.getAjaxPromise(url, 'jsonp');
36698
+ }
36699
+ else {
36700
+ data.value = await me.getAjaxPromise(url, 'jsonp');
36701
+ }
36697
36702
 
36698
36703
  thisClass.parseCddData([data], chnidArray);
36699
36704
  /// if(ic.deferredAnnoCddSite !== undefined) ic.deferredAnnoCddSite.resolve();
@@ -36751,7 +36756,9 @@ class AnnoCddSite {
36751
36756
 
36752
36757
  for(let i = 0, il = dataArray.length; i < il; ++i) {
36753
36758
  //let data = (bSeq) ? dataArray[i][0] : dataArray[i];
36754
- let data = dataArray[i].value;
36759
+ let data = (me.bNode) ? dataArray[i] : dataArray[i].value;
36760
+
36761
+ if(!data) continue;
36755
36762
 
36756
36763
  for(let chainI = 0, chainLen = data.data.length; chainI < chainLen; ++chainI) {
36757
36764
  let cddData = data.data[chainI];
@@ -39493,49 +39500,48 @@ class Domain3d {
39493
39500
  let residueArray = Object.keys(residueHash);
39494
39501
  let chnid = residueArray[0].substr(0, residueArray[0].lastIndexOf('_'));
39495
39502
 
39503
+ if(!ic.posid2resid) ic.posid2resid = {};
39504
+
39496
39505
  let substructItem = {};
39497
39506
  let pos2resi = {};
39498
39507
  for(let i = 0; i < residueArray.length; ++i) {
39499
39508
  let resid = residueArray[i];
39500
39509
 
39501
39510
  let resi = resid.substr(resid.lastIndexOf('_') + 1);
39502
- /*
39503
- if(i == 0) {
39504
- resiOffset = resi - 1;
39505
-
39506
- for(let j = 0; j < resiOffset; ++j) {
39507
- x0.push(undefined);
39508
- y0.push(undefined);
39509
- z0.push(undefined);
39510
- }
39511
- }
39512
- */
39513
39511
 
39514
39512
  //let resid = chnid + "_" + resi;
39515
39513
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
39516
39514
 
39517
- if(!atom) continue;
39518
- /*
39519
39515
  if(atom) {
39520
39516
  x0.push(atom.coord.x);
39521
39517
  y0.push(atom.coord.y);
39522
39518
  z0.push(atom.coord.z);
39523
39519
  }
39524
39520
  else {
39525
- x0.push(undefined);
39526
- y0.push(undefined);
39527
- z0.push(undefined);
39521
+ // x0.push(dummyCoord);
39522
+ // y0.push(dummyCoord);
39523
+ // z0.push(dummyCoord);
39524
+
39525
+ continue;
39528
39526
  }
39529
- */
39530
- //if(!atom) continue;
39531
-
39532
- x0.push(atom.coord.x);
39533
- y0.push(atom.coord.y);
39534
- z0.push(atom.coord.z);
39527
+
39528
+ // if(!atom) {
39529
+ // // continue;
39530
+ // }
39531
+
39532
+ // x0.push(atom.coord.x);
39533
+ // y0.push(atom.coord.y);
39534
+ // z0.push(atom.coord.z);
39535
+
39535
39536
  //resiArray.push(resi);
39536
39537
  resiArray.push(i+1);
39537
39538
  pos2resi[i+1] = resi;
39538
39539
 
39540
+ ic.posid2resid[atom.structure + '_' + atom.chain + '_' + (i+1).toString()] = resid;
39541
+ // let residNCBI = ic.resid2ncbi[resid];
39542
+ // let pos = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
39543
+ // pos2resi[pos] = resi;
39544
+
39539
39545
  if(atom.ssend) {
39540
39546
  //substructItem.To = parseInt(resi);
39541
39547
  substructItem.To = i + 1;
@@ -39954,8 +39960,8 @@ class Domain3d {
39954
39960
  ic.tddomains[domainName][resid] = 1;
39955
39961
  }
39956
39962
  }
39957
- }
39958
-
39963
+ }
39964
+
39959
39965
  return {subdomains: subdomains, substruct: substruct, pos2resi: pos2resi };
39960
39966
  } // end c2b_NewSplitChain
39961
39967
 
@@ -39973,9 +39979,14 @@ class Domain3d {
39973
39979
  //the whole structure is also considered as a large domain
39974
39980
  //if(subdomains.length == 0) {
39975
39981
  //subdomains.push([parseInt(ic.chainsSeq[chnid][0].resi), parseInt(ic.chainsSeq[chnid][ic.chainsSeq[chnid].length - 1].resi)]);
39976
- subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
39977
- parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
39978
- //}
39982
+
39983
+ // subdomains.push([parseInt(residueArray[0].substr(residueArray[0].lastIndexOf('_') + 1)),
39984
+ // parseInt(residueArray[residueArray.length-1].substr(residueArray[residueArray.length-1].lastIndexOf('_') + 1))]);
39985
+
39986
+ // use position based
39987
+ subdomains.push([1, residueArray.length]);
39988
+
39989
+ //}
39979
39990
 
39980
39991
  // 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], ...]} ] }
39981
39992
  let jsonStr = '{"data": [';
@@ -39995,6 +40006,10 @@ class Domain3d {
39995
40006
  let from = pos2resi[substruct[k].From];
39996
40007
  let to = pos2resi[substruct[k].To];
39997
40008
 
40009
+ // 1-based residue numbers
40010
+ let fromPos = substruct[k].From;
40011
+ let toPos = substruct[k].To;
40012
+
39998
40013
  let residFrom = chnid + "_" + from;
39999
40014
  let atomFrom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residFrom]);
40000
40015
  if(!atomFrom || !ic.hAtoms.hasOwnProperty(atomFrom.serial)) continue;
@@ -40003,9 +40018,9 @@ class Domain3d {
40003
40018
  let atomTo = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[residTo]);
40004
40019
  if(!atomTo || !ic.hAtoms.hasOwnProperty(atomTo.serial)) continue;
40005
40020
 
40006
- if(from >= start && to <= end) {
40021
+ if(fromPos >= start && toPos <= end) {
40007
40022
  if(ssCnt > 0) jsonStr += ', ';
40008
- jsonStr += '[' + sstype + ',' + from + ',' + to + ',' + substruct[k].x1.toFixed(2) + ',' + substruct[k].y1.toFixed(2) + ','
40023
+ jsonStr += '[' + sstype + ',' + fromPos + ',' + toPos + ',' + substruct[k].x1.toFixed(2) + ',' + substruct[k].y1.toFixed(2) + ','
40009
40024
  + substruct[k].z1.toFixed(2) + ',' + substruct[k].x2.toFixed(2) + ',' + substruct[k].y2.toFixed(2) + ',' + substruct[k].z2.toFixed(2) + ']';
40010
40025
  ++ssCnt;
40011
40026
  }
@@ -40023,7 +40038,10 @@ class Domain3d {
40023
40038
  for(let k = 0, kl = residueArray.length; k < kl; ++k) {
40024
40039
  let resid = residueArray[k];
40025
40040
 
40026
- let resi = resid.substr(resid.lastIndexOf('_') + 1);
40041
+ // let resi = resid.substr(resid.lastIndexOf('_') + 1);
40042
+ // let residNCBI = ic.resid2ncbi[resid];
40043
+ // let pos = residNCBI.substr(residNCBI.lastIndexOf('_') + 1);
40044
+ let pos = k + 1;
40027
40045
 
40028
40046
  //let resid = chnid + "_" + resi;
40029
40047
  let atom = ic.firstAtomObjCls.getFirstCalphaAtomObj(ic.residues[resid]);
@@ -40033,9 +40051,9 @@ class Domain3d {
40033
40051
 
40034
40052
  //domain: resi, restype, x, y, z
40035
40053
  let restype = me.parasCls.resn2restype[atom.resn];
40036
- if(restype !== undefined && resi >= start && resi <= end) {
40054
+ if(restype !== undefined && pos >= start && pos <= end) {
40037
40055
  if(domainCnt > 0) jsonStr += ', ';
40038
- jsonStr += '[' + resi + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
40056
+ jsonStr += '[' + pos + ',' + restype + ',' + atom.coord.x.toFixed(2) + ','
40039
40057
  + atom.coord.y.toFixed(2) + ',' + atom.coord.z.toFixed(2) + ']';
40040
40058
  ++domainCnt;
40041
40059
  }
@@ -40865,7 +40883,7 @@ class AddTrack {
40865
40883
  let bUnion = false, bUpdateHighlight = true;
40866
40884
 
40867
40885
  let strandCnt = 0, loopCnt = 0;
40868
- let setName, currStrand, prevStrand, prevStrandReal, currType, prevType;
40886
+ let setName, currStrand, prevStrand, prevStrandReal = 'NT', currType, prevType;
40869
40887
 
40870
40888
  // clear selection
40871
40889
  ic.hAtoms = {};
@@ -40932,6 +40950,7 @@ class AddTrack {
40932
40950
  }
40933
40951
  else if(prevType == 'igloop') {
40934
40952
  ++loopCnt;
40953
+ currStrand = 'CT';
40935
40954
  setName = 'Loop-' + prevStrandReal + '_' + currStrand + '-' + chainid + '-' + loopCnt.toString().padStart(3, '0');
40936
40955
  setName = setName.replace(/'/g, '`');
40937
40956
  if(type == 'igloop') ic.selectionCls.selectResidueList(selectedResidues, setName, setName, bUnion, bUpdateHighlight);
@@ -43230,6 +43249,8 @@ class ShowSeq {
43230
43249
  // assign the adjusted reference numbers
43231
43250
  ic.resid2refnum[residueid] = refnumLabel;
43232
43251
 
43252
+ refnumStr = ic.refnumCls.rmStrandFromRefnumlabel(refnumLabel);
43253
+
43233
43254
  if(!ic.refnum2residArray.hasOwnProperty(refnumStr)) {
43234
43255
  ic.refnum2residArray[refnumStr] = [residueid];
43235
43256
  }
@@ -45411,7 +45432,8 @@ class GetGraph {
45411
45432
  let complement = firstSetAtoms;
45412
45433
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45413
45434
  let bSaltbridge = false;
45414
- ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
45435
+ // 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 );
45436
+ ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
45415
45437
  resid2ResidhashHbond = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45416
45438
  }
45417
45439
 
@@ -45428,7 +45450,8 @@ class GetGraph {
45428
45450
  let complement = firstSetAtoms;
45429
45451
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45430
45452
  let bSaltbridge = false;
45431
- ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
45453
+ // 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 );
45454
+ ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge, 'graph', true );
45432
45455
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45433
45456
  }
45434
45457
  let ionicStr = this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.ionicInsideColor, labelType, me.htmlCls.ionicInsideValue);
@@ -45441,19 +45464,22 @@ class GetGraph {
45441
45464
  let halogenpiStr = '', threshold;
45442
45465
  threshold = parseFloat($("#" + ic.pre + "halogenthreshold" ).val());
45443
45466
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45444
- ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), parseFloat(threshold), 'graph', 'halogen', true );
45467
+ // 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 );
45468
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'halogen', true );
45445
45469
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45446
45470
  }
45447
45471
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.halogenInsideColor, labelType, me.htmlCls.halogenInsideValue);
45448
45472
  threshold = parseFloat($("#" + ic.pre + "picationthreshold" ).val());
45449
45473
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45450
- 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 );
45474
+ // 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 );
45475
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-cation', true );
45451
45476
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45452
45477
  }
45453
45478
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.picationInsideColor, labelType, me.htmlCls.picationInsideValue);
45454
45479
  threshold = parseFloat($("#" + ic.pre + "pistackingthreshold" ).val());
45455
45480
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45456
- 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 );
45481
+ // 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 );
45482
+ ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), 'graph', 'pi-stacking', true );
45457
45483
  resid2Residhash = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45458
45484
  }
45459
45485
  halogenpiStr += this.getGraphLinks(resid2Residhash, resid2Residhash, me.htmlCls.pistackingInsideColor, labelType, me.htmlCls.pistackingInsideValue);
@@ -45611,6 +45637,15 @@ class ShowInter {
45611
45637
  async showInteractions(type) { let ic = this.icn3d, me = ic.icn3dui;
45612
45638
  let nameArray = $("#" + ic.pre + "atomsCustomHbond").val();
45613
45639
  let nameArray2 = $("#" + ic.pre + "atomsCustomHbond2").val();
45640
+
45641
+ let atoms, atoms2;
45642
+ atoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
45643
+ atoms2 = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
45644
+
45645
+ // add the interacting atoms to display
45646
+ ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms);
45647
+ ic.dAtoms = me.hashUtilsCls.unionHash(ic.dAtoms, atoms2);
45648
+
45614
45649
  if(nameArray2.length == 0) {
45615
45650
  alert("Please select the first set");
45616
45651
  }
@@ -45696,7 +45731,8 @@ class ShowInter {
45696
45731
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
45697
45732
 
45698
45733
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45699
- let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45734
+ // let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45735
+ let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45700
45736
  let commanddesc;
45701
45737
  if(bSaltbridge) {
45702
45738
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -45823,7 +45859,8 @@ class ShowInter {
45823
45859
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
45824
45860
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
45825
45861
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45826
- let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45862
+ // let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45863
+ let selectedAtoms = ic.saltbridgeCls.calculateIonicInteractions(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
45827
45864
  let commanddesc;
45828
45865
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45829
45866
  commanddesc = 'all atoms that have ionic interactions with the selected atoms';
@@ -45858,7 +45895,8 @@ class ShowInter {
45858
45895
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
45859
45896
  ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
45860
45897
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
45861
- 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 );
45898
+ // 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 );
45899
+ let selectedAtoms = ic.piHalogenCls.calculateHalogenPiInteractions(me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(complement, ic.atoms), parseFloat(threshold), type, interactionType );
45862
45900
  let commanddesc;
45863
45901
  if(interactionType == 'halogen') {
45864
45902
  ic.resid2ResidhashHalogen = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -45983,7 +46021,8 @@ class ShowInter {
45983
46021
  pickCustomSphere_base(radius, atomlistTarget, otherAtoms, bSphereCalc, bInteraction, type, select, bGetPairs, bIncludeTarget) { let ic = this.icn3d, me = ic.icn3dui; // ic.pAtom is set already
45984
46022
  let atoms;
45985
46023
  if(bInteraction) {
45986
- 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);
46024
+ // 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);
46025
+ atoms = ic.contactCls.getAtomsWithinAtom(me.hashUtilsCls.hash2Atoms(otherAtoms, ic.atoms), me.hashUtilsCls.hash2Atoms(atomlistTarget, ic.atoms), parseFloat(radius), bGetPairs, bInteraction, undefined, bIncludeTarget);
45987
46026
  ic.resid2ResidhashInteractions = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
45988
46027
  }
45989
46028
  else {
@@ -47694,8 +47733,8 @@ class AlignParser {
47694
47733
  let dataArray = await allPromise;
47695
47734
 
47696
47735
  let data2 = data;
47697
- let data3 = dataArray[0].value; //v3[0];
47698
- let data4 = dataArray[1].value; //v4[0];
47736
+ let data3 = (me.bNode) ? dataArray[0] : dataArray[0].value; //v3[0];
47737
+ let data4 = (me.bNode) ? dataArray[1] : dataArray[1].value; //v4[0];
47699
47738
 
47700
47739
  if(data3.atoms !== undefined && data4.atoms !== undefined) {
47701
47740
  // ic.deferredOpm = $.Deferred(function() {
@@ -47857,7 +47896,7 @@ class AlignParser {
47857
47896
 
47858
47897
  let bFound = false;
47859
47898
  for(let i = 0, il = dataArray.length; i < il; ++i) {
47860
- let opmdata = dataArray[i].value;
47899
+ let opmdata = (me.bNode) ? dataArray[i] : dataArray[i].value;
47861
47900
 
47862
47901
  if(!opmdata) continue;
47863
47902
 
@@ -48017,7 +48056,7 @@ class ChainalignParser {
48017
48056
 
48018
48057
  // modify the previous trans and rotation matrix
48019
48058
  for(let i = 0, il = dataArray.length; i < il; ++i) {
48020
- let align = dataArray[i].value;//[0];
48059
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
48021
48060
 
48022
48061
  let mmdbid_q = struArray[i];
48023
48062
  let index = indexArray[i];
@@ -48095,7 +48134,7 @@ class ChainalignParser {
48095
48134
  return hAtomsAll;
48096
48135
  }
48097
48136
 
48098
- downloadChainalignmentPart2bRealign(dataArray, chainidPairArray) { let ic = this.icn3d, me = ic.icn3dui;
48137
+ downloadChainalignmentPart2bRealign(dataArray, chainidPairArray, bReverse) { let ic = this.icn3d, me = ic.icn3dui;
48099
48138
  // set trans and rotation matrix
48100
48139
  ic.t_trans_add = [];
48101
48140
  ic.q_trans_sub = [];
@@ -48109,7 +48148,7 @@ class ChainalignParser {
48109
48148
 
48110
48149
  let bFoundAlignment = false;
48111
48150
  for(let i = 0, il = dataArray.length; i < il; ++i) {
48112
- let align = dataArray[i].value;//[0];
48151
+ let align = (me.bNode) ? dataArray[i] : dataArray[i].value;//[0];
48113
48152
 
48114
48153
  let bEqualMmdbid = false;
48115
48154
  let bEqualChain = false;
@@ -48137,9 +48176,16 @@ class ChainalignParser {
48137
48176
  }
48138
48177
 
48139
48178
  if(!bFoundAlignment) {
48140
- /// if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
48141
- if(ic.bRender) alert("These structures can NOT be aligned...");
48142
- return;
48179
+ // sometimes VAST align works for the reversed pair
48180
+ if(!bReverse) {
48181
+ ic.realignParserCls.realignOnStructAlign(true);
48182
+ return;
48183
+ }
48184
+ else {
48185
+ /// if(ic.deferredRealignByStruct !== undefined) ic.deferredRealignByStruct.resolve();
48186
+ if(ic.bRender) alert("These structures can NOT be aligned...");
48187
+ return;
48188
+ }
48143
48189
  }
48144
48190
 
48145
48191
  // find the max aligned mmdbid as mmdbid_t
@@ -48494,7 +48540,7 @@ class ChainalignParser {
48494
48540
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
48495
48541
  //var data2 = v2[0];
48496
48542
  // index = 0: the mmdb data of target
48497
- let targetData = dataArray[0].value; //[0];
48543
+ let targetData = (me.bNode) ? dataArray[0] : dataArray[0].value; //[0];
48498
48544
  let header = 'HEADER ' + mmdbid_t + '\n';
48499
48545
  if(isNaN(mmdbid_t) && mmdbid_t.length > 5) targetData = header + targetData;
48500
48546
 
@@ -48512,7 +48558,7 @@ class ChainalignParser {
48512
48558
  let queryDataArray = [];
48513
48559
 
48514
48560
  for(let index = 1, indexl = chainidArray.length; index < indexl; ++index) {
48515
- let queryData = dataArray[index].value;//[0];
48561
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
48516
48562
 
48517
48563
  let pos = chainidArray[index].indexOf('_');
48518
48564
  let mmdbid_q = chainidArray[index].substr(0, pos).toUpperCase();
@@ -48558,7 +48604,7 @@ class ChainalignParser {
48558
48604
  ic.qt_start_end[index-1] = undefined;
48559
48605
  }
48560
48606
  else {
48561
- let align = dataArray[index2 - missedChainCnt].value;//[0];
48607
+ let align = (me.bNode) ? dataArray[index2 - missedChainCnt] : dataArray[index2 - missedChainCnt].value;//[0];
48562
48608
 
48563
48609
  let bEqualMmdbid = (mmdbid_q == mmdbid_t);
48564
48610
  let bEqualChain = (chain_q == chain_t);
@@ -48776,7 +48822,7 @@ class ChainalignParser {
48776
48822
 
48777
48823
  let queryDataArray = [];
48778
48824
  for(let index = 0, indexl = structArray.length; index < indexl; ++index) {
48779
- let queryData = dataArray[index].value;//[0];
48825
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
48780
48826
  let header = 'HEADER ' + structArray[index] + '\n';
48781
48827
  if(isNaN(structArray[index]) && structArray[index].length > 5) queryData = header + queryData;
48782
48828
 
@@ -51228,7 +51274,7 @@ class RealignParser {
51228
51274
  //var data2 = v2[0];
51229
51275
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
51230
51276
  // for(let index = 1, indexl = dataArray.length; index < indexl; ++index) {
51231
- let data = dataArray[index].value;//[0];
51277
+ let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
51232
51278
  if(!data) continue;
51233
51279
 
51234
51280
  let fromStruct = chainidArray[index + 1].substr(0, chainidArray[index + 1].indexOf('_')); //.toUpperCase();
@@ -51411,7 +51457,7 @@ class RealignParser {
51411
51457
  await this.realignChainOnSeqAlign(undefined, chainidArray, bRealign);
51412
51458
  }
51413
51459
 
51414
- async realignOnStructAlign() { let ic = this.icn3d, me = ic.icn3dui;
51460
+ async realignOnStructAlign(bReverse) { let ic = this.icn3d, me = ic.icn3dui;
51415
51461
  // each 3D domain should have at least 3 secondary structures
51416
51462
  let minSseCnt = (me.cfg.aligntool != 'tmalign') ? 3 : 0;
51417
51463
  let struct2domain = {};
@@ -51438,6 +51484,8 @@ class RealignParser {
51438
51484
 
51439
51485
  //let cnt = 0;
51440
51486
  let structArray = Object.keys(struct2domain);
51487
+ if(bReverse) structArray = structArray.reverse();
51488
+
51441
51489
  for(let s = 0, sl = structArray.length; s < sl; ++s) {
51442
51490
  let struct1 = structArray[s];
51443
51491
  let chainidArray1 = Object.keys(struct2domain[struct1]);
@@ -51481,14 +51529,14 @@ class RealignParser {
51481
51529
  }
51482
51530
 
51483
51531
  let allPromise = Promise.allSettled(ajaxArray);
51484
- try {
51532
+ // try {
51485
51533
  let dataArray = await allPromise;
51486
51534
  ic.qt_start_end = []; // reset the alignment
51487
- await ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray);
51488
- }
51489
- catch(err) {
51490
- if(ic.bRender) alert("These structures can NOT be aligned to each other...");
51491
- }
51535
+ await ic.chainalignParserCls.downloadChainalignmentPart2bRealign(dataArray, chainidPairArray, bReverse);
51536
+ // }
51537
+ // catch(err) {
51538
+ // if(ic.bRender) alert("These structures can NOT be aligned to each other...");
51539
+ // }
51492
51540
  }
51493
51541
 
51494
51542
  async realignOnStructAlignMsa(nameArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -51550,7 +51598,7 @@ class RealignParser {
51550
51598
  }
51551
51599
 
51552
51600
  let allPromise = Promise.allSettled(ajaxArray);
51553
- try {
51601
+ // try {
51554
51602
  let dataArray = await allPromise;
51555
51603
 
51556
51604
  // set trans and rotation matrix
@@ -51564,10 +51612,10 @@ class RealignParser {
51564
51612
 
51565
51613
  await ic.chainalignParserCls.downloadChainalignmentPart2b(undefined, nameArray, undefined, dataArray,
51566
51614
  indexArray, struct1, struArray);
51567
- }
51568
- catch(err) {
51569
- if(ic.bRender) alert("These structures can NOT be aligned to each other...");
51570
- }
51615
+ // }
51616
+ // catch(err) {
51617
+ // if(ic.bRender) alert("These structures can NOT be aligned to each other...");
51618
+ // }
51571
51619
  }
51572
51620
 
51573
51621
  async realignChainOnSeqAlign(chainresiCalphaHash2, chainidArray, bRealign, bPredefined) { let ic = this.icn3d, me = ic.icn3dui;
@@ -53076,13 +53124,13 @@ class ParserUtils {
53076
53124
  let allPromise = Promise.allSettled([prms1, prms2]);
53077
53125
  let dataArray = await allPromise;
53078
53126
 
53079
- ic.interactionData1 = dataArray[0].value;
53127
+ ic.interactionData1 = (me.bNode) ? dataArray[0] : dataArray[0].value;
53080
53128
  ic.html2ddgm = '';
53081
53129
  ic.diagram2dCls.draw2Ddgm(ic.interactionData1, mmdbid1, 0);
53082
53130
  if(me.cfg.show2d) me.htmlCls.dialogCls.openDlg('dl_2ddgm', 'Interactions');
53083
53131
 
53084
53132
 
53085
- ic.interactionData2 = dataArray[1].value;
53133
+ ic.interactionData2 = (me.bNode) ? dataArray[1] : dataArray[1].value;
53086
53134
  ic.diagram2dCls.draw2Ddgm(ic.interactionData2, mmdbid2, 1);
53087
53135
 
53088
53136
  ic.html2ddgm += "<br>" + ic.diagram2dCls.set2DdgmNote(true);
@@ -53130,7 +53178,7 @@ class ParserUtils {
53130
53178
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
53131
53179
  //var data2 = v2[0];
53132
53180
  for(let index = 0, indexl = chainidArray.length; index < indexl; ++index) {
53133
- let data = dataArray[index].value;//[0];
53181
+ let data = (me.bNode) ? dataArray[index] : dataArray[index].value;//[0];
53134
53182
  let mmdbid = chainidArray[index].substr(0, chainidArray[index].indexOf('_'));
53135
53183
 
53136
53184
  ic.diagram2dCls.draw2Ddgm(data, mmdbid, 0);
@@ -54743,7 +54791,8 @@ class SetSeqAlign {
54743
54791
  return pos;
54744
54792
  }
54745
54793
 
54746
- getResnFromResi(chainid, resi) { let ic = this.icn3d, me = ic.icn3dui;
54794
+ getResnFromResi(chainid, resi) { let ic = this.icn3d; ic.icn3dui;
54795
+ /*
54747
54796
  let pos = this.getPosFromResi(chainid, resi);
54748
54797
  if(!pos) return '?';
54749
54798
 
@@ -54758,6 +54807,28 @@ class SetSeqAlign {
54758
54807
  }
54759
54808
 
54760
54809
  return resn;
54810
+ */
54811
+
54812
+ let resid = chainid + '_' + resi;
54813
+ return ic.residueId2Name[resid];
54814
+ }
54815
+
54816
+ getResiAferAlign(chainid, bRealign, pos) { let ic = this.icn3d, me = ic.icn3dui;
54817
+ let resi;
54818
+ if(bRealign && me.cfg.aligntool == 'tmalign') {
54819
+ resi = pos;
54820
+ }
54821
+ else {
54822
+ if(ic.posid2resid) {
54823
+ let resid = ic.posid2resid[chainid + '_' + pos];
54824
+ resi = resid.substr(resid.lastIndexOf('_') + 1);
54825
+ }
54826
+ else {
54827
+ resi = ic.chainsSeq[chainid][pos].resi;
54828
+ }
54829
+ }
54830
+
54831
+ return resi;
54761
54832
  }
54762
54833
 
54763
54834
  setSeqAlignChain(chainid, chainIndex, chainidArray) { let ic = this.icn3d, me = ic.icn3dui;
@@ -54865,12 +54936,10 @@ class SetSeqAlign {
54865
54936
  if(!ic.chainsMapping[chainid2]) ic.chainsMapping[chainid2] = {};
54866
54937
 
54867
54938
  let posChain1 = {}, posChain2 = {};
54868
- console.log("###bRealign: " + bRealign);
54869
- console.log(ic.qt_start_end[chainIndex]);
54870
54939
 
54871
54940
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
54872
54941
  let start1, start2, end1, end2;
54873
- if(bRealign) { // real residue numbers are stored, could be "100a"
54942
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored, could be "100a"
54874
54943
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
54875
54944
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
54876
54945
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -54892,7 +54961,7 @@ console.log("###bRealign: " + bRealign);
54892
54961
 
54893
54962
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
54894
54963
  let start1, start2, end1, end2;
54895
- if(bRealign) { // real residue numbers are stored
54964
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
54896
54965
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
54897
54966
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
54898
54967
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -54914,8 +54983,9 @@ console.log("###bRealign: " + bRealign);
54914
54983
 
54915
54984
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid1][j] === undefined) break;
54916
54985
 
54917
- let resi = (bRealign) ? j : ic.chainsSeq[chainid1][j].resi;
54918
- let resn = (bRealign) ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54986
+ let resi = this.getResiAferAlign(chainid1, bRealign, j + 1);
54987
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid1, j).toLowerCase() : ic.chainsSeq[chainid1][j].name.toLowerCase();
54988
+ let resn = this.getResnFromResi(chainid1, resi).toLowerCase();
54919
54989
 
54920
54990
  if(resn == '?') continue;
54921
54991
 
@@ -54933,11 +55003,11 @@ console.log("###bRealign: " + bRealign);
54933
55003
  posChain2[j] = 1;
54934
55004
 
54935
55005
  if(ic.chainsSeq[chainid2] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54936
-
54937
- //let resi = ic.chainsSeq[chainid2][j].resi;
54938
- //let resn = ic.chainsSeq[chainid2][j].name.toLowerCase();
54939
- let resi = (bRealign) ? j : ic.chainsSeq[chainid2][j].resi;
54940
- let resn = (bRealign) ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
55006
+
55007
+ let resi = this.getResiAferAlign(chainid2, bRealign, j + 1);
55008
+ // let resn = (bRealign && me.cfg.aligntool == 'tmalign') ? this.getResnFromResi(chainid2, j).toLowerCase() : ic.chainsSeq[chainid2][j].name.toLowerCase();
55009
+ let resn = this.getResnFromResi(chainid2, resi).toLowerCase();
55010
+
54941
55011
 
54942
55012
  if(resn == '?') continue;
54943
55013
 
@@ -54981,6 +55051,7 @@ console.log("###bRealign: " + bRealign);
54981
55051
  if(ic.chainsSeq[chainid1] === undefined || ic.chainsSeq[chainid2] === undefined) break;
54982
55052
 
54983
55053
  let resi1, resi2, resn1, resn2;
55054
+ /*
54984
55055
  if(bRealign) { // tmalign: just one residue in this for loop
54985
55056
  if(me.cfg.aligntool == 'tmalign') {
54986
55057
  resi1 = ic.qt_start_end[chainIndex][i].t_start;
@@ -54994,15 +55065,30 @@ console.log("###bRealign: " + bRealign);
54994
55065
  resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
54995
55066
  resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
54996
55067
 
55068
+ if(resn1 == '?' || resn2 == '?') continue;
55069
+ }
55070
+ */
55071
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // tmalign: just one residue in this for loop
55072
+ resi1 = ic.qt_start_end[chainIndex][i].t_start;
55073
+ resi2 = ic.qt_start_end[chainIndex][i].q_start;
55074
+
55075
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
55076
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
55077
+
54997
55078
  if(resn1 == '?' || resn2 == '?') continue;
54998
55079
  }
54999
55080
  else {
55000
55081
  if(ic.chainsSeq[chainid1][j + start1] === undefined || ic.chainsSeq[chainid2][j + start2] === undefined) continue;
55001
55082
 
55002
- resi1 = ic.chainsSeq[chainid1][j + start1].resi;
55003
- resi2 = ic.chainsSeq[chainid2][j + start2].resi;
55004
- resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
55005
- resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
55083
+ // resi1 = ic.chainsSeq[chainid1][j + start1].resi;
55084
+ // resi2 = ic.chainsSeq[chainid2][j + start2].resi;
55085
+ // resn1 = ic.chainsSeq[chainid1][j + start1].name.toUpperCase();
55086
+ // resn2 = ic.chainsSeq[chainid2][j + start2].name.toUpperCase();
55087
+
55088
+ resi1 = this.getResiAferAlign(chainid1, bRealign, j + start1 + 1);
55089
+ resi2 = this.getResiAferAlign(chainid2, bRealign, j + start2 + 1);
55090
+ resn1 = this.getResnFromResi(chainid1, resi1).toUpperCase();
55091
+ resn2 = this.getResnFromResi(chainid2, resi2).toUpperCase();
55006
55092
  }
55007
55093
 
55008
55094
  if(resn1 === resn2) {
@@ -55305,9 +55391,9 @@ console.log("###bRealign: " + bRealign);
55305
55391
  return resn;
55306
55392
  }
55307
55393
 
55308
- getResnFromResid(resid) { let ic = this.icn3d; ic.icn3dui;
55309
- return ic.residueId2Name[resid];
55310
- }
55394
+ // getResnFromResid(resid) { let ic = this.icn3d, me = ic.icn3dui;
55395
+ // return ic.residueId2Name[resid];
55396
+ // }
55311
55397
 
55312
55398
  getResiPosInTemplate(chainid1, resi_t) { let ic = this.icn3d; ic.icn3dui;
55313
55399
  // check the number of gaps before resiStart1 (nGap), and insert 'notAlnLen2 - notAlnLen1 - nGap' gaps
@@ -55436,7 +55522,7 @@ console.log("###bRealign: " + bRealign);
55436
55522
 
55437
55523
  for(let i = 0, il = ic.qt_start_end[chainIndex].length; i < il; ++i) {
55438
55524
  let start1, start2, end1, end2, resiStart1, start1Pos, end1Pos;
55439
- if(bRealign) { // real residue numbers are stored
55525
+ if(bRealign && me.cfg.aligntool == 'tmalign') { // real residue numbers are stored
55440
55526
  start1 = parseInt(ic.qt_start_end[chainIndex][i].t_start);
55441
55527
  start2 = parseInt(ic.qt_start_end[chainIndex][i].q_start);
55442
55528
  end1 = parseInt(ic.qt_start_end[chainIndex][i].t_end);
@@ -55520,8 +55606,8 @@ console.log("###bRealign: " + bRealign);
55520
55606
  else {
55521
55607
  let resi1 = (bRealign) ? start1 + k : ic.ParserUtilsCls.getResi(chainid1, start1 + k);
55522
55608
  let resi2 = (bRealign) ? start2 + k : ic.ParserUtilsCls.getResi(chainid2, start2 + k);
55523
- let resn1 = this.getResnFromResid(chainid1 + '_' + resi1); //this.getResn(chainid1, start1 + k);
55524
- let resn2 = this.getResnFromResid(chainid2 + '_' + resi2); //this.getResn(chainid2, start2 + k);
55609
+ let resn1 = this.getResnFromResi(chainid1, resi1); //this.getResn(chainid1, start1 + k);
55610
+ let resn2 = this.getResnFromResi(chainid2, resi2); //this.getResn(chainid2, start2 + k);
55525
55611
 
55526
55612
  let bAlign = true;
55527
55613
  let resObject = this.getResObject(chainid2, false, bAlign, resi2, resn2, resn1);
@@ -56784,7 +56870,7 @@ class Vastplus {
56784
56870
 
56785
56871
  let queryDataArray = [];
56786
56872
  for(let index = 0, indexl = chainidpairArray.length; index < indexl; ++index) {
56787
- let queryData = dataArray[index].value; //[0];
56873
+ let queryData = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
56788
56874
 
56789
56875
  queryDataArray.push(queryData);
56790
56876
  /*
@@ -60940,7 +61026,7 @@ class SelectByCommand {
60940
61026
  let residArray = [];
60941
61027
 
60942
61028
  if(bRefnum) {
60943
- let residArrayTmp = (ic.refnum2residArray[k]) ? ic.refnum2residArray[k] : [];
61029
+ let residArrayTmp = (ic.refnum2residArray[k.toString()]) ? ic.refnum2residArray[k.toString()] : [];
60944
61030
  for(let m = 0, ml = residArrayTmp.length; m < ml; ++m) {
60945
61031
  let residueId = residArrayTmp[m];
60946
61032
  if(residueId.substr(0, residueId.lastIndexOf('_')) == molecule_chain) {
@@ -62998,14 +63084,14 @@ class Dssp {
62998
63084
  }
62999
63085
  }
63000
63086
 
63001
- async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d; ic.icn3dui;
63087
+ async parseDsspData(dataArray, struArray, bAppend) { let ic = this.icn3d, me = ic.icn3dui;
63002
63088
  //var dataArray =(struArray.length == 1) ? [data] : data;
63003
63089
 
63004
63090
  // Each argument is an array with the following structure: [ data, statusText, jqXHR ]
63005
63091
  //var data2 = v2[0];
63006
63092
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
63007
63093
  //let ssHash = dataArray[index][0];
63008
- let ssHash = dataArray[index].value;
63094
+ let ssHash = (me.bNode) ? dataArray[index] : dataArray[index].value;
63009
63095
 
63010
63096
  if(ssHash !== undefined && JSON.stringify(ssHash).indexOf('Oops there was a problem') === -1) {
63011
63097
  for(let chainNum in ic.chainsSeq) {
@@ -63131,8 +63217,19 @@ class Dssp {
63131
63217
  ic.bShowRefnum = false;
63132
63218
 
63133
63219
  ic.hAtoms = {};
63134
- ic.bResetAnno = true;
63135
- await ic.showAnnoCls.showAnnotations();
63220
+ //ic.bResetAnno = true;
63221
+
63222
+ // await ic.showAnnoCls.showAnnotations();
63223
+ if(ic.bAnnoShown) {
63224
+ for(let chain in ic.protein_chainid) {
63225
+ let chainidBase = ic.protein_chainid[chain];
63226
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
63227
+ }
63228
+ }
63229
+ else {
63230
+ await ic.showAnnoCls.showAnnotations();
63231
+ }
63232
+
63136
63233
  ic.hlUpdateCls.updateHlAll();
63137
63234
  }
63138
63235
 
@@ -63169,7 +63266,7 @@ class Dssp {
63169
63266
  ic.refpdbArray = ['NaCaExchanger_2fwuA_dog_n2', 'C3_2qkiD_human_n1', 'Siglec3_5j0bB_human_C2-n2', 'ICOS_6x4gA_human_V', 'B2Microglobulin_7phrL_human_C1', 'VTCN1_Q7Z7D3_human_V-n2', 'Contactin1_2ee2A_human_FN3-n9', 'InsulinR_8guyE_human_FN3-n1', 'JAM1_1nbqA_human_VorIset-n2', 'LAG3_7tzgD_human_C2-n2', 'Palladin_2dm3A_human_Iset-n1', 'PD1_4zqkB_human_V', 'CD8a_1cd8A_human_V', 'VISTA_6oilA_human_V', 'LAG3_7tzgD_human_V-n1', 'TP47_1o75A_bacteria', 'TP34_2o6cA_bacteria', 'TEAD1_3kysC_human', 'RBPJ_6py8C_human_Unk-n2', 'TCRa_6jxrm_human_C1-n2', 'IsdA_2iteA_bacteria', 'LaminAC_1ifrA_human', 'CD19_6al5A_human_C2orV-n1'];
63170
63267
 
63171
63268
  // round 2
63172
- ic.refpdbHash = {};
63269
+ ic.refpdbHash = {};
63173
63270
  ic.refpdbHash['NaCaExchanger_2fwuA_dog_n2'] = ['NaCaExchanger_2fwuA_dog_n2', 'ORF7a_1xakA_virus', 'ECadherin_4zt1A_human_n2', 'NaKATPaseTransporterBeta_2zxeB_spurdogshark'];
63174
63271
  ic.refpdbHash['C3_2qkiD_human_n1'] = ['C3_2qkiD_human_n1', 'RBPJ_6py8C_human_Unk-n1', 'BArrestin1_4jqiA_rat_n1'];
63175
63272
  ic.refpdbHash['Siglec3_5j0bB_human_C2-n2'] = ['Siglec3_5j0bB_human_C2-n2', 'CD2_1hnfA_human_C2-n2', 'GHR_1axiB_human_FN3-n1'];
@@ -63358,15 +63455,16 @@ class Dssp {
63358
63455
  domainAtomsArray.push(domainAtoms);
63359
63456
  }
63360
63457
  }
63361
- console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.length: " + domainAtomsArray.length);
63458
+
63362
63459
  for(let k = 0, kl = domainAtomsArray.length; k < kl; ++k) {
63363
63460
  let pdb_target = ic.saveFileCls.getAtomPDB(domainAtomsArray[k], undefined, undefined, undefined, undefined, struct);
63364
- let domainid = chainid + '-' + k;
63461
+ // ig strand for any subset will have the same k, use the number of residue to separate them
63462
+ let domainid = chainid + '-' + k + '_' + domainAtomsArray[k].length;
63365
63463
  ic.domainid2pdb[domainid] = pdb_target;
63366
63464
 
63367
63465
  for(let index = 0, indexl = dataArray.length; index < indexl; ++index) {
63368
63466
  let struct2 = ic.defaultPdbId + index;
63369
- let pdb_query = dataArray[index].value; //[0];
63467
+ let pdb_query = (me.bNode) ? dataArray[index] : dataArray[index].value; //[0];
63370
63468
  let header = 'HEADER ' + struct2 + '\n';
63371
63469
  pdb_query = header + pdb_query;
63372
63470
 
@@ -63405,20 +63503,20 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
63405
63503
  // find the best alignment for each chain
63406
63504
  let domainid2score = {}, domainid2segs = {}, chainid2segs = {};
63407
63505
 
63408
- // if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
63409
- // if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
63410
- // if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
63411
- // if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
63506
+ if(!ic.chainid2refpdbname) ic.chainid2refpdbname = {};
63507
+ if(!ic.domainid2refpdbname) ic.domainid2refpdbname = {};
63508
+ if(!ic.domainid2ig2kabat) ic.domainid2ig2kabat = {};
63509
+ if(!ic.domainid2ig2imgt) ic.domainid2ig2imgt = {};
63412
63510
 
63413
- ic.chainid2refpdbname = {};
63414
- ic.domainid2refpdbname = {};
63415
- ic.domainid2ig2kabat = {};
63416
- ic.domainid2ig2imgt = {};
63511
+ // ic.chainid2refpdbname = {};
63512
+ // ic.domainid2refpdbname = {};
63513
+ // ic.domainid2ig2kabat = {};
63514
+ // ic.domainid2ig2imgt = {};
63417
63515
 
63418
63516
  let minResidues = 20;
63419
63517
 
63420
63518
  for(let i = 0, il = domainidpairArray.length; i < il; ++i) {
63421
- let queryData = dataArray[i].value; //[0];
63519
+ let queryData = (me.bNode) ? dataArray[i] : dataArray[i].value; //[0];
63422
63520
 
63423
63521
  if(!queryData) {
63424
63522
  if(!me.bNode) console.log("The alignment data for " + domainidpairArray[i] + " is unavailable...");
@@ -63493,7 +63591,6 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
63493
63591
  }
63494
63592
 
63495
63593
  if(!ic.refpdbHash[refpdbname]) {
63496
- console.log("### refpdbname: " + refpdbname);
63497
63594
  continue;
63498
63595
  }
63499
63596
 
@@ -63511,7 +63608,7 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
63511
63608
  let pdb_target = ic.domainid2pdb[domainid];
63512
63609
  for(let index = 0, indexl = ic.pdbDataArray.length; index < indexl; ++index) {
63513
63610
  let struct2 = ic.defaultPdbId + index;
63514
- let pdb_query = ic.pdbDataArray[index].value; //[0];
63611
+ let pdb_query = (me.bNode) ? ic.pdbDataArray[index] : ic.pdbDataArray[index].value; //[0];
63515
63612
  let header = 'HEADER ' + struct2 + '\n';
63516
63613
  pdb_query = header + pdb_query;
63517
63614
 
@@ -63608,8 +63705,17 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
63608
63705
 
63609
63706
  // open sequence view
63610
63707
  ic.hAtomsRefnum = {};
63611
- ic.bResetAnno = true;
63612
- await ic.showAnnoCls.showAnnotations();
63708
+ //ic.bResetAnno = true;
63709
+ if(ic.bAnnoShown) {
63710
+ for(let chain in ic.protein_chainid) {
63711
+ let chainidBase = ic.protein_chainid[chain];
63712
+ ic.showSeqCls.showSeq(chain, chainidBase, 'protein');
63713
+ }
63714
+ }
63715
+ else {
63716
+ await ic.showAnnoCls.showAnnotations();
63717
+ }
63718
+
63613
63719
  ic.annotationCls.setAnnoViewAndDisplay('detailed view');
63614
63720
  }
63615
63721
  else {
@@ -63734,7 +63840,7 @@ console.log("###subdomains.length: " + subdomains.length + " domainAtomsArray.le
63734
63840
  }
63735
63841
 
63736
63842
  rmStrandFromRefnumlabel(refnumLabel) {
63737
- return refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
63843
+ return (!refnumLabel) ? refnumLabel : refnumLabel.replace(/'/g, '').replace(/\*/g, '').replace(/\^/g, '').replace(/\+/g, '').replace(/\-/g, '').substr(1); // C', C''
63738
63844
  }
63739
63845
  }
63740
63846
 
@@ -63795,6 +63901,8 @@ class Scap {
63795
63901
  async retrieveScap(snp, bInteraction, bPdb) { let ic = this.icn3d, me = ic.icn3dui;
63796
63902
  let thisClass = this;
63797
63903
 
63904
+ ic.bScap = true;
63905
+
63798
63906
  //snp: 6M0J_E_484_K,6M0J_E_501_Y,6M0J_E_417_N
63799
63907
  let snpStr = '';
63800
63908
  let snpArray = snp.split(','); //stru_chain_resi_snp
@@ -71718,7 +71826,7 @@ class iCn3DUI {
71718
71826
  //even when multiple iCn3D viewers are shown together.
71719
71827
  this.pre = this.cfg.divid + "_";
71720
71828
 
71721
- this.REVISION = '3.25.2';
71829
+ this.REVISION = '3.25.3';
71722
71830
 
71723
71831
  // In nodejs, iCn3D defines "window = {navigator: {}}"
71724
71832
  this.bNode = (Object.keys(window).length < 2) ? true : false;