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 command line interface and API to single reaction processing.

See the documentation for details.

An example usage of the API:

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

 // set properties (reverse mode)
 reactor.setReverse(true);

 // 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 result
 Molecule[] products = reactor.react();

 // create reaction molecule
 RxnMolecule result = reactor.createReaction(products);
 

Another example with reaction rules:

 // 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 the reactants
 reactor.setReactants(reactants);

 // get the result
 Molecule[] products = reactor.react();
 

Since:
JChem 3.0
Version:
JChem 5.1, 04/10/2008
Author:
Nora Mate, Zsolt Mohacsi
See Also:
Serialized Form

Field Summary
static int DEF_MAX_TRANSFORM_COUNT
          The default maximum transform count.
static double DEF_TOLERANCE
          The default tolerance.
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.
static int SEQUENCE_OUTPUT
          Output type: sequence.
 
Constructor Summary
  Reactor()
          Default constructor.
protected Reactor(chemaxon.reaction.ReactorConfiguration rc)
          Deprecated. As of JChem 3.2 Reactor configuration XML files are not supported.
 
Method Summary
 RxnMolecule createReaction(Molecule[] products)
          Creates reaction output from the reactants set by setReactants(Molecule[]) and the products created in react().
 Reaction createReactionObject(Molecule rxmol)
          Deprecated. Use setReaction(Molecule).
 Reaction createReactionObject(Molecule rxmol, java.lang.String reactivity, java.lang.String selectivity, double[] tolerances)
          Deprecated. Use setReaction(Molecule, String, String, String, double[]) and set rid parameter to null.
 Reaction createReactionObject(Molecule rxmol, java.lang.String reactivity, java.lang.String selectivity, java.lang.String tolerances)
          Deprecated. Use setReaction(Molecule, String, String, String, String) and set rid parameter to null.
 Reaction createReactionObject(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, double[] tolerances)
          Creates a reaction object with the reaction rules.
 Reaction createReactionObject(Molecule rxmol, java.lang.String rid, java.lang.String reactivity, java.lang.String selectivity, java.lang.String tolerances)
          Creates a reaction object with the reaction rules.
 RxnMolecule[] createReactions(Molecule[] products)
          Creates reaction sequence output from the reactants set by setReactants(Molecule[]), intermediate reactants and products and the final products created in react().
 int getProductCount()
          Returns the number of products.
 Standardizer getProductStandardizer()
          Returns the product standardizer object.
 int getReactantCount()
          Returns the number of reactants.
 java.lang.String getReactionID()
          Returns the reaction sequence ID.
 Molecule getReactionProduct(int i)
          Returns a reaction product.
 Molecule getReactionReactant(int i)
          Returns a reaction reactant.
 chemaxon.util.SearchAttributes getSearchAttributes()
          Returns the search attributes.
 Standardizer getStandardizer()
          Returns the reactant standardizer object.
 boolean isCached()
          Returns the "cached" property: true if search and calculation results are to be cached and reused.
 boolean isLicensed()
          Returns information about the licensing of the product.
 boolean isReverse()
          Returns true if the reaction is to be processed in reversed direction.
 boolean isSingle()
          Returns true if single mode.
 boolean isUnique()
          Deprecated. Not used.
static void main(java.lang.String[] args)
          Command line entry point.
 Molecule[] react()
          Performs the reaction.
static Molecule[] removeDuplicateProductReferences(Molecule[] products)
          Deprecated. Use setRemoveDuplicateProductReferences(boolean)
 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 setDuplicateFiltering(int duplicateFilteringMethod)
          Sets duplicate product list filtering.
 void setFragmentTag(java.lang.String ftag)
          Sets the fragment data tag name.
 void setIgnoreReactionDefinedStandardizer(boolean ignore)
          Sets to ignore the standardization defined in the STANDARDIZATION RDF/MRV tag of the reaction molecule.
 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
