Package org.openscience.cdk.tools
Class AtomTypeAwareSaturationChecker
java.lang.Object
org.openscience.cdk.tools.AtomTypeAwareSaturationChecker
- All Implemented Interfaces:
IDeduceBondOrderTool
,IValencyChecker
public class AtomTypeAwareSaturationChecker
extends Object
implements IValencyChecker, IDeduceBondOrderTool
This class tries to figure out the bond order of the bonds that has the flag
The code is written with the assumption that the properties of the atoms in the molecule has configured with the help of
If it can't find a solution where all atoms in the molecule are saturated, it gives a "best guess", i.e. the solution with most saturated atoms. If not all atoms are saturated then it will be noticed as a warning in the log.
SINGLE_OR_DOUBLE
raised (i.e. set to true
).The code is written with the assumption that the properties of the atoms in the molecule has configured with the help of
AtomContainerManipulator
.
This class uses the SaturationChecker
internally.If it can't find a solution where all atoms in the molecule are saturated, it gives a "best guess", i.e. the solution with most saturated atoms. If not all atoms are saturated then it will be noticed as a warning in the log.
- Author:
- Klas Jönsson, Egon Willighagen
- Source code:
- main
- Belongs to CDK module:
- valencycheck
- Keywords:
- bond order
- Created on:
- 2012-04-13
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
bondOrderCanBeIncreased
(IBond bond, IAtomContainer atomContainer) Check if the bond order can be increased.void
decideBondOrder
(IAtomContainer atomContainer) This method decides the bond order on bonds that has theSINGLE_OR_DOUBLE
-flag raised.void
decideBondOrder
(IAtomContainer atomContainer, boolean atomsSaturated) This method decides the bond order on bonds that has theSINGLE_OR_DOUBLE
-flag raised.double
getMaxNoOfBonds
(IAtom atom) This method calculates the number of bonds that anIAtom
can have.boolean
isSaturated
(IAtomContainer container) boolean
isSaturated
(IAtom atom, IAtomContainer container) void
saturate
(IAtomContainer container)
-
Constructor Details
-
AtomTypeAwareSaturationChecker
public AtomTypeAwareSaturationChecker()Constructs anAtomTypeAwareSaturationChecker
checker.
-
-
Method Details
-
decideBondOrder
public void decideBondOrder(IAtomContainer atomContainer, boolean atomsSaturated) throws CDKException This method decides the bond order on bonds that has theSINGLE_OR_DOUBLE
-flag raised.- Parameters:
atomContainer
- The molecule to investigateatomsSaturated
- Set to true if you want to make sure that all atoms are saturated.- Throws:
CDKException
-
decideBondOrder
This method decides the bond order on bonds that has theSINGLE_OR_DOUBLE
-flag raised.- Parameters:
atomContainer
- The molecule to investigate.- Throws:
CDKException
-
bondOrderCanBeIncreased
public boolean bondOrderCanBeIncreased(IBond bond, IAtomContainer atomContainer) throws CDKException Check if the bond order can be increased. This method assumes that the bond is between only two atoms.- Parameters:
bond
- The bond to checkatomContainer
- TheIAtomContainer
that the bond belongs to- Returns:
- True if it is possibly to increase the bond order
- Throws:
CDKException
-
getMaxNoOfBonds
This method calculates the number of bonds that anIAtom
can have.- Parameters:
atom
- TheIAtom
to be investigated- Returns:
- The max number of bonds the
IAtom
can have - Throws:
CDKException
- when the atom's valency is not set
-
saturate
- Specified by:
saturate
in interfaceIDeduceBondOrderTool
- Throws:
CDKException
-
isSaturated
- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-
isSaturated
- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-