public class SaturationChecker extends Object implements IValencyChecker, IDeduceBondOrderTool
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).
Constructor and Description |
---|
SaturationChecker() |
Modifier and Type | Method and 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.
|
protected AtomTypeFactory getAtomTypeFactory(IChemObjectBuilder builder) throws CDKException
builder
- the ChemObjectBuilder implementation used to construct the AtomType's.CDKException
public boolean hasPerfectConfiguration(IAtom atom, IAtomContainer ac) throws CDKException
CDKException
public boolean isSaturated(IAtomContainer container) throws CDKException
isSaturated
in interface IValencyChecker
CDKException
public boolean allSaturated(IAtomContainer ac) throws CDKException
CDKException
public boolean isUnsaturated(IBond bond, IAtomContainer atomContainer) throws CDKException
CDKException
public boolean isSaturated(IBond bond, IAtomContainer atomContainer) throws CDKException
CDKException
public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException
isSaturated
in interface IValencyChecker
CDKException
public boolean isOverSaturated(IAtom atom, IAtomContainer ac) throws CDKException
atom
- The Atom to checkac
- The atomcontainer contextCDKException
public double getCurrentMaxBondOrder(IAtom atom, IAtomContainer ac) throws CDKException
atom
- The atom to be checkedac
- The AtomContainer that provides the contextCDKException
public void unsaturate(IAtomContainer atomContainer)
public void unsaturateBonds(IAtomContainer container)
public void newSaturate(IAtomContainer atomContainer) throws CDKException
CDKException
public boolean newSaturate(IBond[] bonds, IAtomContainer atomContainer) throws CDKException
CDKException
public boolean newSaturate(IBond bond, IAtomContainer atomContainer) throws CDKException
CDKException
public boolean couldMatchAtomType(IAtomContainer atomContainer, IAtom atom, IAtomType atomType)
public void saturate(IAtomContainer atomContainer) throws CDKException
saturate
in interface IDeduceBondOrderTool
CDKException
public void saturateRingSystems(IAtomContainer atomContainer) throws CDKException
CDKException
public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container) throws CDKException
atom
- Description of the Parametercontainer
- Description of the ParameterCDKException
AtomTypeFactory
public int calculateNumberOfImplicitHydrogens(IAtom atom) throws CDKException
CDKException
public int calculateNumberOfImplicitHydrogens(IAtom atom, IAtomContainer container, boolean throwExceptionForUnknowAtom) throws CDKException
CDKException
public int calculateNumberOfImplicitHydrogens(IAtom atom, double bondOrderSum, double singleElectronSum, List<IBond> connectedBonds, boolean throwExceptionForUnknowAtom) throws CDKException
atom
- Description of the ParameterthrowExceptionForUnknowAtom
- Should an exception be thrown if an unknown atomtype is found or 0 returned ?CDKException
AtomTypeFactory
Copyright © 2017. All Rights Reserved.