Class SmilesValencyChecker

java.lang.Object
org.openscience.cdk.tools.SmilesValencyChecker
All Implemented Interfaces:
IDeduceBondOrderTool, IValencyChecker

public class SmilesValencyChecker extends Object implements IValencyChecker, IDeduceBondOrderTool
Small customization of ValencyHybridChecker suggested by Todd Martin specially tuned for SMILES parsing.
Author:
Egon Willighagen
Source code:
main
Belongs to CDK module:
valencycheck
Keywords:
atom, valency
Created on:
2004-06-12
  • Field Details

  • Constructor Details

    • SmilesValencyChecker

      public SmilesValencyChecker()
    • SmilesValencyChecker

      public SmilesValencyChecker(String atomTypeList)
  • Method Details

    • saturate

      public void saturate(IAtomContainer atomContainer) throws CDKException
      Saturates a molecule by setting appropriate bond orders.
      Specified by:
      saturate in interface IDeduceBondOrderTool
      Throws:
      CDKException
      Keywords:
      bond order, calculation
      Created on:
      2003-10-03
    • saturate

      public boolean saturate(IBond[] bonds, IAtomContainer atomContainer) throws CDKException
      Saturates a set of Bonds in an AtomContainer.
      Throws:
      CDKException
    • unsaturateByDecreasingBondOrder

      public boolean unsaturateByDecreasingBondOrder(IBond bond)
    • isUnsaturated

      public boolean isUnsaturated(IBond bond, IAtomContainer atomContainer) throws CDKException
      Returns whether a bond is unsaturated. A bond is unsaturated if all Atoms in the bond are unsaturated.
      Throws:
      CDKException
    • saturateByIncreasingBondOrder

      public boolean saturateByIncreasingBondOrder(IBond bond, IAtomContainer atomContainer) throws CDKException
      Tries to saturate a bond by increasing its bond orders by 1.0.
      Returns:
      true if the bond could be increased
      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(IAtomContainer container) throws CDKException
      Determines of all atoms on the AtomContainer are saturated.
      Specified by:
      isSaturated in interface IValencyChecker
      Throws:
      CDKException
    • allSaturated

      public boolean allSaturated(IAtomContainer ac) throws CDKException
      Throws:
      CDKException
    • couldMatchAtomType

      public boolean couldMatchAtomType(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, IAtomType type)
      Determines if the atom can be of type AtomType. That is, it sees if this AtomType only differs in bond orders, or implicit hydrogen count.
    • calculateNumberOfImplicitHydrogens

      public int calculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, int neighbourCount) throws CDKException
      Calculates the number of hydrogens that can be added to the given atom to fullfil the atom's valency. It will return 0 for PseudoAtoms, and for atoms for which it does not have an entry in the configuration file.
      Throws:
      CDKException
    • isSaturated

      public boolean isSaturated(IAtom atom, IAtomContainer container) throws CDKException
      Checks whether an Atom is saturated by comparing it with known AtomTypes. It returns true if the atom is an PseudoAtom and when the element is not in the list.
      Specified by:
      isSaturated in interface IValencyChecker
      Throws:
      CDKException
    • calculateNumberOfImplicitHydrogens

      public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException
      Throws:
      CDKException
    • getAtomTypeFactory

      protected AtomTypeFactory getAtomTypeFactory(IChemObjectBuilder builder) throws CDKException
      Throws:
      CDKException
    • couldMatchAtomType

      public boolean couldMatchAtomType(IAtomContainer container, IAtom atom, IAtomType type)
      Determines if the atom can be of type AtomType.