Reaction Rules
Reactor transforms starting compounds to products according to a given chemical reaction scheme. The reaction scheme defines the way how the reactants are converted to products, and additional rules can encode the related knowledge to produce synthetically more feasible molecules. Rules of the reaction scheme, such as selectivity, reactivity, and exclude, are defined in Chemical Terms language.
Reactor processes reactants to products according to the reaction equation. It follows that in order that the reactants could be transformed into products, they should contain the functional groups as substructures specified by the reactant side of the reaction equation. However, for a reaction taking place in nature, usually this is not sufficent: the reactivity of the molecules may depend on other substructural matching conditions as well as chemical features such as partial charges, pKa, logP, logD values of the reactants and/or the created products. It is also possible that although the reactants contain multiple functional groups so that they can be transformed to products in more than one ways, some of these possibilities are more frequent than others due to differences in spacial or chemical stability of the created products.
Reaction rules are evaluated by the Chemical Terms Evaluator. Before evaluating the expression, Reactor sets the currently processed reactants and products in the reaction context. In this way the reactants, products and mapped atoms of their functional groups according to the reaction equations can be accessed from the expression by the following functions:
-
reactant(int i): refers to the i-th reactant (0-based indexing)
-
product(int i): refers to the i-th product (0-based indexing)
-
ratom(int m): refers to the reactant atom corresponding to reactant atom map m according to the reaction equation
-
patom(int m): refers to the product atom corresponding to product atom map m according to the reaction equation
Apart from these reaction specific functions, expression strings can also reference built-in functions, plugins as well as user-defined functions and plugins. A set of reaction rule examples is contained in the Chemical Terms Language Reference.
The reaction rules can be specified in different ways:
-
in RDF/MRV tags (REACTIVITY, EXCLUDE, SELECTIVITY, TOLERANCE) of the reaction file;
-
in the reaction string specified in the --reactioncommand line parameter: items separated by "..", with the following prefixes:
-
"r:" - reactivity rule (including exlude rule AND-ed in negated form)
-
"s:" - selectivity rule(s)
-
"t:" - selectivity tolerance(s)
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));-charge(ratom(2))..t:0.5;0.001
-
A set of reaction rule working examples is also available.