chemaxon.reaction
Class Reactor

java.lang.Object
  extended by chemaxon.reaction.Reactor
All Implemented Interfaces:
chemaxon.license.Licensable, java.io.Serializable

public class Reactor
extends java.lang.Object
implements chemaxon.license.Licensable, java.io.Serializable

Executes a chemical reaction: creates products from reactants with reaction center data. If the reaction centers have not yet been searched for, uses substructure search to find and (optionally) store them. Provides API to single reaction processing.

See the documentation for details.

An example usage of the API:

 // create Reactor
 Reactor reactor = new Reactor();

 // set the reaction ('rxmol' is the reaction molecule)
 // reaction rules are read from RDF/MRV tags
 reactor.setReaction(rxmol);

 // set the reactants
 reactor.setReactants(reactants);

 // get the results 
 Molecule[] products;
 while ((products = reactor.react()) != null) {
     // export result molecules
     for (Molecule product : products) {
         exporter.write(product);
     }
 }
 

Another example with reaction rules and reaction output:

 // create Reactor
 Reactor reactor = new Reactor();

 // set the reaction
 // ('rxmol' is the reaction molecule,
 // 'rid' is the reaction ID
 // 'reactivity' is the reactivity rule,
 // 'selectivity' is the selectivity rule
 // 'tolerances' is the tolerance string)
 reactor.setReaction(rxmol, rid, reactivity, selectivity, tolerances);

 // set Reactor options
 reactor.setResultType(Reactor.REACTION_OUTPUT);
 reactor.setRatio(new int[] { 1, 2 });

 // set the reactants
 reactor.setReactants(reactants);

 // get the results 
 Molecule[] result;
 while ((result = reactor.react()) != null) {
     // export result (reaction molecule)
     for (Molecule rxn : result) {
         exporter.write(rxn);
     }
 };
 

Since:
JChem 3.0
Version:
JChem 5.7, 09/12/2011
Author:
Nora Mate, Zsolt Mohacsi
See Also:
ConcurrentReactorProcessor, Serialized Form

Field Summary
static int DEF_MAX_TRANSFORM_COUNT
          Deprecated. Not used. Will be removed.
static double DEF_TOLERANCE
          The default tolerance.
static int FUSED_REACTION_OUTPUT
          Output type: fused reaction output.
static int IGNORE_REACTIVITY
          No-rule type: ignore reactivity rule.
static int IGNORE_SELECTIVITY
          No-rule type: ignore selectivity rule.
static int IGNORE_TOLERANCE
          No-rule type: ignore selectivity tolerance.
static int MAPPING_STYLE_CHANGING
          Output reaction mapping style: changing (ChemAxon).
static int MAPPING_STYLE_COMPLETE
          Output reaction mapping style: complete.
static int MAPPING_STYLE_MATCHING
          Output reaction mapping style: matching (Daylight).
static int MAPPING_STYLE_NONE
          Output reaction mapping style: none.
static int NO_DUPLICATE_FILTERING
          No duplicate product list filtering
static int ORDER_INSENSITIVE_DUPLICATE_FILTERING
          Order insensitive duplicate product list filtering
static int ORDER_SENSITIVE_DUPLICATE_FILTERING
          Order sensitive duplicate product list filtering
static int PRODUCT_OUTPUT
          Output type: products.
static int REACTION_OUTPUT
          Output type: reaction.
 
Constructor Summary
Reactor()
          Default constructor.
 
