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.
IReactionProcess
Constructor and Description |
---|
StructureResonanceGenerator()
Construct an instance of StructureResonanceGenerator.
|
StructureResonanceGenerator(boolean lookingSymmetry)
Construct an instance of StructureResonanceGenerator.
|
Modifier and Type | Method and Description |
---|---|
IAtomContainer |
getContainer(IAtomContainer molecule,
IAtom atom)
Get the container which the atom is found on resonance from a
IAtomContainer . |
IAtomContainer |
getContainer(IAtomContainer molecule,
IBond bond)
Get the container which the bond is found on resonance from a
IAtomContainer . |
IAtomContainerSet |
getContainers(IAtomContainer molecule)
Get the container which is found resonance from a
IAtomContainer . |
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 an
IAtomContainer . |
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.
|
public StructureResonanceGenerator()
setDefaultReactions()
public StructureResonanceGenerator(boolean lookingSymmetry)
lookingSymmetry
- Specify if the resonance generation is based looking at the symmetrysetDefaultReactions()
public void setReactions(List<IReactionProcess> newReactionsList)
newReactionsList
- The IReactionsProcess's to usegetReactions()
,
setReactions(java.util.List)
,
IReactionProcess
public List<IReactionProcess> getReactions()
setDefaultReactions()
public void setMaximalStructures(int maxStruct)
maxStruct
- The maximal numberpublic int getMaximalStructures()
public void setDefaultReactions()
getReactions()
public IAtomContainerSet getStructures(IAtomContainer molecule)
IAtomContainer
.molecule
- The IAtomContainer to analyzepublic IAtomContainerSet getContainers(IAtomContainer molecule)
IAtomContainer
.
It is based on looking if the order of the bond changes.molecule
- The IAtomContainer to analyzepublic IAtomContainer getContainer(IAtomContainer molecule, IAtom atom)
IAtomContainer
.
It is based on looking if the order of the bond changes. Return null
is any is found.molecule
- The IAtomContainer to analyzeatom
- The IAtompublic IAtomContainer getContainer(IAtomContainer molecule, IBond bond)
IAtomContainer
.
It is based on looking if the order of the bond changes. Return null
is any is found.molecule
- The IAtomContainer to analyzebond
- The IBondCopyright © 2022. All rights reserved.