Package org.openscience.cdk.tools
Class SaturationChecker
java.lang.Object
org.openscience.cdk.tools.SaturationChecker
- All Implemented Interfaces:
IDeduceBondOrderTool
,IValencyChecker
Provides methods for checking whether an atoms valences are saturated with
respect to a particular atom type.
Important: this class does not deal with hybridization states, which makes it fail, for example, for situations where bonds are marked as aromatic (either 1.5 or single an AROMATIC).
- Author:
- steinbeck, Egon Willighagen
- Source code:
- main
- Belongs to CDK module:
- valencycheck
- Keywords:
- saturation, atom, valency
- Created on:
- 2001-09-04
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
calculateNumberOfImplicitHydrogens
(IAtom atom, double bondOrderSum, double singleElectronSum, List<IBond> connectedBonds, boolean throwExceptionForUnknowAtom) Calculate the number of missing hydrogens by subtracting the number of bonds for the atom from the expected number of bonds.int
calculateNumberOfImplicitHydrogens
(IAtom atom, IAtomContainer container) Calculate the number of missing hydrogens by subtracting the number of bonds for the atom from the expected number of bonds.int
calculateNumberOfImplicitHydrogens
(IAtom atom, IAtomContainer container, boolean throwExceptionForUnknowAtom) boolean
couldMatchAtomType
(IAtomContainer atomContainer, IAtom atom, IAtomType atomType) Determines if the atom can be of type AtomType.protected AtomTypeFactory
getAtomTypeFactory
(IChemObjectBuilder builder) double
getCurrentMaxBondOrder
(IAtom atom, IAtomContainer ac) Returns the currently maximum formable bond order for this atom.boolean
hasPerfectConfiguration
(IAtom atom, IAtomContainer ac) boolean
isOverSaturated
(IAtom atom, IAtomContainer ac) Checks if the current atom has exceeded its bond order sum value.boolean
isSaturated
(IAtomContainer container) Determines of all atoms on the AtomContainer are saturated.boolean
isSaturated
(IAtom atom, IAtomContainer ac) Checks whether an Atom is saturated by comparing it with known AtomTypes.boolean
isSaturated
(IBond bond, IAtomContainer atomContainer) Returns whether a bond is saturated.boolean
isUnsaturated
(IBond bond, IAtomContainer atomContainer) Returns whether a bond is unsaturated.void
newSaturate
(IAtomContainer atomContainer) Saturates a molecule by setting appropriate bond orders.boolean
newSaturate
(IBond[] bonds, IAtomContainer atomContainer) Saturates a set of Bonds in an AtomContainer.boolean
newSaturate
(IBond bond, IAtomContainer atomContainer) Saturate atom by adjusting its bond orders.void
saturate
(IAtomContainer atomContainer) The method is known to fail for certain compounds.void
saturateRingSystems
(IAtomContainer atomContainer) void
unsaturate
(IAtomContainer atomContainer) Resets the bond orders of all atoms to 1.0.void
unsaturateBonds
(IAtomContainer container) Resets the bond order of the Bond to 1.0.
-
Constructor Details
-
SaturationChecker
public SaturationChecker()
-
-
Method Details
-
getAtomTypeFactory
- Parameters:
builder
- the ChemObjectBuilder implementation used to construct the AtomType's.- Throws:
CDKException
-
hasPerfectConfiguration
- Throws:
CDKException
-
isSaturated
Determines of all atoms on the AtomContainer are saturated.- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-
allSaturated
- Throws:
CDKException
-
isUnsaturated
Returns whether a bond is unsaturated. A bond is unsaturated if both Atoms in the bond are unsaturated.- Throws:
CDKException
-
isSaturated
Returns whether a bond is saturated. A bond is saturated if both Atoms in the bond are saturated.- Throws:
CDKException
-
isSaturated
Checks whether an Atom is saturated by comparing it with known AtomTypes.- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-
isOverSaturated
Checks if the current atom has exceeded its bond order sum value.- Parameters:
atom
- The Atom to checkac
- The atomcontainer context- Returns:
- oversaturated or not
- Throws:
CDKException
-
getCurrentMaxBondOrder
Returns the currently maximum formable bond order for this atom.- Parameters:
atom
- The atom to be checkedac
- The AtomContainer that provides the context- Returns:
- the currently maximum formable bond order for this atom
- Throws:
CDKException
-
unsaturate
Resets the bond orders of all atoms to 1.0. -
unsaturateBonds
Resets the bond order of the Bond to 1.0. -
newSaturate
Saturates a molecule by setting appropriate bond orders. This method is known to fail, especially on pyrolle-like compounds. Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better- Throws:
CDKException
- Keywords:
- bond order, calculation
- Created on:
- 2003-10-03
-
newSaturate
Saturates a set of Bonds in an AtomContainer. This method is known to fail, especially on pyrolle-like compounds. Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better- Throws:
CDKException
-
newSaturate
Saturate atom by adjusting its bond orders. This method is known to fail, especially on pyrolle-like compounds. Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better- Throws:
CDKException
-
couldMatchAtomType
Determines if the atom can be of type AtomType. -
saturate
The method is known to fail for certain compounds. For more information, see cdk.test.limitations package. This method is known to fail, especially on pyrolle-like compounds. Consider using import org.openscience.cdk.smiles.DeduceBondSystemTool, which should work better- Specified by:
saturate
in interfaceIDeduceBondOrderTool
- Throws:
CDKException
-
saturateRingSystems
- Throws:
CDKException
-
calculateNumberOfImplicitHydrogens
public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException Calculate the number of missing hydrogens by subtracting the number of bonds for the atom from the expected number of bonds. Charges are included in the calculation. The number of expected bonds is defined by the AtomType generated with the AtomTypeFactory.- Parameters:
atom
- Description of the Parametercontainer
- Description of the Parameter- Returns:
- Description of the Return Value
- Throws:
CDKException
- See Also:
-
calculateNumberOfImplicitHydrogens
- Throws:
CDKException
-
calculateNumberOfImplicitHydrogens
public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container, boolean throwExceptionForUnknowAtom) throws CDKException - Throws:
CDKException
-
calculateNumberOfImplicitHydrogens
public int calculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, double singleElectronSum, List<IBond> connectedBonds, boolean throwExceptionForUnknowAtom) throws CDKException Calculate the number of missing hydrogens by subtracting the number of bonds for the atom from the expected number of bonds. Charges are included in the calculation. The number of expected bonds is defined by the AtomType generated with the AtomTypeFactory.- Parameters:
atom
- Description of the ParameterthrowExceptionForUnknowAtom
- Should an exception be thrown if an unknown atomtype is found or 0 returned ?- Returns:
- Description of the Return Value
- Throws:
CDKException
- See Also:
-