Method Summary
 Reaction createReactionObject(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, double[] tolerances)
          Deprecated. Will be removed from the public API.
 Reaction createReactionObject(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, java.lang.String tolerances)
          Deprecated. Will be removed from the public API.
 int getProductCount()
          Returns the number of products.
 Standardizer getProductStandardizer()
          Deprecated. Will be removed. Use Standardizer to standardize products.
 int getReactantCount()
          Returns the number of reactants.
 Molecule[] getReactants()
          Returns the input reactants.
 RxnMolecule getReaction()
          Returns the reaction.
 java.lang.String getReactionID()
          Returns the reaction ID.
 java.lang.String getReactionIDPropertyName()
          Returns the reaction ID property (RDF/MRV tag) name.
 Molecule getReactionProduct(int i)
          Returns a reaction product.
 Molecule getReactionReactant(int i)
          Returns a reaction reactant.
 Standardizer getStandardizer()
          Deprecated. Will be removed. Use Standardizer to standardize reactants.
 boolean isCached()
          Returns the "cached" property: true if search and calculation results are to be cached and reused.
 boolean isLicensed()
           
 boolean isReverse()
          Returns true if the reaction is to be processed in reversed direction.
 boolean isSingle()
          Returns true if single mode.
static void main(java.lang.String[] args)
          Deprecated. ConcurrentReactorProcessor provides command line interface for Reactor command line application.
 Molecule[] react()
          Performs the reaction.
 void restart()
          Restarts the reactor: the following call to react() will return the first product set.
 void setCached(boolean cached)
          Sets the "cached" property: true if search and calculation results are to be cached and reused.
 void setComponentIDPropertyNames(java.lang.String[] reactantIDProps, java.lang.String[] productIDProps)
          Sets reactant/product ID property (SDF/MRV tag) names.
 void setComponentIDPropertyNames(java.lang.String reactantIDProp, java.lang.String productIDProp)
          Sets reactant/product ID property (SDF/MRV tag) names.
 void setCopyAllReactantProperties(boolean c)
          Sets to copy all reactant properties to output products/reactions.
 void setCopyReactantProperties(java.util.Map<java.lang.String,java.lang.String> patternBasedProperties)
          Sets the reactant properties which should created in output products/reactions, based on a pattern.
 void setCopyReactantProperties(java.lang.String[][] reactantPropertiesToCopy)
          Sets the reactant properties which should be copied to output products/reactions.
 void setCopyReactantProperties(java.lang.String[][] sourceProperties, java.lang.String[][] targetProperties)
          Sets the reactant properties which should be copied to output products/reactions.
 void setDuplicateFiltering(int duplicateFilteringMethod)
          Sets duplicate product list filtering.
 void setIgnoreReactionDefinedStandardizer(boolean ignore)
          Deprecated. Will be removed.
 void setIgnoreRules(int type)
          Ignore reaction rules: 0: apply both rules (default) IGNORE_REACTIVITY: ignore reactivity rule IGNORE_SELECTIVITY: ignore selectivity rule IGNORE_TOLERANCE: ignore selectivity tolerance IGNORE_REACTIVITY | IGNORE_SELECTIVITY: ignore both rules IGNORE_REACTIVITY | IGNORE_TOLERANCE: ignore reactivity rule and selectivity tolerance
 void setLicenseEnvironment(java.lang.String env)
          For internal use only.
 void setMaxNumberOfProductSets(int pieces)
          Deprecated. Not used.
 void setOutputReactionMappingStyle(int style)
          Sets the output reaction's mapping style.
 void setProductIndexes(int[] inds)
          Sets the product indexes (1-based) to be returned (default: null - all products).
 void setProductStandardizer(Standardizer productStandardizer)
          Deprecated. Will be removed. Use Standardizer to standardize products.
 void setRatio(int[] ratio)
          Sets the ratio of the reactants.
 void setReactant(Molecule mol)
          Sets single reactant.
 void setReactants(Molecule[] mols)
          Sets the reactants.
 void setReactants(java.lang.String molstr)
          Sets the reactants from a multi-fragment SMILES string: fragments separated by '.' are taken as separate reactants, therefore it is not possible to set a multi-fragment reactant with this method (use setReactants(Molecule[] mols) for this purpose).
 void setReaction(Molecule rxmol)
          Sets the reaction with reaction rules set in RDF/MRV tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE.
 void setReaction(Molecule rxmol, java.lang.String rid)
          Sets the reaction with reaction rules set in RDF/MRV tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE.
 void setReaction(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, double[] tolerances)
          Sets the reaction and the reaction rules.
 void setReaction(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, java.lang.String tolerances)
          Sets the reaction and the reaction rules.
 void setReaction(Reaction reaction)
          Deprecated. Will be removed from the public API.
 void setReactionIDPropertyName(java.lang.String reactionIDProp)
          Sets the reaction ID property (RDF/MRV tag) name.
 void setReactionString(java.lang.String str)
          Sets the reaction and optionally the reaction rules specified in a string.
 void setReactionString(java.lang.String str, java.lang.String rid)
          Sets the reaction and optionally the reaction rules specified in a string.
 void setRemoveDuplicateProductReferences(boolean rmduprefs)
          Sets to remove product reference repetitions from the generated product array.
 void setResultType(int type)
          Sets the result type.
 void setReverse(boolean reverse)
          Sets the "reverse" property: true if the reaction is to be processed in reversed direction, that is, the product and reactant sides are swapped.
 void setSearchOptions(java.lang.String searchOptions)
          Modifies the default search options used by the Reactor engine.
 void setShowUnsuccessfulReactions(boolean showUnsuccessfulReactions)
          Sets if unsuccessful reactions (reactions which do not result products) should be shown in output.
 void setSingle(boolean single)
          Sets single mode.
 void setSkipReactionMappingCheck(boolean skip)
          Sets to skip reaction mapping check.
 void setStandardizer(Standardizer standardizer)
          Deprecated. Will be removed. Use Standardizer to standardize reactants.
 void setTransform(boolean transform)
          Deprecated. Use Standardizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRODUCT_OUTPUT

