Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
thsa committed Sep 23, 2024
1 parent fc91f65 commit 1f6142b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ public boolean locateDelocalizedDoubleBonds(boolean[] isAromaticBond, boolean ma
}
}

if (!bondsPromoted) {

if (bondsPromoted) {
promoteObviousBonds();
continue;
}

if (!bondsPromoted) {
// find and promote one aromatic bond
// (should never happen, but to prevent an endless loop nonetheless)
for (int bond=0; bond<mMol.getBonds(); bond++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,9 @@ public void parse(StereoMolecule mol, byte[] idcode, byte[] coordinates, int idc
mMol.setAtomY(hydrogen, mMol.getAtomY(atom) + (decodeBits(resolutionBits) - binCount / 2.0));
if (coordsAre3D)
mMol.setAtomZ(hydrogen, mMol.getAtomZ(atom) + (decodeBits(resolutionBits) - binCount / 2.0));

if (mMol.isSelectedAtom(atom))
mMol.setAtomSelection(hydrogen, true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public float[] calculateBondFlexibilities(StereoMolecule mol, boolean[] isRotata
}

if (!mol.isAromaticBond(bond)) {
bondFlexibility[bond] = calculateBondFlexibility(torsion, frequency, range);
bondFlexibility[bond] = (torsion == null) ? 1f : calculateBondFlexibility(torsion, frequency, range);

// we need to reduce in rings increasingly with ring size, because flexibility is hampered
if (mol.isRingBond(bond))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import com.actelion.research.chem.conf.TorsionDescriptor;

public class Fragment3D implements Comparable<Fragment3D> {
private String mIDCode,mIDCoords;
private TorsionDescriptor mTorsions;
private int[] mExitAtoms;
private final String mIDCode;
private String mIDCoords;
private final TorsionDescriptor mTorsions;
private final int[] mExitAtoms;

public Fragment3D(String idcode, String coords, TorsionDescriptor td, int[] exitAtoms) {
this.mIDCode = idcode;
Expand Down

0 comments on commit 1f6142b

Please sign in to comment.