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:
Source code:
main
Belongs to CDK module:
reaction
Created on:
2006-5-05
  • Constructor Details

    • StructureResonanceGenerator

      public StructureResonanceGenerator()
      Construct an instance of StructureResonanceGenerator. Default restrictions are initiated.
      See Also:
    • 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:
  • Method Details

    • 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

      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:
    • 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:
    • getStructures

      public IAtomContainerSet getStructures(IAtomContainer molecule)
      Get the resonance structures from an IAtomContainer.
      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 a IAtomContainer. 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 a IAtomContainer. It is based on looking if the order of the bond changes. Return null is any is found.
      Parameters:
      molecule - The IAtomContainer to analyze
      atom - 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 a IAtomContainer. It is based on looking if the order of the bond changes. Return null is any is found.
      Parameters:
      molecule - The IAtomContainer to analyze
      bond - The IBond
      Returns:
      The container with the bond