public static final int PRODUCT_OUTPUT
Output type: products.

See Also:
Constant Field Values

REACTION_OUTPUT

public static final int REACTION_OUTPUT
Output type: reaction.

See Also:
Constant Field Values

FUSED_REACTION_OUTPUT

public static final int FUSED_REACTION_OUTPUT
Output type: fused reaction output.

See Also:
Constant Field Values

NO_DUPLICATE_FILTERING

public static final int NO_DUPLICATE_FILTERING
No duplicate product list filtering

See Also:
Constant Field Values

ORDER_SENSITIVE_DUPLICATE_FILTERING

public static final int ORDER_SENSITIVE_DUPLICATE_FILTERING
Order sensitive duplicate product list filtering

See Also:
Constant Field Values

ORDER_INSENSITIVE_DUPLICATE_FILTERING

public static final int ORDER_INSENSITIVE_DUPLICATE_FILTERING
Order insensitive duplicate product list filtering

See Also:
Constant Field Values

MAPPING_STYLE_NONE

public static final int MAPPING_STYLE_NONE
Output reaction mapping style: none.

See Also:
Constant Field Values

MAPPING_STYLE_CHANGING

public static final int MAPPING_STYLE_CHANGING
Output reaction mapping style: changing (ChemAxon).

See Also:
Constant Field Values

MAPPING_STYLE_COMPLETE

public static final int MAPPING_STYLE_COMPLETE
Output reaction mapping style: complete.

See Also:
Constant Field Values

MAPPING_STYLE_MATCHING

public static final int MAPPING_STYLE_MATCHING
Output reaction mapping style: matching (Daylight).

See Also:
Constant Field Values

IGNORE_REACTIVITY

public static final int IGNORE_REACTIVITY
No-rule type: ignore reactivity rule.

See Also:
Constant Field Values

IGNORE_SELECTIVITY

public static final int IGNORE_SELECTIVITY
No-rule type: ignore selectivity rule.

See Also:
Constant Field Values

IGNORE_TOLERANCE

public static final int IGNORE_TOLERANCE
No-rule type: ignore selectivity tolerance.