protected  void setJEP(ChemJEP jep)
          Sets the reactor (synthesis) JEP object.
 void setLicenseEnvironment(java.lang.String env)
          Every license can have a modifier environment that's tipically an integration environment.
 void setMaxNumberOfProductSets(int pieces)
          Sets the maximum number of products sets to be returned for one reactant set.
 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)
          Sets the product standardizer object.
 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 reactivity)
          Deprecated. Use setReaction(Molecule, String, String, String, double[]) or setReaction(Molecule, String, String, String, String) and set rid, selectivity and tolerances parameters to null.
 void setReaction(Molecule rxmol, java.lang.String reactivity, java.lang.String selectivity)
          Deprecated. Use setReaction(Molecule, String, String, String, double[]) or setReaction(Molecule, String, String, String, String) and set rid and tolerances parameters to null.
 void setReaction(Molecule rxmol, java.lang.String reactivity, java.lang.String selectivity, double[] tolerances)
          Deprecated. Use setReaction(Molecule, String, String, String, double[]) and set rid parameter to null.
 void setReaction(Molecule rxmol, java.lang.String reactivity, java.lang.String selectivity, java.lang.String tolerances)
          Deprecated. Use setReaction(Molecule, String, String, String, String) and set rid parameter to null.
 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)
          Sets the reaction in form of a reaction object containing a searcher object and a reactivity condition evaluator object.
 void setReaction(java.lang.String rid)
          Deprecated. As of JChem 3.2 Reactor configuration XML files are not supported.
 void setReactionIDPropertyName(java.lang.String reactionIDProp)
          Sets the reaction ID property (RDF/MRV tag) name.
 void setReactions(Molecule[] rxmols)
          Sets the reaction sequence with reaction rules set in RDF tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE.
 void setReactions(Reaction[] reactions)
          Sets a reaction sequence.
 void setReactions(Reaction[] reactions, java.lang.String id)
          Sets a reaction sequence.
 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 returned by react() method.
 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 setSearchAttributes(chemaxon.util.SearchAttributes attributes)
          Sets the search attributes.
 void setSingle(boolean single)
          Sets single mode.
 void setSkipReactionMappingCheck(boolean skip)
          Sets to skip reaction mapping check.
 void setStandardizer(Standardizer standardizer)
          Sets the reactant standardizer object.
 void setTransform(boolean transform)
          Deprecated. Use Standardizer.
 void setUnique(boolean unique)
          Deprecated. Use setDuplicateFiltering(int) instead
 
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

SEQUENCE_OUTPUT

public static final int SEQUENCE_OUTPUT
Output type: sequence. For internal use only.

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
The default maximum transform count.

See Also:
Constant Field Values
Constructor Detail

Reactor

public Reactor()
Default constructor.


Reactor

protected Reactor(chemaxon.reaction.ReactorConfiguration rc)
           throws ReactionException
Deprecated. As of JChem 3.2 Reactor configuration XML files are not supported.

Constructor with configuration.

Parameters:
rc - is the configuration object
Throws:
ReactionException - on configuration error
Method Detail

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 sequence ID. For internal use only.

Returns:
the reaction sequence ID
Since:
JChem 2.3

setJEP

protected void setJEP(ChemJEP jep)
Sets the reactor (synthesis) JEP object.

Parameters:
jep - is the JEP object

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

setUnique

public void setUnique(boolean unique)
Deprecated. Use setDuplicateFiltering(int) instead

Sets whether multiple product lists should be returned only once. The default is true. Note that skipping duplicate product list check increases efficiency therefore it is wise to set this parameter to false if duplicates do not matter (e.g. if only the first product list is queried by calling react() only once).

Parameters:
unique - is true if multiple product lists should be returned only once, false if no duplicate check should be performed

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

isUnique

public boolean isUnique()
Deprecated. Not used.

Returns true if multiple product lists should be returned only once. The default is true.

Returns:
true if multiple product lists should be returned only once
Since:
JChem 2.3

setMaxNumberOfProductSets

public void setMaxNumberOfProductSets(int pieces)
Sets the maximum number of products sets to be returned for one reactant set. Set -1 to return all product sets. (default: -1, 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 returned by react() method. If PRODUCT_OUTPUT then the Molecule[] array returned by react() will contain the generated products, if REACTION_OUTPUT then the Molecule[] array returned by react() will contain the reactants -> products reaction. 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)
Sets the reactant standardizer object.

Parameters:
standardizer - is the reactant standardizer object

getStandardizer

public Standardizer getStandardizer()
Returns the reactant standardizer object.

Returns:
the reactant standardizer object

setIgnoreReactionDefinedStandardizer

public void setIgnoreReactionDefinedStandardizer(boolean ignore)
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)
Sets the product standardizer object.

Parameters:
productStandardizer - is the product standardizer object

getProductStandardizer

public Standardizer getProductStandardizer()
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

setSearchAttributes

public void setSearchAttributes(chemaxon.util.SearchAttributes attributes)
Sets the search attributes.

Parameters:
attributes - is the attribute object

getSearchAttributes

public chemaxon.util.SearchAttributes getSearchAttributes()
Returns the search attributes.

Returns:
the search attributes
Since:
JChem 3.1

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

setFragmentTag

public void setFragmentTag(java.lang.String ftag)
Sets the fragment data tag name.

Parameters:
ftag - is the fragment data tag name

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

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

setReactions

public void setReactions(Molecule[] rxmols)
                  throws ReactionException
Sets the reaction sequence with reaction rules set in RDF tags REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE. For internal use only.

Parameters:
rxmols - is the reaction array making up the sequence
Throws:
ReactionException - on error
Since:
JChem 2.3

setReactions

public void setReactions(Reaction[] reactions)
Sets a reaction sequence. For internal use only.

Parameters:
reactions - is the reaction array

setReactions

public void setReactions(Reaction[] reactions,
                         java.lang.String id)
Sets a reaction sequence. For internal use only.

Parameters:
reactions - is the reaction array
id - is the sequence ID

setReaction

public void setReaction(Reaction reaction)
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(java.lang.String rid)
                 throws ReactionException
Deprecated. As of JChem 3.2 Reactor configuration XML files are not supported.

