Reactor
Version 5.3.6
Contents
- Introduction
- ChemAxon's Reaction Library
- Application (GUI)
- The command-line tool
- Input
- Output
- Reaction file
- Reaction mapping
- Orphan atoms
- Isotopes
- Reaction stereo
- Reaction rules
- Usage examples
- Working examples
- A simple JSP example
- Frequently asked questions (FAQ)
- References
- Developer's Guide
Introduction
Reactor is a virtual reaction processing tool which transforms starting compounds to products according to a given chemical reaction definition. The reaction scheme defines the way that the reactants are converted to products, and additional rules can encode the related knowledge to produce synthetically feasible molecules.
Atoms having changing bonds are marked by so called map numbers on both sides of the reaction arrow. The corresponding atoms on the two sides of the reaction arrow are identified by the same map number, but the atom maps cannot be duplicated on one side. When a map number appears only on one side of the reaction scheme, it marks an orphan atom. An orphan atom on the reactant side is removed, an orphan atom on the product side is added during the reaction. Note, that Reactor supports other mapping styles having different mapping logic.
Additional reaction rules can be specified in the reaction file that refine the reactive functional groups, define the corresponding regioselectivity rules, and exclude molecules possibly causing side reactions. These rules are formulated in Chemical Terms, which is a language containing logic and arithmetic operators, and lots of chemical structure related functions including many physicochemical predictions.
Reactor supports RXN, RDF and SMIRKS (all features of reaction SMARTS are available). The format of input and output molecules can be MRV, MOL, SDF, SMILES, CML and many others.
Example
![]() |
![]() |
![]() |
will produce the following products:
![]() |
![]() |
A set of working examples are also provided.
ChemAxon's Reaction Library
ChemAxon provides some generic virtual reactions as examples for reaction designers (Download demo library). Additionally, Reactor Pro users can enjoy a library of important synthetic organic reactions predesigned by experts (Download full library). Though, many of these reactions produce feasible products in most cases, the predictions can be improved if needed in the reaction editor. ChemAxon does not consider the reaction library a completed product. New reactions are added continuously and the existing ones are refined according to the tests and the feedback received via the forum.
ChemAxon's Reaction library is available in the JChem package in a password protected zip file.
Application (GUI)
Reactor GUI is an easy-to-use, high-end graphical user interface for the Reactor tool of ChemAxon. This GUI allows you to reach all the functionalities of the Reactor without the need of using the command-line with parameters.
The Reactor GUI will provide you a friendly way to process virtual reactions rapidly generating compound libraries. Reactions containing rules defined in the Chemical Terms language can provide synthetically feasible products.
Usage
react
Alternatively, on Win32, Unix or Mac / Java 2 (assuming that JChem is installed with creating shortcuts to Desktop or to the Start Menu):
by double-clicking the appropriate icon
Step by step:
1. First select a reaction definition from reaction file.
- Reactor - reaction library

2. When a reaction is selected, load the corresponding reactants from files.
- Reactor - reactant file browsing
3. Set runtime options for reaction processing.
- Reactor - reactor option

