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 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 Details

  • Method Details

    • decideBondOrder

      public void decideBondOrder(IAtomContainer atomContainer, boolean atomsSaturated) throws CDKException
      This method decides the bond order on bonds that has the SINGLE_OR_DOUBLE-flag raised.
      Parameters:
      atomContainer - The molecule to investigate
      atomsSaturated - Set to true if you want to make sure that all atoms are saturated.
      Throws:
      CDKException
    • decideBondOrder

      public void decideBondOrder(IAtomContainer atomContainer) throws CDKException
      This method decides the bond order on bonds that has the SINGLE_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 check
      atomContainer - The IAtomContainer that the bond belongs to
      Returns:
      True if it is possibly to increase the bond order
      Throws:
      CDKException
    • getMaxNoOfBonds

      public double getMaxNoOfBonds(IAtom atom) throws CDKException
      This method calculates the number of bonds that an IAtom can have.
      Parameters:
      atom - The IAtom to be investigated
      Returns:
      The max number of bonds the IAtom can have
      Throws:
      CDKException - when the atom's valency is not set
    • saturate

      public void saturate(IAtomContainer container) throws CDKException
      Specified by:
      saturate in interface IDeduceBondOrderTool
      Throws:
      CDKException
    • isSaturated

      public boolean isSaturated(IAtomContainer container) throws CDKException
      Specified by:
      isSaturated in interface IValencyChecker
      Throws:
      CDKException
    • isSaturated

      public boolean isSaturated(IAtom atom, IAtomContainer container) throws CDKException
      Specified by:
      isSaturated in interface IValencyChecker
      Throws:
      CDKException