icn3d 3.35.0 → 3.35.1

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
@@ -37305,7 +37305,6 @@ class HBond {
37305
37305
  //"threshold" is the maximum distance of hydrogen bonds and has the unit of angstrom.
37306
37306
  calculateChemicalHbonds(startAtoms, targetAtoms, threshold, bSaltbridge, type, bInternal) { let ic = this.icn3d, me = ic.icn3dui;
37307
37307
  if(Object.keys(startAtoms).length === 0 || Object.keys(targetAtoms).length === 0) return;
37308
-
37309
37308
  ic.resid2Residhash = {};
37310
37309
 
37311
37310
  let atomHbond = {};
@@ -37399,6 +37398,7 @@ class HBond {
37399
37398
  && (atom.name === 'N' || atom.name === 'O') && (atomHbond[j].name === 'O' || atomHbond[j].name === 'N') ) {
37400
37399
 
37401
37400
  if(atom.name === atomHbond[j].name) continue;
37401
+
37402
37402
  if(atom.structure == atomHbond[j].structure && atom.chain == atomHbond[j].chain && Math.abs(atom.resi - atomHbond[j].resi) <= 1) continue; // peptide bond
37403
37403
 
37404
37404
  // protein backbone hydrogen
@@ -50714,11 +50714,12 @@ class ShowInter {
50714
50714
  let firstSetAtoms, complement;
50715
50715
  firstSetAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
50716
50716
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
50717
- ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
50717
+ // let firstAtom = ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
50718
50718
 
50719
50719
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
50720
50720
  // let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
50721
50721
  let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
50722
+
50722
50723
  let commanddesc;
50723
50724
  if(bSaltbridge) {
50724
50725
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -51156,6 +51157,7 @@ class ViewInterPairs {
51156
51157
  if(!threshold || isNaN(threshold)) threshold = ic.tsHbond;
51157
51158
  if(!bHbondCalc) {
51158
51159
  ic.hAtoms = me.hashUtilsCls.cloneHash(prevHatoms);
51160
+
51159
51161
  ic.showInterCls.showHbonds(threshold, nameArray2, nameArray, bHbondCalc, undefined, type);
51160
51162
  }
51161
51163
  hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.hAtoms);
@@ -63800,6 +63802,7 @@ class LoadCIF {
63800
63802
  let id = (bcifid) ? bcifid : ic.defaultPdbId;
63801
63803
 
63802
63804
  let structure = id;
63805
+ let CSerial, prevCSerial, OSerial, prevOSerial;
63803
63806
 
63804
63807
  let bFirstAtom = true;
63805
63808
 
@@ -64249,19 +64252,23 @@ class LoadCIF {
64249
64252
  ssend: false // optional, used to show the end of secondary structures
64250
64253
  };
64251
64254
 
64252
- if(!atomDetails.het && atomDetails.name === 'C') ;
64253
- if(!atomDetails.het && atomDetails.name === 'O') ;
64255
+ if(!atomDetails.het && atomDetails.name === 'C') {
64256
+ CSerial = serial;
64257
+ }
64258
+ if(!atomDetails.het && atomDetails.name === 'O') {
64259
+ OSerial = serial;
64260
+ }
64254
64261
 
64255
64262
  // from DSSP C++ code
64256
- // if(!atomDetails.het && atomDetails.name === 'N' && prevCSerial !== undefined && prevOSerial !== undefined) {
64257
- // let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord);
64263
+ if(!atomDetails.het && atomDetails.name === 'N' && prevCSerial !== undefined && prevOSerial !== undefined) {
64264
+ let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord);
64258
64265
 
64259
- // let x2 = atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist;
64260
- // let y2 = atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist;
64261
- // let z2 = atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist;
64266
+ let x2 = atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist;
64267
+ let y2 = atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist;
64268
+ let z2 = atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist;
64262
64269
 
64263
- // atomDetails.hcoord = new THREE.Vector3(x2, y2, z2);
64264
- // }
64270
+ atomDetails.hcoord = new THREE.Vector3(x2, y2, z2);
64271
+ }
64265
64272
 
64266
64273
  ic.atoms[serial] = atomDetails;
64267
64274
 
@@ -64333,6 +64340,8 @@ class LoadCIF {
64333
64340
 
64334
64341
  // different chain
64335
64342
  if(chainNum !== prevChainNum) {
64343
+ prevCSerial = undefined;
64344
+ prevOSerial = undefined;
64336
64345
 
64337
64346
  // a chain could be separated in two sections
64338
64347
  if(serial !== 1 && prevChainNum !== '') {
@@ -64354,6 +64363,8 @@ class LoadCIF {
64354
64363
  ic.chainsSeq[chainNum].push(resObject);
64355
64364
  }
64356
64365
  else {
64366
+ prevCSerial = CSerial;
64367
+ prevOSerial = OSerial;
64357
64368
 
64358
64369
  let resObject = {};
64359
64370
  resObject.resi = resi;