Package org.openscience.cdk.tools
Class StructureResonanceGenerator
- java.lang.Object
-
- org.openscience.cdk.tools.StructureResonanceGenerator
-
public class StructureResonanceGenerator extends Object
This class try to generate resonance structure for a determinate molecule.
Make sure that the molecule has the corresponding lone pair electrons for each atom. You can use the method:
LonePairElectronChecker
It is needed to call the addExplicitHydrogensToSatisfyValency from the class tools.HydrogenAdder.
It is based on rearrangements of electrons and charge
The method is based on call by reactions which occur in a resonance.
StructureResonanceGenerator srG = new StructureReseonanceGenerator(true,true,true,true,false); MoleculeSet setOf = srG.getResonances(new Molecule());
We have the possibility to localize the reactive center. Good method if you want to localize the reaction in a fixed point
atoms[0].setFlag(CDKConstants.REACTIVE_CENTER,true);
Moreover you must put the parameter as true
If the reactive center is not localized then the reaction process will try to find automatically the possible reactive center.
- Author:
- Miguel Rojas
- See Also:
IReactionProcess
- Source code:
- main
- Belongs to CDK module:
- reaction
- Created on:
- 2006-5-05
-
-
Constructor Summary
Constructors Constructor Description StructureResonanceGenerator()
Construct an instance of StructureResonanceGenerator.StructureResonanceGenerator(boolean lookingSymmetry)
Construct an instance of StructureResonanceGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAtomContainer
getContainer(IAtomContainer molecule, IAtom atom)
Get the container which the atom is found on resonance from aIAtomContainer
.IAtomContainer
getContainer(IAtomContainer molecule, IBond bond)
Get the container which the bond is found on resonance from aIAtomContainer
.IAtomContainerSet
getContainers(IAtomContainer molecule)
Get the container which is found resonance from aIAtomContainer
.int
getMaximalStructures()
Get the number maximal of resonance structures to be found.List<IReactionProcess>
getReactions()
Get the reactions that must be presents in the generation of the resonance.IAtomContainerSet
getStructures(IAtomContainer molecule)
Get the resonance structures from anIAtomContainer
.void
setDefaultReactions()
Set the default reactions that must be presents to generate the resonance.void
setMaximalStructures(int maxStruct)
Set the number maximal of resonance structures to be found.void
setReactions(List<IReactionProcess> newReactionsList)
Set the reactions that must be used in the generation of the resonance.
-
-
-
Constructor Detail
-
StructureResonanceGenerator
public StructureResonanceGenerator()
Construct an instance of StructureResonanceGenerator. Default restrictions are initiated.- See Also:
setDefaultReactions()
-
StructureResonanceGenerator
public StructureResonanceGenerator(boolean lookingSymmetry)
Construct an instance of StructureResonanceGenerator. Default restrictions are initiated.- Parameters:
lookingSymmetry
- Specify if the resonance generation is based looking at the symmetry- See Also:
setDefaultReactions()
-
-
Method Detail
-
setReactions
public void setReactions(List<IReactionProcess> newReactionsList)
Set the reactions that must be used in the generation of the resonance.- Parameters:
newReactionsList
- The IReactionsProcess's to use- See Also:
getReactions()
,setReactions(java.util.List)
,IReactionProcess
-
getReactions
public List<IReactionProcess> getReactions()
Get the reactions that must be presents in the generation of the resonance.- Returns:
- The reactions to be imposed
- See Also:
setDefaultReactions()
-
setMaximalStructures
public void setMaximalStructures(int maxStruct)
Set the number maximal of resonance structures to be found. The algorithm breaks the process when is came to this number.- Parameters:
maxStruct
- The maximal number
-
getMaximalStructures
public int getMaximalStructures()
Get the number maximal of resonance structures to be found.- Returns:
- The maximal number
-
setDefaultReactions
public void setDefaultReactions()
Set the default reactions that must be presents to generate the resonance.- See Also:
getReactions()
-
getStructures
public IAtomContainerSet getStructures(IAtomContainer molecule)
Get the resonance structures from anIAtomContainer
.- Parameters:
molecule
- The IAtomContainer to analyze- Returns:
- The different resonance structures
-
getContainers
public IAtomContainerSet getContainers(IAtomContainer molecule)
Get the container which is found resonance from aIAtomContainer
. It is based on looking if the order of the bond changes.- Parameters:
molecule
- The IAtomContainer to analyze- Returns:
- The different containers
-
getContainer
public IAtomContainer getContainer(IAtomContainer molecule, IAtom atom)
Get the container which the atom is found on resonance from aIAtomContainer
. It is based on looking if the order of the bond changes. Return null is any is found.- Parameters:
molecule
- The IAtomContainer to analyzeatom
- The IAtom- Returns:
- The container with the atom
-
getContainer
public IAtomContainer getContainer(IAtomContainer molecule, IBond bond)
Get the container which the bond is found on resonance from aIAtomContainer
. It is based on looking if the order of the bond changes. Return null is any is found.- Parameters:
molecule
- The IAtomContainer to analyzebond
- The IBond- Returns:
- The container with the bond
-
-