Package org.openscience.cdk.tools
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
- Source code:
- main
- Belongs to CDK module:
- valencycheck
- Keywords:
- atom, valency
- Created on:
- 2004-06-12
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
calculateNumberOfImplicitHydrogens
(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.int
calculateNumberOfImplicitHydrogens
(IAtom atom, IAtomContainer container) boolean
couldMatchAtomType
(IAtomContainer container, IAtom atom, IAtomType type) Determines if the atom can be of type AtomType.boolean
couldMatchAtomType
(IAtom atom, double bondOrderSum, IBond.Order maxBondOrder, IAtomType type) Determines if the atom can be of type AtomType.protected AtomTypeFactory
getAtomTypeFactory
(IChemObjectBuilder builder) boolean
isSaturated
(IAtomContainer container) Determines of all atoms on the AtomContainer are saturated.boolean
isSaturated
(IAtom atom, IAtomContainer container) 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
saturate
(IAtomContainer atomContainer) Saturates a molecule by setting appropriate bond orders.boolean
saturate
(IBond[] bonds, IAtomContainer atomContainer) Saturates a set of Bonds in an AtomContainer.boolean
saturateByIncreasingBondOrder
(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:
saturate
in 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:
isSaturated
in 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:
isSaturated
in 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.
-