See Also:
Constant Field Values

DEF_TOLERANCE

public static final double DEF_TOLERANCE
The default tolerance.

See Also:
Constant Field Values

DEF_MAX_TRANSFORM_COUNT

public static final int DEF_MAX_TRANSFORM_COUNT
Deprecated. Not used. Will be removed.
The default maximum transform count.

See Also:
Constant Field Values
Constructor Detail

Reactor

public Reactor()
Default constructor.

Method Detail

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
For internal use only.

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable
Parameters:
env - the license environment

setTransform

public void setTransform(boolean transform)
Deprecated. Use Standardizer.

Sets transform mode: true if the original reactant should be transformed instead of creating new product molecules. Used from Standardizer and in transform mode. The default is false.

Parameters:
transform - is true if transform mode
Since:
JChem 3.1

getReactionID

public java.lang.String getReactionID()
Returns the reaction ID. For internal use only.

Returns:
the reaction ID
Since:
JChem 2.3

setIgnoreRules

public void setIgnoreRules(int type)
Ignore reaction rules:

Parameters:
type - is the rule type(s) to be ignored (see above)
Since:
JChem 2.3

setSkipReactionMappingCheck

public void setSkipReactionMappingCheck(boolean skip)
Sets to skip reaction mapping check. Reaction has to be mapped in changing style. Should be called before setting the reaction. The default is false.

Parameters:
skip - if true then reaction mapping will not be checked
Since:
JChem 5.0

setSingle

public void setSingle(boolean single)
Sets single mode. In single mode only single product lists are returned, that is, if there are more than one product lists for a given reactant list then react() returns null. The default is false (non-single mode).

Parameters:
single - is true if single mode
Since:
JChem 2.3

isSingle

public boolean isSingle()
Returns true if single mode. In single mode only single product lists are returned, that is, if there are more than one product lists for a given reactant list then react() retruns null. The default is false (non-single mode).

Returns:
true if single mode
Since:
JChem 2.3

setShowUnsuccessfulReactions

public void setShowUnsuccessfulReactions(boolean showUnsuccessfulReactions)
Sets if unsuccessful reactions (reactions which do not result products) should be shown in output. If true, then unsuccessful reactions will be shown with empty products side in the output. This options works only in case of REACTION_OUTPUT.

Parameters:
showUnsuccessfulReactions - if true, then unsuccessful reactions will be shown with empty products side in the output
Since:
JChem 5.3.2
See Also:
setResultType(int)

setDuplicateFiltering

public void setDuplicateFiltering(int duplicateFilteringMethod)
Sets duplicate product list filtering. Available filtering methods:

The default is ORDER_SENSITIVE_DUPLICATE_FILTERING. Note that skipping duplicate product list filtering increases efficiency therefore it is wise to set this parameter to NO_DUPLICATE_FILTERING if duplicates do not matter (e.g. if only the first product list is queried by calling react() only once).

Parameters:
duplicateFilteringMethod - is the filtering method
Since:
JChem 5.0.1

setMaxNumberOfProductSets

public void setMaxNumberOfProductSets(int pieces)
Deprecated. Not used.

Sets the maximum number of products sets to be returned for one reactant set. Set -1 to return all product sets. (default: return all product sets)

Parameters:
pieces - is the maximum number of products set to be returned for one reactant set
Since:
JChem 5.0

setProductIndexes

public void setProductIndexes(int[] inds)
Sets the product indexes (1-based) to be returned (default: null - all products).

Parameters:
inds - is the 1-based product index array, null for all products
Since:
JChem 2.2

setResultType

public void setResultType(int type)
Sets the result type.

Available types:

In case of REACTION_OUTPUT and FUSED_REACTION_OUTPUT the Molecule[] array returned by react() method will contain the reactants -> products reaction as RxnMolecule.

Setting the result type restarts processing of the current reactant set - next call to react() will return the first product set.

