Class ReactionManipulator

java.lang.Object
org.openscience.cdk.tools.manipulator.ReactionManipulator

public class ReactionManipulator extends Object
Provides a variety of methods to manipulate and convert from/to IReaction.
Author:
uli-f
See Also:
Source code:
main
Belongs to CDK module:
standard
  • Constructor Details

    • ReactionManipulator

      public ReactionManipulator()
  • Method Details

    • getAtomCount

      public static int getAtomCount(IReaction reaction)
    • getBondCount

      public static int getBondCount(IReaction reaction)
    • removeAtomAndConnectedElectronContainers

      public static void removeAtomAndConnectedElectronContainers(IReaction reaction, IAtom atom)
    • removeElectronContainer

      public static void removeElectronContainer(IReaction reaction, IElectronContainer electrons)
    • getAllMolecules

      public static IAtomContainerSet getAllMolecules(IReaction reaction)
      Returns all components of an IReaction, that is, reactants, agents and products.
      Parameters:
      reaction - all components of this reaction are returned
      Returns:
      IAtomContainerSet containing all components of the reaction provided as an argument
    • getAllProducts

      public static IAtomContainerSet getAllProducts(IReaction reaction)
      Returns all products of an IReaction.
      Parameters:
      reaction - all products of this reaction are returned
      Returns:
      IAtomContainerSet containing all products of the reaction provided as an argument
    • getAllReactants

      public static IAtomContainerSet getAllReactants(IReaction reaction)
      Returns all reactants of an IReaction.
      Parameters:
      reaction - all reactants of this reaction are returned
      Returns:
      IAtomContainerSet containing all reactants of the reaction provided as an argument
    • getAllAgents

      public static IAtomContainerSet getAllAgents(IReaction reaction)
      Returns all agents of an IReaction.
      Parameters:
      reaction - all agents of this reaction are returned
      Returns:
      IAtomContainerSet containing all agents of the reaction provided as an argument
    • reverse

      public static IReaction reverse(IReaction reaction)
      Returns a new IReaction which is the reverse of the given reaction.
      Parameters:
      reaction - the reaction being considered
      Returns:
      the reverse reaction
    • getAllAtomContainers

      public static List<IAtomContainer> getAllAtomContainers(IReaction reaction)
      Returns all IAtomContainers of the given reaction.
      Parameters:
      reaction - the reaction whose IAtomContainers are returned
      Returns:
      list of IAtomContainers comprising the reaction
    • getAllIDs

      public static List<String> getAllIDs(IReaction reaction)
    • getRelevantAtomContainer

      public static IAtomContainer getRelevantAtomContainer(IReaction reaction, IAtom atom)
    • getRelevantAtomContainer

      public static IAtomContainer getRelevantAtomContainer(IReaction reaction, IBond bond)
    • setAtomProperties

      public static void setAtomProperties(IReaction reaction, Object propKey, Object propVal)
    • getAllChemObjects

      public static List<IChemObject> getAllChemObjects(IReaction reaction)
    • getMappedChemObject

      public static IChemObject getMappedChemObject(IReaction reaction, IChemObject chemObject)
      Returns the IAtom that is mapped.
      Parameters:
      reaction - reaction that contains the mapping
      chemObject - IChemObject which will be searched for the mapped IChemObject
      Returns:
      mapped IChemObject
    • toMolecule

      public static IAtomContainer toMolecule(IReaction rxn)
      Converts a reaction to an 'inlined' reaction stored as a molecule.

      All reactants, agents, products are added to the molecule as disconnected components with atoms flagged as to their role ReactionRole and component group.

      The inlined reaction, stored in a molecule can be converted back to an explicit reaction with toReaction(org.openscience.cdk.interfaces.IAtomContainer). Data stored on the individual components (e.g. titles is lost in the conversion).

      Parameters:
      rxn - reaction to convert
      Returns:
      inlined reaction stored in a molecule
      See Also:
    • toReaction

      public static IReaction toReaction(IAtomContainer mol)
      Converts an 'inlined' reaction stored in a molecule back to a reaction.
      Parameters:
      mol - molecule to convert
      Returns:
      reaction
      See Also:
    • findMappedBonds

      public static Set<IBond> findMappedBonds(IReaction reaction)
      Collect the set of bonds that mapped in both a reactant and a product. The method uses the CDKConstants.ATOM_ATOM_MAPPING property of atoms.
      Parameters:
      reaction - reaction
      Returns:
      mapped bonds
    • perceiveAtomTypesAndConfigureAtoms

      public static void perceiveAtomTypesAndConfigureAtoms(IReaction reaction) throws CDKException
      Convenience method to perceive atom types for all IAtoms of all components of the provided IReaction. This method uses the CDKAtomTypeMatcher. If the matcher finds a matching atom type, the IAtom will be configured to have the same properties as the IAtomType. If no matching atom type is found, no configuration is performed.
      This method overwrites existing values.
      Parameters:
      reaction - the reaction whose atom types are to be perceived
      Throws:
      CDKException
      See Also:
    • perceiveAtomTypesAndConfigureUnsetProperties

      public static void perceiveAtomTypesAndConfigureUnsetProperties(IReaction reaction) throws CDKException
      Convenience method to perceive atom types for all IAtoms of all components of the provided IReaction. This method uses the CDKAtomTypeMatcher. If the matcher finds a matching atom type, the IAtom will be configured to have the same properties as the IAtomType. If no matching atom type is found, no configuration is performed.
      This method only sets null values.
      Parameters:
      reaction - the reaction whose atom types are to be perceived
      Throws:
      CDKException
      See Also:
    • clearAtomConfigurations

      public static void clearAtomConfigurations(IReaction reaction)
      This method will reset all atom properties related to atom configuration to the value CDKConstants.UNSET.
      This method reverses most of the effects of perceiveAtomTypesAndConfigureAtoms(org.openscience.cdk.interfaces.IReaction) and after a call to this method all atoms will be "unconfigured".
      Note that this method is not a complete reversal of perceiveAtomTypesAndConfigureAtoms(org.openscience.cdk.interfaces.IReaction) since the atomic symbol of the atoms remain unchanged. Also, all flags that were set by the configuration method (such as CDKConstants.IS_HYDROGENBOND_ACCEPTOR or CDKConstants.ISAROMATIC) will be set to False.
      Parameters:
      reaction - the reaction whose atoms confiuration properties are to be cleared
      See Also: