Package org.openscience.cdk.tools
Class SaturationChecker
- java.lang.Object
-
- org.openscience.cdk.tools.SaturationChecker
-
- All Implemented Interfaces:
IDeduceBondOrderTool
,IValencyChecker
public class SaturationChecker extends Object implements IValencyChecker, IDeduceBondOrderTool
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 Constructor Description SaturationChecker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allSaturated(IAtomContainer ac)
int
calculateNumberOfImplicitHydrogens(IAtom atom)
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.
-
-
-
Method Detail
-
getAtomTypeFactory
protected AtomTypeFactory getAtomTypeFactory(IChemObjectBuilder builder) throws CDKException
- Parameters:
builder
- the ChemObjectBuilder implementation used to construct the AtomType's.- Throws:
CDKException
-
hasPerfectConfiguration
public boolean hasPerfectConfiguration(IAtom atom, IAtomContainer ac) throws CDKException
- Throws:
CDKException
-
isSaturated
public boolean isSaturated(IAtomContainer container) throws CDKException
Determines of all atoms on the AtomContainer are saturated.- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-
allSaturated
public boolean allSaturated(IAtomContainer ac) throws CDKException
- Throws:
CDKException
-
isUnsaturated
public boolean isUnsaturated(IBond bond, IAtomContainer atomContainer) throws CDKException
Returns whether a bond is unsaturated. A bond is unsaturated if both Atoms in the bond are unsaturated.- Throws:
CDKException
-
isSaturated
public boolean isSaturated(IBond bond, IAtomContainer atomContainer) throws CDKException
Returns whether a bond is saturated. A bond is saturated if both Atoms in the bond are saturated.- Throws:
CDKException
-
isSaturated
public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException
Checks whether an Atom is saturated by comparing it with known AtomTypes.- Specified by:
isSaturated
in interfaceIValencyChecker
- Throws:
CDKException
-
isOverSaturated
public boolean isOverSaturated(IAtom atom, IAtomContainer ac) throws CDKException
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
public double getCurrentMaxBondOrder(IAtom atom, IAtomContainer ac) throws CDKException
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
public void unsaturate(IAtomContainer atomContainer)
Resets the bond orders of all atoms to 1.0.
-
unsaturateBonds
public void unsaturateBonds(IAtomContainer container)
Resets the bond order of the Bond to 1.0.
-
newSaturate
public void newSaturate(IAtomContainer atomContainer) throws CDKException
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
public boolean newSaturate(IBond[] bonds, IAtomContainer atomContainer) throws CDKException
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
public boolean newSaturate(IBond bond, IAtomContainer atomContainer) throws CDKException
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
public boolean couldMatchAtomType(IAtomContainer atomContainer, IAtom atom, IAtomType atomType)
Determines if the atom can be of type AtomType.
-
saturate
public void saturate(IAtomContainer atomContainer) throws CDKException
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
public void saturateRingSystems(IAtomContainer atomContainer) throws CDKException
- 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:
AtomTypeFactory
-
calculateNumberOfImplicitHydrogens
public int calculateNumberOfImplicitHydrogens(IAtom atom) throws CDKException
- 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:
AtomTypeFactory
-
-