- Output file: the output file containing the generated results (required)
- Reactant combination: combine all reactants (combinatorial) or not (sequential: first-first, second-second,...).
In combinatorial mode, the input molecules are filtered by matching the reactant in the
reaction scheme thus product generation is faster.
- Output type: generate product molecules or the specific reactions
- Mapping style: output reactions are mapped
- Ratio: setting the stoichiometry of the reaction in case of more than one
reagents. The number of textboxes always correspond the number of reagents. The first reagent
from the left will be assigned a coefficient of 1, all other reagents may be set by the user (only natural numbers, including 0).
This ratio is considered as the number of cycles of the reaction. Zero (0) means an infinite number of cycles.
For example, a reaction on a primary amine group will be repeated until all hydrogens are substitued if the ratio
coefficient is 0, and halting at a secondary amine if the coefficient is 1.
- Product standardization: you can beautify the resulting compounds with post-standardization
- Unambigous only: do not process reactions providing isomers
- Ignore rules: the reaction's rules can be ignored (especially for testing)
- Included products: unchecked products are not generated (for example to discard eliminated HCl)
4. Run the reaction and generate products in batch mode.
- Reactor - progress
- Reactor - results
Input and Output
Input reaction library file can be added by browsing it from the file system. Reactor supports MRV, RXN, RDF and SMIRKS (all features of reaction SMARTS are available). The format of input and output molecules can be MRV, MOL, SDF, SMILES, CML, InChI and many others.
Fused reaction output
If a reaction yields several products (e.g. nitration of toluene), all products are included in one reaction. Products appering in all variations are depicted only once (e.g. H2O)
Reaction Editor
You can also set different parameters of your reaction in the reaction editor. For example reactivity, selectivity, exclude rules, etc.
- Reaction editor - reaction scheme
- Reaction editor - reaction examples
- Reaction editor - reaction properties
See this page for detailed list of reaction properties.
Related links:
Reactor FAQ Chemicalt Terms Chemical Terms functions Reactor command line help Developers guide
The command-line tool
react [<input file(s)/string(s)>] -r <reaction file/string> [<options>]
Prepare the usage of the react script or batch file
as described in Preparing the
Usage of JChem Batch Files and Shell Scripts.
Alternatively, the Reactor class can be directly
invoked:
Win32 / Java 2 (assuming that JChem is installed in c:\jchem):
java -cp "c:\jchem\lib\jchem.jar;%CLASSPATH%" \
chemaxon.reaction.Reactor [<input file(s)/strings(s)>] \
-r <reaction file/string> [<options>]
Unix / Java 2 (assuming that JChem is installed in /usr/local/jchem):
java -cp "/usr/local/jchem/lib/jchem.jar:$CLASSPATH" \
chemaxon.reaction.Reactor [<input file(s)/strings(s)>] \
-r <reaction file/string> [<options>]
Options
General options:
-h, --help this help message
-L, --list-reaction-names <filename>
list reaction names
-s, --reverse reverse reaction
-z, --transform transform mode:
creates 1-reactant 1-product
reaction to process all reaction
centers at the same time, preserves
atom coordinates where possible
-u, --use-cache cache search/plugin results
-l, --single process unambiguous reactions only
(with each reactant having a single
active reaction site)
-n, --no-rules <type> ignore reaction rules,
depending on type:
r - ignore reactivity rule
s - ignore selectivity rule
t - ignore selectivity tolerance
rs - ignore both reactivity and
selectivity rules
rt - ignore reactivity rule and
selectivity tolerance
-S, --standardize <file/string> standardize reactants according to
configuration
-T, --standardize-products <file/string>
standardize products according to
configuration
-m, --mode <mode> processing mode,
valid modes are:
comb for combinatorial,
seq for sequential
(default: seq)
Input options:
-N, --reaction-name <name> reaction name
-i, --reaction-id <id> reaction ID
-I, --reaction-id-tag <id-tag> RDF/MRV tag storing the reaction ID
-R, --reactant-id-tag <id-tag(s)> SDF/MRV tag storing the reactant IDs
a comma-separated list of tags
if it differs for each reactant
-P, --product-id-tag <id-tag(s)> SDF/MRV tag storing the product IDs
a comma-separated list of tags
if it differs for each product
-r, --reaction <filepath/string> reaction file or SMARTS string
optionally with reaction rules
-A, --skip-reaction-mapping-check skip reaction mapping check
(default: check reaction mapping)
-g, --ignore-error continue with next molecule on error
Output options:
-f, --format <format> output file format (default: smiles)
-o, --output <filepath> output file (default: standard output)
-p, --pieces <pieces> number of product lists to be returned
(default: all)
-w, --allow-duplicates allow product list duplicates for
efficiency (default: no duplicates)
-t, --type <output-type> output type
(not available in transform mode):
reaction for reaction molecule output,
product for product array output
(default: product)
-M, --map-result <mapping-style> output reaction mapping style:
changing for ChemAxon style
(map all changing atoms)
matching for Daylight style
(map all matching atoms)
complete for complete mapping
(map all atoms)
(default: none)
-x, --extract <i1,i2,...> return only the specified products:
i1,i2,... is the comma-separated
list of 1-based product indexes
according to reaction equation
-k, --remove-duplicate-refs remove duplicate product references
within product lists
-v, --verbose verbose output with time results
The input file(s) provide the reactant molecules. If the number
of reactant molecules matches the number of reactant molecules in the
reaction equation then a single reaction is processed with the specified
reactants. However, if the number of reactants exceeds the number of
reactants required by the reaction equation then one input file is taken
in place of each reactant. The order of the reactants / reactant files
corresponds to the reactant order in the reaction specified in the --reaction parameter. Reactants
are processed according to the --mode command line
parameter in either combinatorial or sequential
mode.
The output is the list of product molecules or reaction equations
written in the format specified by the --format command
line parameter.
The command line parameter --reaction
specifies the path and filename of the reaction file or else the
reaction SMARTS string with rules.
The command line parameter --reaction-name
specifies the name of reaction, which should be selected from the reaction file
(has only sense if there are multiple reactions in the reaction file).
If the command line parameter --skip-reaction-mapping-check
is specified then the mapping of the (input) reaction will not be checked.
If the command line parameter --single
is specified then the resulting product list is accepted only if there
is only one possible product list. If there are more than one product
lists then no result will be returned. This option is useful if we want
to process the reaction only if it can be processed unambiguously, that
is, if there is only one possible reaction center in each reactant.
If the command line parameter --reverse
is specified then the two sides of the reaction are swapped: products
are taken as reactants and reactants are taken as products, ie, the
reversed reaction is performed. For example, using the reaction in the introduction with --reverse
specified, the products in the example taken as reactants
will produce the reactants in the example as products.
If the command line parameter --transform is
specified then the original input molecule is modified according to the
reaction equation. The reaction equation is fused to form a 1-reactant
1-product reaction. Instead of producing different products for each
reaction center, all reaction centers are processed at the same time.
Atom coordinates are preserved where possible. This mode is equivalent
to a single reaction step in Standardizer.
Reaction rules cannot be applied in this case.
Reactant standardization can be
specified in the --standardize, product standardization in the --standardize-products
option. Reactant standardization
configuration can be given also in the STANDARDIZATION RDF/MRV tag of the
reaction file. The standardization configuration
is given either directly in a simple action
string or as a configuration
XML. Each reactant and each product can be standardized
separately using standardizer
task groups: group containing the first reactant can be refered as
"reactant1", group containing the second reactant as "reactant2", etc..
Standardization is optional.
By default, Reactor processes all reaction centers: that is, finds all functional groups matching the corresponding reaction reactant and produces all possible single products (react multisite products again as reactants to gain multi-substituted products). For example, using the reaction in the introduction with the following reactants:
![]() |
![]() |
will produce the following products with an additional HCl
molecule for each of them:
![]() |
![]() |
![]() |
![]() |
If a reactivity rule is specified then Reactor returns only the product lists satisfying the rule.
If a selectivity rule is specified then Reactor sorts the product lists by the evaluation result of the rule (decreasing order) and returns product lists in this order. The selectivity tolerance determines the acceptance range of the selectivity rule, only the main product lists are accepted by default.
The maximum number of product lists returned can be specified in
the command line parameter --pieces.
If the --no-rules parameter is specified then some
of the reaction rules are ignored depending on the parameter value:
r: the reactivity rule is ignoreds: the selectivity rule is ignoredt: the selectivity tolerance is ignored (all selectivity rule evaluation results are accepted)rs: ignore both the reactivity rule and the selectivity rulert: ignore the reactivity rule and the selectivity tolerance (apply the selectivity rule only without tolerance, that is, all selectivity values are accepted and the selectivity rule is only used to sort the product lists)
If the command line parameter --use-cache
is specified then substructure search and plugin calculation results are
stored and reused. This is useful if the --all parameter is
specified and/or there are multiple reactants since otherwise processing
all combination of the reaction centers would result in substructure
search repetitions. The --use-cache mode may also increase
efficiency if the rule list contains the same plugin calculation for the
same atom/molecule more than once.
The --mode parameter determines
the grouping of reactants in case of multiple reactant input:
- in combinatorial mode all possible groupings are processed, while
- in sequential mode reactant molecules with the same order index are grouped, repeating the last molecules if input files contain different number of molecules.
2
molecules:
m1
and
m2
while the second contains
3
molecules:
M1
,
M2
and
M3
then
- in combinatorial mode every molecule in
the first file is paired with every molecule in the second and
alltogether
6reactions are processed:m1 - M1 m1 - M2 m1 - M3 m2 - M1 m2 - M2 m2 - M3
- in sequential mode the first molecules in
the two files are paired, then the second molecules are paired, finally
the second molecule in the first file is paired with the third molecule
in the second file, processing
3reactions alltogether:m1 - M1 m2 - M2 m2 - M3
If the command line parameters --reactant-id-tag
and --product-id-tag are specified, then an ID is generated
and stored for each product in the specified SDF/MRV data field. If only
one of them is specified then both of them are set to this value. If
each reactant/product has its ID in a different tag then specify them in
a comma-separated list in the reactant/product order of the reaction. It
is necessary to specify the reaction ID as well, either directly in the
--reaction-id parameter, or else in form of a RDF/MRV data
field of the reaction file where the field name is given in the --reaction-id-tag
parameter.
The product ID has the following form:
R(A1, A2, ..., An):i/jwhere
R
is the reaction ID,
A1, ..., An
are the reactant IDs,
i
is the product list index (1-based) and
j
is the product index according to the reaction equation (1-based). These
two together make the product ID unique.
/j
is omitted in case of 1-product reactions.
If the reaction processing is reversed then a '_' sign is appended after the reaction ID. Reactant/product ID tag names are taken according to the original reaction.
In case when a sequence of reactions is processed, the product ID encapsulates the reaction path that generated the molecule. For example:
reaction ID: R1 first reactant ID: A1 second reactant ID: B1 ID of the first product: R1(A1, B1):1/1 ID of the second product: R1(A1, B1):1/2 reaction ID: R2 first reactant ID: R1(A1, B1):1 (this is the first product of the first reaction) second reactant ID: C8 assume that there are two possible ways to process the reaction (two reaction centers) in the first product list ID of the first product: R2(R1(A1, B1):1/1, C8):1/1 ID of the second product: R2(R1(A1, B1):1/1, C8):1/2 in the second product list ID of the first product: R2(R1(A1, B1):1/1, C8):2/1 ID of the second product: R2(R1(A1, B1):1/1, C8):2/2
If the command line parameter --ignore-error is
specified, then errors will not stop the processing but
the error is written to the console and the molecule is skipped. By
default, the program exits in case of errors.
If the --allow-duplicates
parameter is specified no duplicate check is performed and product lists
may be returned repeatedly: these repetitions occur when symmetrical
reactants are processed and multiple search results provide duplicated
product lists. By default, these duplicates are filtered and returned
only once, but this increases process time. Therefore this option is
useful if efficiency is crucial or else if we do not care about
duplicates.
If the --extract parameter is specified then only
the required products are returned (by default all products specified in
the reaction equation are returned). The required products are specified
by 1-based product indexes according to the reaction equation. For
example, -x 1 returns only the first product while -x
1,3 returns the first and the third products. Note that this
comma-separated list of product indexes should not contain whitespace
characters.
The command line parameter --type determines whether
the output should include the complete reaction as input reactants are
mapped to products (reaction) or should include the product
molecules only (product).
If the command line parameter --map-result is
specified, then the resulting reaction will be mapped. The possible mapping styles are listed
below:
- "changing": map all changing atoms (ChemAxon style), all changing atoms will be mapped
- "matching": map all matching atoms (Daylight style, all atoms will be mapped, except orphan atoms)
- "complete": map all atoms
The command line parameter --remove-duplicate-refs
can be used to remove product repetitions when the number of products in
the reaction equation does not match the number of created products:
this typically happens when cutting ring bonds. For example, take the
reaction equation:
![]() |
with the reactant:
![]() |
Then the Reactor will produce two identical products:
![]() |
Although there is only one product (since the cleaved bond is a
ring bond), the Reactor returns a product molecule for each product item
in the reaction equation by default. Since in this case the same
molecule corresponds to both product items, the product molecule will be
duplicated, unless the --remove-duplicate-refs is set. If
the --remove-duplicate-refs parameter is specified then
product molecule duplicates are removed and the result is a possibly
smaller product array than that of the reaction equation. In the example
above, only one of the identical molecules is returned if this option is
set.
Input
Most molecular file formats are accepted ( MDL molfile, Compressed molfile, SDfile, Compressed SDfile, SMILES, etc.).
If no input file name is given in the command line the standard input is read.
Output
Reactor writes output molecules in the format specified by the --format
option (the default format is "smiles"). If the --output is
omitted, results are written to the standard output. If the output type
specified by the --type option is "reaction" then the
accepted output formats are restricted to those that can store
reactions, e.g. "smiles", "rdf" and "mrv" are such formats.
Reaction file
Reaction can be specified in a
reaction file with the --reaction
command line parameter. Supported file formats are: MRV, RDF, RXN, and
SMIRKS/SMARTS. If the reaction is given in RDF or MRV format, then it
is also possible to set the reaction rules, the reactant standardization, and some additional properties
in RDF/MRV tags. See epoxide+nucleophile.rdf
and epoxide+nucleophile.mrv
for an example:
![]() |
Reaction string
It is also possible to specify the
reaction rules in the reaction string specified in the --reaction command line parameter
in which case the above reaction is written in the following form:
[C:1]1C[O:2]1.[H:4][N,S:3][#6]>>[#6][N,S:3][C:1]C[#8:2]..s:hcount(ratom(1))..t:1.5The reaction string is a reaction SMARTS, optionally followed by reaction rules 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)
Reaction mapping
Atom mapping in the reaction equation serves for identifying atoms on the reactant and product sides: an atom having different neighboring atoms, attached bonds, chirality on the reactant and the product sides should be mapped with the same unique atom map on both sides.
Reactor requires that changing atoms were mapped. A reaction atom is called changing in any of the following cases:
- it is an orphan atom (should be mapped with unique atom maps)
- it has different atomic properties (e.g. charge) in the reactant and the product sides
- any of its attached bonds is changed, created or deleted in the reaction
- it is a stereo center (if retention or inversion is defined by wedges then at least all but one neighboring non-hydrogen atoms should also be mapped)
- it is a member of a changing double bond stereo atom quartet
Remark: it follows that unmapped atoms are not changed in the reaction - they exist on both sides and have the same neighborhood with the same attaching bond types on both sides. Mapping more atoms than necessary (possibly all atoms) makes no harm but increases processing time a little bit.
By default Reactor checks whether all changing atoms of the reaction are mapped,
and if not, then maps all atoms (original atom maps are preserved,
only unmapped atoms will be mapped). This check can be ignored using the
--skip-reaction-mapping-check
command line option.
Examples:
| changing bond type | ![]() |
| orphan atoms | ![]() |
| chirality | ![]() |
| double bond stereo | ![]() |
Other reaction mapping styles
Reactor also supports the Daylight mapping style where all matching atoms should be mapped instead of mapping changing atoms. A reaction atom is called matching if it is not an orphan atom: it exists on both sides of the reaction.
If the reaction is partially mapped or not mapped at all, Reactor can use automatical mapping to match the reactant and product sides. Predefined maps are never changed, only unmapped atoms will be mapped by the automapping procedure. Stereo centers and query features are not considered in the current version of automapping, therefore it is suggested to pre-map these atoms manually.
An example for the different mapping styles is shown in the table below:
| ChemAxon (changing atoms) |
Daylight (matching atoms) |
Partial (completed by automapping) |
|---|---|---|
![]() |
![]() |
![]() |
Orphan atoms
Atoms appearing only one side of the reaction arrow are called 'orphan' atoms. Reactions containing orphan atoms are also processed by the Reactor but atoms removed or created should be mapped with unique atom maps. Atoms on the reactant side with maps missing on the product side will be removed while atoms on the product side with maps missing on the reactant side will be created.
Examples:
Take the reaction
![]() |
Actual reaction according to the definition above
![]() |
If a reaction includes substitution of a hydrogen on a carbon atom, the hydrogens should be expressed as explicit hydrogen atoms and marked as orphan atoms. Thus substitution only occurs on these explicit hydrogens.
Isotopes
Reactor handles isotopes as well. If the reaction equation includes isotopes on the reactant side, the transformation will only occur if the molecule matches the isotope information as well. For traditional names like deuterium and tritium, the abbreviations D and T are also accepted.
A practical example for the usage is a deuterium labelling reaction:
![]() |
Reaction stereo
Chirality
Reaction stereo centers can be defined in two ways:
- as an INVRET (inversion/retention) atom property in the MOL (or RXN, RDF) form
- by setting atom parity using up/down-wedge bonds
In both cases the stereo center should be mapped with the same atom map on the reactant and the product sides.
The difference is that while reactions defined by the INVRET atom property match both stereo configurations as well as the non-stereo form, the up/down wedge stereo definition will only match the stereo configuration specified in the reactant side of the reaction.
While the first possibility is more effective, it is not available in SMILES. If reaction stereo information is given by the second option and there are at least two unmapped non-hydrogen ligands connected to the stereo center, then the INVRET (inversion/retention) atom property is first determined by preprocessing the reaction and then the reaction processing is done as in the first case. If the ligands of the stereo center are sufficiently mapped (that is, there is at most one unmapped non-hydrogen ligands) then there is no need of this preprocession and the reaction handling is more effective.
The advantage of the second option is that it is also available in SMILES.
If the RETENTION atom property is specified then the
stereo configuration in the reactants is kept in the products, while in
case of INVERSION the stereo configuration is inverted.
Limitations:
- by setting atom parity using up/down-wedge bonds (second option) with at least two unmapped non-hydrogen ligands only one stereo center can be specified per reaction
- the stereo configuration can be processed only if at most one atom changes around the stereo center
Examples:
The following reaction defines a stereoselective reaction:
![]() |
Reactor reacts the first compound according to the above equation, but not the second one, since the reactant is not matching:
![]() |
![]() |
The inversion/retention flag can be used to define stereoselective reactions producing the appropriate chiral compounds from both enantiomers. The definition:
![]() |
and the actual stereo reactions inverting the reaction center (please note, that the third reactant is racemic, thus the product is racemic as well; toluene-p-sulphonic acid is not shown in the example):
![]() |
![]() |
![]() |
Double bond stereo
To propagate the cis/trans stereo configuration in the reaction definition to the reaction product, the corresponding four atoms should be mapped. For example, the following reaction changes the double bond configuration from cis to trans. Reactor can process double bond isomerisation reactions when the corresponding double bond ligands (at least four atoms) are mapped (the small square on the double bond marks stereo specific matching):
![]() |
The actual reaction equations. The trans-coumarin is transformed while the cis isomer is not:
![]() |
![]() |
Instead of CIS or TRANS configuration on the product side, you can also specify an undetermined double bond stereo configuration, denoted by a wiggly bond:
![]() |
In this case you will get the same cis-or-trans configuration in the actual product, denoted by a wiggly bond in the same way as in the reaction equation:
![]() |
If you also set unspecified double bond stereo on the reactant side of the reaction equation:
![]() |
then the cis-coumarin will also be transformed:
![]() |
Double bond stereo configuration on atoms not taking part in the
reaction is left unchanged. However, there may be cases when the double
bond stereo type cannot be determined: if the double bond has stereo
configuration (that is, different ligands attached to at least one of
the end-atoms) but there is neither an unmapped, nor a fully mapped A1-A2=A3-A4
configuration along which the configuration could be determined. In such
cases an error is reported if the --check parameter is
specified, otherwise the double bond stereo type is unpredictable. To
prevent this, map a full A1-A2=A3-A4 atom configuration for
each double bond on the product side of the reaction that has at least
one mapped ligand.
Reaction rules
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 thei-th reactant (0-based indexing)product(int i): refers to thei-th product (0-based indexing)ratom(int m): refers to the reactant atom corresponding to reactant atom mapmaccording to the reaction equationpatom(int m): refers to the product atom corresponding to product atom mapmaccording 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.
There are two types of reaction rules that are processed by Reactor:
- Reactivity rules are boolean expressions describing natural conditions - these conditions should be satisfied, otherwise the reaction does not take place. An additional Exclude rule can be specified which exludes product lists even if they satisfy the reactivity rule.
- Selectivity rules are
real-valued chemical expressions that order products according to their
occurrence. The selectivity tolerance
determines the acceptance selectivity interval. Products are returned
by Reactor only if the difference between their computed selectivity
and the maximum selectivity value is within the specified tolerance.
The default tolerance is
0.0001which essentially means that only the maximum selectivity value is accepted.Multiple selectivity rules can be specified by separating the rules by ";" characters. The corresponding tolerance values are also specified as a ";"-separated list, where the empty string refers to the default tolerance. When sorting product lists by the evaluation result of multiple selectivity rules, the order of the selectivity rules determines their precedence: the results of the first selectivity rule are compared first, then in case of approximate equality, the results of the second selectivity rule are compared, and so on. For example, assume we have two selectivity rules:
charge(ratom(1)); pka(ratom(2))where reactant atom map1is in the first reactant and reactant atom map2is in the second reactant. Assume we have two matches for both, with different evaluation results:0.2,0.1for the charge and5.3,4.2for the pKa. The sorted evaluation results are the following:0.2; 5.3 0.2; 4.2 0.1; 5.3 0.1; 4.2
Product lists are returned in this order if we ignore tolerance. However, with tolerance values0.15; 0.5only the first and the third product lists are returned (why?):0.2; 5.3 0.1; 5.3
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.
Usage examples
- A UNIX command that reads reactants from the
mols.sdffile, processes the reaction defined in ther.rxnfile and writes the resulting reaction molecules to the standard output in smiles format:react -r r.rxn mols.sdf
- The same but returns only the second and the third products
(note that
2,3should be written without white space in between):react -r r.rxn -x 2,3 mols.sdf
- This example specifies the reaction with reactivity rule and
the reactants on the command line, extracts the first product:
react -r "[Cl:4][C:3]=O.[#7:2][H:1]>>[#7:2][C:3]=O.[Cl:4][H:1]..r:charge(ratom(4)) > -1.2" \ "CCCC(Cl)=O" "NCCC1CCCCC1" -x 1
- The same with an additional selectivity rule and tolerance:
react -r "[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:psa(product(0))..t:1.5" \ "CCCC(Cl)=O" "NCCC1CCCCC1" -x 1
- A UNIX command that reads reactants from the
mols.sdffile, processes the reaction defined in ther.rxnfile and writes the product molecules in the file namedproducts.sdfto be created in the same directory:react -r r.rxn mols.sdf -f sdf -o products.sdf
- The same with verbose output, returning only one product list,
then displaying the result in MarvinView:
react -r r.rxn mols.sdf -p 1 -f sdf -o products.sdf -v mview products.sdf
- Assume that the reaction file
r.rdfcontains a selectivity rule. Product lists are sorted by decreasing selectivity, all product lists are accepted (-n tignores selectivity tolerance). The result is displayed using MarvinView:react -r r.rdf -n t r1.mol r2.mol | mview -
Note that such piping does not work in Windows.
- Processes a reversed reaction and ignoring both reactivity and
selectivity rules:
react -r r.rdf -n rs -s r1.mol r2.mol -o products.sdf
- Performs a reaction on multiple reactants in combinatorial
mode, returns the first two product lists sorted by selectivity, for
each reactant pairs:
react -r r.rdf -m comb -p 2 r1.sdf r2.sdf -o products.sdf
- The same without preloading input molecules into memory (
-e,--file-storage). This slows reaction processing and is necessary only if there are a lot of input molecules (thousands) in which case the JVM would run out of memory by holding all input molecules:react -r r.rdf -e -m comb -p 2 r1.sdf r2.sdf -o products.sdf
- Create product IDs from reaction and reactant IDs. The
reaction ID is
R1. Read the reactant IDs from the ID and CD_ID tags for the first and the second reactants, respectively, write the generated ID to the PID tag in the product SDF.react -r r1.rdf -f sdf a1.sdf a2.sdf -i R1 -R ID,CD_ID -P PID
References
Bode, J. W. Computer Software Reviews. J. Am. Chem. Soc. 2004 , 126(46) , 15317-15317.Leave a Reply
You must be logged in to post a comment.
Newcomer? Register here! Forgot your password? Get it back!










