Default: PRODUCT_OUTPUT

Parameters:
type - is the result type
Since:
JChem 5.0

setOutputReactionMappingStyle

public void setOutputReactionMappingStyle(int style)
Sets the output reaction's mapping style. Available styles: Default: MAPPING_STYLE_NONE

Parameters:
style - is the output reaction's mapping style
Since:
JChem 3.2

setStandardizer

public void setStandardizer(Standardizer standardizer)
Deprecated. Will be removed. Use Standardizer to standardize reactants.

Sets the reactant standardizer object.

Parameters:
standardizer - is the reactant standardizer object

getStandardizer

public Standardizer getStandardizer()
Deprecated. Will be removed. Use Standardizer to standardize reactants.

Returns the reactant standardizer object.

Returns:
the reactant standardizer object

setIgnoreReactionDefinedStandardizer

public void setIgnoreReactionDefinedStandardizer(boolean ignore)
Deprecated. Will be removed.

Sets to ignore the standardization defined in the STANDARDIZATION RDF/MRV tag of the reaction molecule.

Parameters:
ignore - if true reaction defined standardization is ignored
Since:
JChem 3.2

setProductStandardizer

public void setProductStandardizer(Standardizer productStandardizer)
Deprecated. Will be removed. Use Standardizer to standardize products.

Sets the product standardizer object.

Parameters:
productStandardizer - is the product standardizer object

getProductStandardizer

public Standardizer getProductStandardizer()
Deprecated. Will be removed. Use Standardizer to standardize products.

Returns the product standardizer object.

Returns:
the product standardizer object

setReverse

public void setReverse(boolean reverse)
Sets the "reverse" property: true if the reaction is to be processed in reversed direction, that is, the product and reactant sides are swapped. Default: false. Should be called before calling setReactants(Molecule[]).

Parameters:
reverse - is true if reversed reaction

isReverse

public boolean isReverse()
Returns true if the reaction is to be processed in reversed direction.

Returns:
whether the reaction is to be processed in reversed direction

setSearchOptions

public void setSearchOptions(java.lang.String searchOptions)
Modifies the default search options used by the Reactor engine. Only the specified search options will be modified, others will remain default. Note: modifying the default search options is required in very special cases only. Do not modify the search options, unless you are absolutely aware what you are doing!

Parameters:
searchOptions - is the search options string
Since:
JChem 5.3
See Also:
SearchOptions.setOptions(String)

setCached

public void setCached(boolean cached)
Sets the "cached" property: true if search and calculation results are to be cached and reused.

Parameters:
cached - is the true if search results are to be cached and reused

isCached

public boolean isCached()
Returns the "cached" property: true if search and calculation results are to be cached and reused.

Returns:
the "cached" property
Since:
JChem 2.3

setReactionIDPropertyName

public void setReactionIDPropertyName(java.lang.String reactionIDProp)
Sets the reaction ID property (RDF/MRV tag) name.

Parameters:
reactionIDProp - is the reaction ID property name
Since:
JChem 3.1.6

getReactionIDPropertyName

public java.lang.String getReactionIDPropertyName()
Returns the reaction ID property (RDF/MRV tag) name.

Returns:
the reaction ID property (RDF/MRV tag) name
Since:
JChem 5.5

setComponentIDPropertyNames

public void setComponentIDPropertyNames(java.lang.String reactantIDProp,
                                        java.lang.String productIDProp)
Sets reactant/product ID property (SDF/MRV tag) names.

Parameters:
reactantIDProp - is the reactant ID property name
productIDProp - is the product ID property name
Since:
JChem 3.1.6

setComponentIDPropertyNames

public void setComponentIDPropertyNames(java.lang.String[] reactantIDProps,
                                        java.lang.String[] productIDProps)
Sets reactant/product ID property (SDF/MRV tag) names.

Parameters:
reactantIDProps - is the reactant ID property name array
productIDProps - is the product ID property name array
Since:
JChem 3.1.6

