Package org.openscience.cdk.geometry
Class BondTools
- java.lang.Object
-
- org.openscience.cdk.geometry.BondTools
-
-
Constructor Summary
Constructors Constructor Description BondTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
closeEnoughToBond(IAtom atom1, IAtom atom2, double distanceFudgeFactor)
Returns true if the two atoms are within the distance fudge factor of each other.static double
giveAngle(IAtom from, IAtom to1, IAtom to2)
Calls giveAngleBothMethods with bool = true.static double
giveAngleBothMethods(javax.vecmath.Point2d from, javax.vecmath.Point2d to1, javax.vecmath.Point2d to2, boolean bool)
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.static double
giveAngleFromMiddle(IAtom from, IAtom to1, IAtom to2)
Calls giveAngleBothMethods with bool = false.static boolean
isCisTrans(IAtom firstOuterAtom, IAtom firstInnerAtom, IAtom secondInnerAtom, IAtom secondOuterAtom, IAtomContainer ac)
Says if two atoms are in cis or trans position around a double bond.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.static boolean
isSquarePlanar(IAtomContainer container, IAtom atom)
Says if an atom as a center of a square planar chirality.static boolean
isStereo(IAtomContainer container, IAtom stereoAtom)
Says if an atom as a center of any valid stereo configuration or not.static int
isTetrahedral(IAtomContainer container, IAtom atom, boolean strict)
Says if an atom as a center of a tetrahedral chirality.static int
isTrigonalBipyramidalOrOctahedral(IAtomContainer container, IAtom atom)
Says if an atom as a center of a trigonal-bipyramidal or actahedral chirality.static boolean
isValidDoubleBondConfiguration(IAtomContainer container, IBond bond)
Tells if a certain bond is center of a valid double bond configuration.static void
makeUpDownBonds(IAtomContainer container)
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.
-
-
-
Method Detail
-
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 returnedviewFrom
- The atom from which to lookviewTo
- 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 Parameteratom2
- Description of ParameterdistanceFudgeFactor
- 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 centercontainer
- 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 centercontainer
- 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 centercontainer
- 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 centercontainer
- 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 centercontainer
- 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 fromto1
- first direction to look into2
- 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 fromto1
- first direction to look into2
- second direction to look in- Returns:
- The angle in rad from -PI to PI
-
makeUpDownBonds
public static void makeUpDownBonds(IAtomContainer container)
-
-