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.module.js CHANGED
@@ -38206,7 +38206,6 @@ class HBond {
38206
38206
  //"threshold" is the maximum distance of hydrogen bonds and has the unit of angstrom.
38207
38207
  calculateChemicalHbonds(startAtoms, targetAtoms, threshold, bSaltbridge, type, bInternal) { let ic = this.icn3d, me = ic.icn3dui;
38208
38208
  if(Object.keys(startAtoms).length === 0 || Object.keys(targetAtoms).length === 0) return;
38209
-
38210
38209
  ic.resid2Residhash = {};
38211
38210
 
38212
38211
  let atomHbond = {};
@@ -38300,6 +38299,7 @@ class HBond {
38300
38299
  && (atom.name === 'N' || atom.name === 'O') && (atomHbond[j].name === 'O' || atomHbond[j].name === 'N') ) {
38301
38300
 
38302
38301
  if(atom.name === atomHbond[j].name) continue;
38302
+
38303
38303
  if(atom.structure == atomHbond[j].structure && atom.chain == atomHbond[j].chain && Math.abs(atom.resi - atomHbond[j].resi) <= 1) continue; // peptide bond
38304
38304
 
38305
38305
  // protein backbone hydrogen
@@ -51615,11 +51615,12 @@ class ShowInter {
51615
51615
  let firstSetAtoms, complement;
51616
51616
  firstSetAtoms = ic.definedSetsCls.getAtomsFromNameArray(nameArray2);
51617
51617
  complement = ic.definedSetsCls.getAtomsFromNameArray(nameArray);
51618
- ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
51618
+ // let firstAtom = ic.firstAtomObjCls.getFirstAtomObj(firstSetAtoms);
51619
51619
 
51620
51620
  if(Object.keys(complement).length > 0 && Object.keys(firstSetAtoms).length > 0) {
51621
51621
  // let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.intHash2Atoms(ic.dAtoms, complement, ic.atoms), me.hashUtilsCls.intHash2Atoms(ic.dAtoms, firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
51622
51622
  let selectedAtoms = ic.hBondCls.calculateChemicalHbonds(me.hashUtilsCls.hash2Atoms(complement, ic.atoms), me.hashUtilsCls.hash2Atoms(firstSetAtoms, ic.atoms), parseFloat(threshold), bSaltbridge );
51623
+
51623
51624
  let commanddesc;
51624
51625
  if(bSaltbridge) {
51625
51626
  ic.resid2ResidhashSaltbridge = me.hashUtilsCls.cloneHash(ic.resid2Residhash);
@@ -52057,6 +52058,7 @@ class ViewInterPairs {
52057
52058
  if(!threshold || isNaN(threshold)) threshold = ic.tsHbond;
52058
52059
  if(!bHbondCalc) {
52059
52060
  ic.hAtoms = me.hashUtilsCls.cloneHash(prevHatoms);
52061
+
52060
52062
  ic.showInterCls.showHbonds(threshold, nameArray2, nameArray, bHbondCalc, undefined, type);
52061
52063
  }
52062
52064
  hAtoms = me.hashUtilsCls.unionHash(hAtoms, ic.hAtoms);
@@ -64701,6 +64703,7 @@ class LoadCIF {
64701
64703
  let id = (bcifid) ? bcifid : ic.defaultPdbId;
64702
64704
 
64703
64705
  let structure = id;
64706
+ let CSerial, prevCSerial, OSerial, prevOSerial;
64704
64707
 
64705
64708
  let bFirstAtom = true;
64706
64709
 
@@ -65150,19 +65153,23 @@ class LoadCIF {
65150
65153
  ssend: false // optional, used to show the end of secondary structures
65151
65154
  };
65152
65155
 
65153
- if(!atomDetails.het && atomDetails.name === 'C') ;
65154
- if(!atomDetails.het && atomDetails.name === 'O') ;
65156
+ if(!atomDetails.het && atomDetails.name === 'C') {
65157
+ CSerial = serial;
65158
+ }
65159
+ if(!atomDetails.het && atomDetails.name === 'O') {
65160
+ OSerial = serial;
65161
+ }
65155
65162
 
65156
65163
  // from DSSP C++ code
65157
- // if(!atomDetails.het && atomDetails.name === 'N' && prevCSerial !== undefined && prevOSerial !== undefined) {
65158
- // let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord);
65164
+ if(!atomDetails.het && atomDetails.name === 'N' && prevCSerial !== undefined && prevOSerial !== undefined) {
65165
+ let dist = ic.atoms[prevCSerial].coord.distanceTo(ic.atoms[prevOSerial].coord);
65159
65166
 
65160
- // let x2 = atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist;
65161
- // let y2 = atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist;
65162
- // let z2 = atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist;
65167
+ let x2 = atomDetails.coord.x + (ic.atoms[prevCSerial].coord.x - ic.atoms[prevOSerial].coord.x) / dist;
65168
+ let y2 = atomDetails.coord.y + (ic.atoms[prevCSerial].coord.y - ic.atoms[prevOSerial].coord.y) / dist;
65169
+ let z2 = atomDetails.coord.z + (ic.atoms[prevCSerial].coord.z - ic.atoms[prevOSerial].coord.z) / dist;
65163
65170
 
65164
- // atomDetails.hcoord = new THREE.Vector3(x2, y2, z2);
65165
- // }
65171
+ atomDetails.hcoord = new THREE.Vector3(x2, y2, z2);
65172
+ }
65166
65173
 
65167
65174
  ic.atoms[serial] = atomDetails;
65168
65175
 
@@ -65234,6 +65241,8 @@ class LoadCIF {
65234
65241
 
65235
65242
  // different chain
65236
65243
  if(chainNum !== prevChainNum) {
65244
+ prevCSerial = undefined;
65245
+ prevOSerial = undefined;
65237
65246
 
65238
65247
  // a chain could be separated in two sections
65239
65248
  if(serial !== 1 && prevChainNum !== '') {
@@ -65255,6 +65264,8 @@ class LoadCIF {
65255
65264
  ic.chainsSeq[chainNum].push(resObject);
65256
65265
  }
65257
65266
  else {
65267
+ prevCSerial = CSerial;
65268
+ prevOSerial = OSerial;
65258
65269
 
65259
65270
  let resObject = {};
65260
65271
  resObject.resi = resi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icn3d",
3
- "version": "3.35.0",
3
+ "version": "3.35.1",
4
4
  "main": "./icn3d.js",
5
5
  "exports": {
6
6
  ".": {