Sets the reaction by reaction ID from the configuration.

Parameters:
rid - is the reaction ID
Throws:
ReactionException - on error or if the configuration is not set
See Also:
#Reactor(File)

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 reactivity)
                 throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, double[]) or setReaction(Molecule, String, String, String, String) and set rid, selectivity and tolerances parameters to null.

Sets the reaction and the reaction rules. The rule 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
reactivity - is the reactivity rule
Throws:
ReactionException - on error
Since:
JChem 2.3
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

setReaction

public void setReaction(Molecule rxmol,
                        java.lang.String reactivity,
                        java.lang.String selectivity)
                 throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, double[]) or setReaction(Molecule, String, String, String, String) and set rid and tolerances parameters to null.

Sets the reaction and the reaction rules. Both 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
reactivity - is the reactivity rule
selectivity - is the selectivity rule
Throws:
ReactionException - on error
Since:
JChem 2.3
See Also:
setIgnoreReactionDefinedStandardizer(boolean)

setReaction

public void setReaction(Molecule rxmol,
                        java.lang.String reactivity,
                        java.lang.String selectivity,
                        java.lang.String tolerances)
                 throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, String) and set rid parameter to null.

Sets the reaction and the reaction rules. Both 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
reactivity - is the reactivity rule
selectivity - is the selectivity rule
tolerances - is the tolerance string
Throws:
ReactionException - on error
Since:
JChem 2.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. Both 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 reactivity,
                        java.lang.String selectivity,
                        double[] tolerances)
                 throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, double[]) and set rid parameter to null.

Sets the reaction and the reaction rules. Both 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
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 2.3
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. Both 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)

createReactionObject

public Reaction createReactionObject(Molecule rxmol)
                              throws ReactionException
Deprecated. Use setReaction(Molecule).

Creates a reaction object with the reaction rules defined in RDF tags: REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE.

Parameters:
rxmol - is the reaction molecule
Returns:
the reaction object
Throws:
ReactionException

createReactionObject

public Reaction createReactionObject(Molecule rxmol,
                                     java.lang.String reactivity,
                                     java.lang.String selectivity,
                                     java.lang.String tolerances)
                              throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, String) and set rid parameter to null.

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
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 2.3

createReactionObject

public Reaction createReactionObject(Molecule rxmol,
                                     java.lang.String rid,
                                     java.lang.String reactivity,
                                     java.lang.String selectivity,
                                     java.lang.String tolerances)
                              throws ReactionException
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 reactivity,
                                     java.lang.String selectivity,
                                     double[] tolerances)
                              throws ReactionException
Deprecated. Use setReaction(Molecule, String, String, String, double[]) and set rid parameter to null.

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
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 2.3

createReactionObject

public Reaction createReactionObject(Molecule rxmol,
                                     java.lang.String rid,
                                     java.lang.String reactivity,
                                     java.lang.String selectivity,
                                     double[] tolerances)
                              throws ReactionException
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

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 (see setTransform(boolean)).

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

removeDuplicateProductReferences

public static Molecule[] removeDuplicateProductReferences(Molecule[] products)
Deprecated. Use setRemoveDuplicateProductReferences(boolean)

Removes product reference repetitions, returns the input product array itself if there were no repetitions, a new array with the unique product references otherwise. The order of the molecule objects in the product array is preserved.

Parameters:
products - is the product array returned by react()
Returns:
a product array with unique molecule references

createReaction

public RxnMolecule createReaction(Molecule[] products)
                           throws ReactionException
Creates reaction output from the reactants set by setReactants(Molecule[]) and the products created in react().

Parameters:
products - is the product array returned by react()
Returns:
the reaction molecule created from the preset reactants and the given products
Throws:
ReactionException - in transform mode

createReactions

public RxnMolecule[] createReactions(Molecule[] products)
Creates reaction sequence output from the reactants set by setReactants(Molecule[]), intermediate reactants and products and the final products created in react(). For internal use only.

Parameters:
products - is the product array returned by react()
Returns:
the reaction molecules created from the preset reactants, the intermediate products and the given final products

isLicensed

public boolean isLicensed()
Description copied from interface: chemaxon.license.Licensable
Returns information about the licensing of the product. Example implementation: return LicenseHandler.getInstance().isLicensed( LicenseHandler.MY_IDENTIFIER, licenseEnvironment );

Specified by:
isLicensed in interface chemaxon.license.Licensable
Returns:
true if the product is correctly licensed

setLicenseEnvironment

public void setLicenseEnvironment(java.lang.String env)
Description copied from interface: chemaxon.license.Licensable
Every license can have a modifier environment that's tipically an integration environment. All being Licensable should be prepared to store and show a set environment to the LicenseHandler. Example implementation:
 private String licenseEnvironment = "";
 public void setLicenseEnvironment(String env) {
     licenseEnvironment = env;
 }
 

Specified by:
setLicenseEnvironment in interface chemaxon.license.Licensable
Parameters:
env - environment String to be stored and passed to the LicenseHandler in the isLicensed method

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Command line entry point.

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