setCopyAllReactantProperties

public void setCopyAllReactantProperties(boolean c)
Sets to copy all reactant properties to output products/reactions.

Parameters:
c - if true then all properties will be copied
Since:
JChem 5.5

setCopyReactantProperties

public void setCopyReactantProperties(java.lang.String[][] reactantPropertiesToCopy)
Sets the reactant properties which should be copied to output products/reactions.

Parameters:
reactantPropertiesToCopy - the properties to be copied
Since:
JChem 5.5

setCopyReactantProperties

public void setCopyReactantProperties(java.util.Map<java.lang.String,java.lang.String> patternBasedProperties)
Sets the reactant properties which should created in output products/reactions, based on a pattern. Contains pairs, where the property pattern is an instance of ((*#{.})+)* where
  • text may contain any string except "#{" and ".." tokens
  • moleculeID is a string that has a numeric postfix optionally:
    • Non-numeric postfix: The reaction is the selected molecule
    • Numeric postfix: index of a reactant (indexing starts from 1)
    • propertyID a property of the molecule identified by the moleculeID (Case sensitive)
    Examples of pattern:
    • Name list: #{R1.NAME}, #{R2.NAME}, #{R3.NAME}
    • LogP values of reactants: 1st: #{reactant1.LOGP}, 2nd: #{reactant2.LOGP}
    • #{Reaction.ID}(#{mol1.ID}, #{mol2.ID}, #{mol3.ID})
    • #{Reaction.ID}(#{R1.corp_ID}, #{R2.NAME}, #{R3.corp_ID}, #{R4.ID})

    Parameters:
    patternBasedProperties - pairs
    Since:
    JChem 5.7

setCopyReactantProperties

public void setCopyReactantProperties(java.lang.String[][] sourceProperties,
                                      java.lang.String[][] targetProperties)
Sets the reactant properties which should be copied to output products/reactions.

Parameters:
sourceProperties - the properties to be copied
targetProperties - the target properties
Since:
JChem 5.5

setRatio

public void setRatio(int[] ratio)

Sets the ratio of the reactants. The length of the ratio array should be equal with the number of reactants in the reaction. If there are more than one reactants in the reaction, then one of the reactant ratios should be 1.

Setting the ratio restarts processing of the current reactant set - next call to react() will return the first product set.

Parameters:
ratio - is the ratio array
Since:
JChem 5.3

setReaction

public void setReaction(Reaction reaction)
Deprecated. Will be removed from the public API.

Sets the reaction in form of a reaction object containing a searcher object and a reactivity condition evaluator object. Should be called before calling setReactants(Molecule[]).

Parameters:
reaction - is the reaction object

setReaction

public void setReaction(Molecule rxmol)
                 throws ReactionException
Sets the reaction with reaction rules set in RDF/MRV tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE. Also sets the reactant standardizer defined in the STANDARDIZATION RDF/MRV tag.

Parameters:
rxmol - is the reaction molecule
Throws:
ReactionException - on error
Since:
JChem 2.3
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

setReaction

public void setReaction(Molecule rxmol,
                        java.lang.String rid)
                 throws ReactionException
Sets the reaction with reaction rules set in RDF/MRV tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE. Also sets the reactant standardizer defined in the STANDARDIZATION RDF/MRV tag.

Parameters:
rxmol - is the reaction molecule
rid - is the reaction ID
Throws:
ReactionException - on error
Since:
JChem 5.3
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

setReaction

public void setReaction(Molecule rxmol,
                        java.lang.String rid,
                        java.lang.String reactivity,
                        java.lang.String selectivity,
                        java.lang.String tolerances)
                 throws ReactionException
Sets the reaction and the reaction rules. Rules can be set to null which means that the rule is not set. Selectivity tolerance is set to the default value: DEF_TOLERANCE if not specified in the Tolerance property. Also sets the reactant standardizer defined in the STANDARDIZATION RDF/MRV tag of the reaction molecule.

Parameters:
rxmol - is the reaction molecule
rid - is the reaction ID
reactivity - is the reactivity rule
selectivity - is the selectivity rule
tolerances - is the tolerance string
Throws:
ReactionException - on error
Since:
JChem 3.1.6
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

setReaction

public void setReaction(Molecule rxmol,
                        java.lang.String rid,
                        java.lang.String reactivity,
                        java.lang.String selectivity,
                        double[] tolerances)
                 throws ReactionException
Sets the reaction and the reaction rules. Rules can be set to null which means that the rule is not set. Also sets the reactant standardizer defined in the STANDARDIZATION RDF/MRV tag of the reaction molecule.

Parameters:
rxmol - is the reaction molecule
rid - is the reaction ID
reactivity - is the reactivity rule
selectivity - is the selectivity rule
tolerances - is the selectivity tolerance array (one for each selectivity rule, null for taking the default tolerance DEF_TOLERANCE for each rule)
Throws:
ReactionException - on error
Since:
JChem 3.1.6
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

getReaction

public RxnMolecule getReaction()
Returns the reaction. The returned reaction is the reaction used internally for reaction processing, it can be different from the input reaction (different reaction maps, R-groups, etc).

Returns:
the reaction
Since:
JChem 5.5

createReactionObject

public Reaction createReactionObject(Molecule rxmol,
                                     java.lang.String rid,
                                     java.lang.String reactivity,
                                     java.lang.String selectivity,
                                     java.lang.String tolerances)
                              throws ReactionException
Deprecated. Will be removed from the public API.

Creates a reaction object with the reaction rules. Both rules can be set to null which means that the rule is not set.

Parameters:
rxmol - is the reaction molecule
rid - is the reaction ID
reactivity - is the reactivity rule
selectivity - is the selectivity rule
tolerances - is the selectivity tolerance array (one for each selectivity rule, null for taking the default tolerance DEF_TOLERANCE for each rule)
Returns:
the reaction object
Throws:
ReactionException - on error
Since:
JChem 3.1.6

createReactionObject

public Reaction createReactionObject(Molecule rxmol,
                                     java.lang.String rid,
                                     java.lang.String reactivity,
                                     java.lang.String selectivity,
                                     double[] tolerances)
                              throws ReactionException
Deprecated. Will be removed from the public API.

Creates a reaction object with the reaction rules. Both rules can be set to null which means that the rule is not set.

Parameters:
rxmol - is the reaction molecule
rid - is the reaction ID
reactivity - is the reactivity rule
selectivity - is the selectivity rule
tolerances - is the selectivity tolerance array (one for each selectivity rule, null for taking the default tolerance DEF_TOLERANCE for each rule)
Returns:
the reaction object
Throws:
ReactionException - on error
Since:
JChem 3.1.6

setReactionString

public void setReactionString(java.lang.String str)
                       throws ReactionException
Sets the reaction and optionally the reaction rules specified in a string. The reaction is specified in reaction SMARTS format, the reaction rules are preceded by a prefix denoting the rule type: In the simplest case the string is the reaction SMARTS string itself and no reaction rules are specified. Example:
 [Cl:4][C:3]=O.[#7:2][H:1]>>[#7:2][C:3]=O.[Cl:4][H:1]
 
Rules can be added with the type prefixes described above, items separated by "..". Example:
 [Cl:4][C:3]=O.[#7:2][H:1]>>[#7:2][C:3]=O.[Cl:4][H:1]..r:charge(ratom(4)) > 1.2..s:tpsa(product(0))..t:0.5
 

Parameters:
str - is the reaction configuration string described above
Throws:
ReactionException - on configuration error
Since:
JChem 2.3

setReactionString

public void setReactionString(java.lang.String str,
                              java.lang.String rid)
                       throws ReactionException
Sets the reaction and optionally the reaction rules specified in a string. The reaction is specified in reaction SMARTS format, the reaction rules are preceded by a prefix denoting the rule type: In the simplest case the string is the reaction SMARTS string itself and no reaction rules are specified. Example:
 [Cl:4][C:3]=O.[#7:2][H:1]>>[#7:2][C:3]=O.[Cl:4][H:1]
 
Rules can be added with the type prefixes described above, items separated by "..". Example:
 [Cl:4][C:3]=O.[#7:2][H:1]>>[#7:2][C:3]=O.[Cl:4][H:1]..r:charge(ratom(4)) > 1.2..s:tpsa(product(0))..t:0.5
 

Parameters:
str - is the reaction configuration string described above
rid - is the reaction ID
Throws:
ReactionException - on configuration error
Since:
JChem 3.1.6

getReactantCount

public int getReactantCount()
Returns the number of reactants.

Returns:
the number of reactants

getProductCount

public int getProductCount()
Returns the number of products.

Returns:
the number of products

getReactionReactant

public Molecule getReactionReactant(int i)
Returns a reaction reactant.

Parameters:
i - is the reactant index
Returns:
a reaction reactant
Since:
JChem 3.1

getReactionProduct

public Molecule getReactionProduct(int i)
Returns a reaction product.

Parameters:
i - is the reactant index
Returns:
a reaction product
Since:
JChem 3.1

getReactants

public Molecule[] getReactants()
Returns the input reactants.

Returns:
the input reactants
Since:
JChem 5.5

restart

public void restart()
Restarts the reactor: the following call to react() will return the first product set.


setReactant

public void setReactant(Molecule mol)
                 throws ReactionException
Sets single reactant.

Parameters:
mol - the reactant molecule
Throws:
ReactionException - if setting the reactant fails
Since:
JChem 3.1

setReactants

public void setReactants(java.lang.String molstr)
                  throws ReactionException
Sets the reactants from a multi-fragment SMILES string: fragments separated by '.' are taken as separate reactants, therefore it is not possible to set a multi-fragment reactant with this method (use setReactants(Molecule[] mols) for this purpose). The reaction should be set beforehand.

Parameters:
molstr - is the reactant molecule string, reactants separated by '.'
Throws:
ReactionException - if setting the reactants fails
Since:
JChem 2.3

setReactants

public void setReactants(Molecule[] mols)
                  throws ReactionException
Sets the reactants. The reaction should be set beforehand.

Parameters:
mols - is the reactant array
Throws:
ReactionException - if setting the reactants fails

react

public Molecule[] react()
                 throws ReactionException
Performs the reaction. Returns the next product list, or null if there are no more product lists. Product lists are ordered according to priority if a selectivity rule is specified.

In single mode, returns only single results, that is, returns null if here are more than one product lists (see setSingle(boolean)).

In transform mode, returns the transformed input molecule, in this case the output is always non-null and there is one output per input molecule, repeated calls return the same.

The reaction should be set beforehand.

The reactants should be set beforehand by setReactants(Molecule[]) or setReactant(Molecule).

Returns:
the next product list, or null if there are no more product lists
Throws:
ReactionException - on reaction processing error

setRemoveDuplicateProductReferences

public void setRemoveDuplicateProductReferences(boolean rmduprefs)
Sets to remove product reference repetitions from the generated product array. If set react() will return an array with unique product references (the order of the molecule objects in the return product array is preserved). Default: false

Parameters:
rmduprefs - is true if duplicate product references should be removed from the product array returned by react()
Since:
JChem 5.0

isLicensed

public boolean isLicensed()
Specified by:
isLicensed in interface chemaxon.license.Licensable

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Deprecated. ConcurrentReactorProcessor provides command line interface for Reactor command line application.

Command line entry point.

Parameters:
args - is the command line argument array
Throws:
java.lang.Exception - on error