Class SmilesValencyChecker
java.lang.Object
org.openscience.cdk.tools.SmilesValencyChecker
- All Implemented Interfaces:
IDeduceBondOrderTool, IValencyChecker
Small customization of ValencyHybridChecker suggested by Todd Martin
specially tuned for SMILES parsing.
- Author:
- Egon Willighagen
- Keywords:
- atom, valency
- Created on:
- 2004-06-12
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintcalculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, int neighbourCount) Calculates the number of hydrogens that can be added to the given atom to fullfil the atom's valency.intcalculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) booleancouldMatchAtomType(IAtomContainer container, IAtom atom, IAtomType type) Determines if the atom can be of type AtomType.booleancouldMatchAtomType(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, IAtomType type) Determines if the atom can be of type AtomType.protected AtomTypeFactorygetAtomTypeFactory(IChemObjectBuilder builder) booleanisSaturated(IAtomContainer container) Determines of all atoms on the AtomContainer are saturated.booleanisSaturated(IAtom atom, IAtomContainer container) Checks whether an Atom is saturated by comparing it with known AtomTypes.booleanisSaturated(IBond bond, IAtomContainer atomContainer) Returns whether a bond is saturated.booleanisUnsaturated(IBond bond, IAtomContainer atomContainer) Returns whether a bond is unsaturated.voidsaturate(IAtomContainer atomContainer) Saturates a molecule by setting appropriate bond orders.booleansaturate(IBond[] bonds, IAtomContainer atomContainer) Saturates a set of Bonds in an AtomContainer.booleansaturateByIncreasingBondOrder(IBond bond, IAtomContainer atomContainer) Tries to saturate a bond by increasing its bond orders by 1.0.boolean
-
Field Details
-
structgenATF
-
logger
-
-
Constructor Details
-
SmilesValencyChecker
public SmilesValencyChecker() -
SmilesValencyChecker
-
-
Method Details
-
saturate
Saturates a molecule by setting appropriate bond orders.- Specified by:
saturatein interfaceIDeduceBondOrderTool- Throws:
CDKException- Keywords:
- bond order, calculation
- Created on:
- 2003-10-03
-
saturate
Saturates a set of Bonds in an AtomContainer.- Throws:
CDKException
-
unsaturateByDecreasingBondOrder
-
isUnsaturated
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
Returns whether a bond is saturated. A bond is saturated if both Atoms in the bond are saturated.- Throws:
CDKException
-
isSaturated
Determines of all atoms on the AtomContainer are saturated.- Specified by:
isSaturatedin interfaceIValencyChecker- Throws:
CDKException
-
allSaturated
- 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
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:
isSaturatedin interfaceIValencyChecker- Throws:
CDKException
-
calculateNumberOfImplicitHydrogens
public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException - Throws:
CDKException
-
getAtomTypeFactory
- Throws:
CDKException
-
couldMatchAtomType
Determines if the atom can be of type AtomType.
-