Class Reactor


  • public class Reactor
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Reactor​(Reaction reaction)
      Constructs a Reactor that is able to construct products from a generic reaction (transformation) and a list of real world reactants.
      Reactor​(Reaction reaction, boolean retainCoordinates)
      Constructs a Reactor that is able to construct products from a generic reaction (transformation) and a list of real world reactants.
      Reactor​(Reaction reaction, boolean retainCoordinates, boolean fullyMapReactions, int maxProducts, boolean uniqueOnly)
      Deprecated.
      Reactor​(Reaction reaction, int mode, int maxProducts)
      Constructs a Reactor that is able to build products from a generic reaction (transformation) and a list of real world reactants.
    • Field Detail

      • MODE_RETAIN_COORDINATES

        public static final int MODE_RETAIN_COORDINATES
        See Also:
        Constant Field Values
      • MODE_FULLY_MAP_REACTIONS

        public static final int MODE_FULLY_MAP_REACTIONS
        See Also:
        Constant Field Values
      • MODE_REMOVE_DUPLICATE_PRODUCTS

        public static final int MODE_REMOVE_DUPLICATE_PRODUCTS
        See Also:
        Constant Field Values
      • MODE_ALLOW_CHARGE_CORRECTIONS

        public static final int MODE_ALLOW_CHARGE_CORRECTIONS
        See Also:
        Constant Field Values
    • Constructor Detail

      • Reactor

        public Reactor​(Reaction reaction)
        Constructs a Reactor that is able to construct products from a generic reaction (transformation) and a list of real world reactants. Reactors built with this constructor will not use product atom coordinates from the generic products, nor will they be able to generate fully mapped reactions. They will produce and return all unique products or reactions.
        Parameters:
        reaction - generic reactions consisting of reactant substructures with optional query features
      • Reactor

        public Reactor​(Reaction reaction,
                       boolean retainCoordinates)
        Constructs a Reactor that is able to construct products from a generic reaction (transformation) and a list of real world reactants. Reactors built with this constructor will be able to generate fully mapped reactions, They will produce and return all unique products or reactions.
        Parameters:
        reaction - generic reactions consisting of reactant substructures with optional query features
        retainCoordinates - if true, then atom coordinates from the generic products are taken into the real world products
      • Reactor

        @Deprecated
        public Reactor​(Reaction reaction,
                       boolean retainCoordinates,
                       boolean fullyMapReactions,
                       int maxProducts,
                       boolean uniqueOnly)
        Deprecated.
        Constructs a Reactor that is able to construct products from a generic reaction (transformation) and a list of real world reactants. The reactor may or may not use atoms coordinates from the generic products, when generating clean product atom coordinates.
        Parameters:
        reaction - generic reactions consisting of reactant substructures with optional query features
        retainCoordinates - if true, then atom coordinates from the generic products are taken into the real world products
        fullyMapReactions - if true, then real world reactants and products will have valid mapping numbers after product generation
        maxProducts - maximum number of products/reactions to be enumerated
        uniqueOnly - whether to skip duplicate products/reactions because of starting material symmetry
      • Reactor

        public Reactor​(Reaction reaction,
                       int mode,
                       int maxProducts)
        Constructs a Reactor that is able to build products from a generic reaction (transformation) and a list of real world reactants. These MODE_xxx flags can be used to finetune the Reactor's behaviour:
        MODE_RETAIN_COORDINATES: If set, then atom coordinates from the generic products are taken into the real world products as fixed atom coordinates set when creating atom coordinates for all product atoms.
        MODE_FULLY_MAP_REACTIONS: If true, then real world reactants and products will have valid mapping numbers after product generation. getFullyMappedReactions() can be used after each setReactant() call to get complete and mapped Reaction objects, one for every potential product.
        MODE_REMOVE_DUPLICATE_PRODUCTS: Whether to skip duplicate products/reactions because of starting material symmetry.
        MODE_ALLOW_CHARGE_CORRECTIONS: If set, then the Reactor will try to neutralize real world reactant atoms, if the matching generic reactant atom has no charge. E.g. this would allow carboxylate anions to represent a carboxylic acid in an esterification despite formally the anion oxygen has no free valence to form a new bond. WARNING: This may produce products with unbalanced atom charges.
        Parameters:
        reaction - generic reaction with reactant & product substructures with optional query features (reactant)
        mode - 0 or any combination of MODE_xxx flags
        maxProducts - limitation of products/reactions to be enumerated in case of heavy symmetries
    • Method Detail

      • setReactant

        public void setReactant​(int no,
                                StereoMolecule reactant)
        Defines a real world reactant. This triggers a sub-structure search of the respective generic reactant in the real reactant resulting in potentially multiple matches. Matches are removed, if free valences are not compatible with the formation of new bonds.
        Parameters:
        no -
        reactant - with correctly set parity flags
      • getProductIDCodes

        public java.lang.String[][] getProductIDCodes()
      • getFullyMappedReactions

        public Reaction[] getFullyMappedReactions()
        After instantiating the Reactor with MODE_FULLY_MAP_REACTIONS and after supplying real reactants, this method may be used to construct the fully mapped reaction. If one or more reactants have multiple matches of their generic reactants, then multiple reactions leading to isomeric products are returned. After calling this method, one or more new real reactants may provided with setReactant() before calling this method again.
        Returns:
        array with one or more reactions