Class BondTools

java.lang.Object
org.openscience.cdk.geometry.BondTools

public class BondTools extends Object
A set of static utility classes for geometric calculations on IBonds. The methods for detecting stereo configurations are described in CDK news, vol 2, p. 64 - 66.
Author:
shk3
Source code:
main
Belongs to CDK module:
standard
Created on:
2005-08-04
  • Constructor Details

    • BondTools

      public BondTools()
  • Method Details

    • isValidDoubleBondConfiguration

      public static boolean isValidDoubleBondConfiguration(IAtomContainer container, IBond bond)
      Tells if a certain bond is center of a valid double bond configuration.
      Parameters:
      container - The atomcontainer.
      bond - The bond.
      Returns:
      true=is a potential configuration, false=is not.
    • isCisTrans

      public static boolean isCisTrans(IAtom firstOuterAtom, IAtom firstInnerAtom, IAtom secondInnerAtom, IAtom secondOuterAtom, IAtomContainer ac) throws CDKException
      Says if two atoms are in cis or trans position around a double bond. The atoms have to be given to the method like this: firstOuterAtom - firstInnerAtom = secondInnterAtom - secondOuterAtom
      Parameters:
      firstOuterAtom - See above.
      firstInnerAtom - See above.
      secondInnerAtom - See above.
      secondOuterAtom - See above.
      ac - The atom container the atoms are in.
      Returns:
      true=trans, false=cis.
      Throws:
      CDKException - The atoms are not in a double bond configuration (no double bond in the middle, same atoms on one side)
    • isLeft

      public static boolean isLeft(IAtom whereIs, IAtom viewFrom, IAtom viewTo)
      Says if an atom is on the left side of a another atom seen from a certain atom or not.
      Parameters:
      whereIs - The atom the position of which is returned
      viewFrom - The atom from which to look
      viewTo - The atom to which to look
      Returns:
      true=is left, false = is not
    • closeEnoughToBond

      public static boolean closeEnoughToBond(IAtom atom1, IAtom atom2, double distanceFudgeFactor)
      Returns true if the two atoms are within the distance fudge factor of each other.
      Parameters:
      atom1 - Description of Parameter
      atom2 - Description of Parameter
      distanceFudgeFactor - Description of Parameter
      Returns:
      Description of the Returned Value
      Keywords:
      join-the-dots, bond creation
    • giveAngleBothMethods

      public static double giveAngleBothMethods(IAtom from, IAtom to1, IAtom to2, boolean bool)
      Gives the angle between two lines starting at atom from and going to to1 and to2. If bool=false the angle starts from the middle line and goes from 0 to PI or 0 to -PI if the to2 is on the left or right side of the line. If bool=true the angle goes from 0 to 2PI.
      Parameters:
      from - the atom to view from.
      to1 - first direction to look in.
      to2 - second direction to look in.
      bool - true=angle is 0 to 2PI, false=angel is -PI to PI.
      Returns:
      The angle in rad.
    • giveAngleBothMethods

      public static double giveAngleBothMethods(javax.vecmath.Point2d from, javax.vecmath.Point2d to1, javax.vecmath.Point2d to2, boolean bool)
    • isTetrahedral

      public static int isTetrahedral(IAtomContainer container, IAtom atom, boolean strict)
      Says if an atom as a center of a tetrahedral chirality. This method uses wedge bonds. 3D coordinates are not taken into account. If there are no wedge bonds around a potential stereo center, it will not be found.
      Parameters:
      atom - The atom which is the center
      container - The atomContainer the atom is in
      Returns:
      0=is not tetrahedral; >1 is a certain depiction of tetrahedrality (evaluated in parse chain)
    • isTrigonalBipyramidalOrOctahedral

      public static int isTrigonalBipyramidalOrOctahedral(IAtomContainer container, IAtom atom)
      Says if an atom as a center of a trigonal-bipyramidal or actahedral chirality. This method uses wedge bonds. 3D coordinates are not taken into account. If there are no wedge bonds around a potential stereo center, it will not be found.
      Parameters:
      atom - The atom which is the center
      container - The atomContainer the atom is in
      Returns:
      true=is square planar, false=is not
    • isStereo

      public static boolean isStereo(IAtomContainer container, IAtom stereoAtom)
      Says if an atom as a center of any valid stereo configuration or not. This method uses wedge bonds. 3D coordinates are not taken into account. If there are no wedge bonds around a potential stereo center, it will not be found.
      Parameters:
      stereoAtom - The atom which is the center
      container - The atomContainer the atom is in
      Returns:
      true=is a stereo atom, false=is not
    • isSquarePlanar

      public static boolean isSquarePlanar(IAtomContainer container, IAtom atom)
      Says if an atom as a center of a square planar chirality. This method uses wedge bonds. 3D coordinates are not taken into account. If there are no wedge bonds around a potential stereo center, it will not be found.
      Parameters:
      atom - The atom which is the center
      container - The atomContainer the atom is in
      Returns:
      true=is square planar, false=is not
    • stereosAreOpposite

      public static boolean stereosAreOpposite(IAtomContainer container, IAtom atom)
      Says if of four atoms connected two one atom the up and down bonds are opposite or not, i. e.if it's tetrehedral or square planar. The method does not check if there are four atoms and if two or up and two are down
      Parameters:
      atom - The atom which is the center
      container - The atomContainer the atom is in
      Returns:
      true=are opposite, false=are not
    • giveAngle

      public static double giveAngle(IAtom from, IAtom to1, IAtom to2)
      Calls giveAngleBothMethods with bool = true.
      Parameters:
      from - the atom to view from
      to1 - first direction to look in
      to2 - second direction to look in
      Returns:
      The angle in rad from 0 to 2*PI
    • giveAngleFromMiddle

      public static double giveAngleFromMiddle(IAtom from, IAtom to1, IAtom to2)
      Calls giveAngleBothMethods with bool = false.
      Parameters:
      from - the atom to view from
      to1 - first direction to look in
      to2 - second direction to look in
      Returns:
      The angle in rad from -PI to PI
    • makeUpDownBonds

      public static void makeUpDownBonds(IAtomContainer container)