These examples demonstrate simple reaction processing with different combinations of the most popular command line options. The reaction file is reaction.rxn and the two reactants are stored in reactant1.mol and reactant2.mol.
For the simplest reaction processing type:
or else you can also give the reaction and the reactants in SMARTS/SMILES string form:
The -r
command line option specifies the reaction file or string, while input files/SMILES strings (without preceeding command line option) are taken as reactants. The resulting products are written to the standard output in SMILES format:
The result is written in reaction form if the -t
command line option is specified with reaction
output type:
The result in this case is:
You can also save the result in a file by specifying the output file in the -o
option:
A different output file format can be specified in the -f
option:
Now go back to the first example. You may want to get rid of the second products. You can do this by specifying the required product index in the -x
option:
The result is:
Note, that multiple product indexes can also be specified by an index list separated by commas, without spaces (e.g. select the first and the third from a 3-product reaction by: -x 1,3
).
Save the previous output in SDF format:
Show the result in MView:
Note, that under UNIX/Linux it is also possible to pipe the result directly to MView without saving it:
Go back to the first example and save the first product list (specify the number of results to be returned in -p
):
Assume that you have products.smiles and you want to know the reactants that can be formed to these products by processing the reaction reaction.rxn. That is, you want to process the reaction in reversed direction. You can do this by the -s
option:
The result is:
which includes our two original reactants.
The use and meaning of command-line options in the above commands:
Option | Description | Default |
---|---|---|
-r | specifies the reaction file | - |
-t | specifies the output type ('reaction' or 'product') | 'product' |
-f | specifies the output format (e.g. 'sdf', 'mol', 'rxn') | 'smiles' |
-o | specifies the output file path | standard output (console) |
-x | extract specified products (e.g. 1,3 ) | return all products |
-p | the maximum number of product lists to be returned (e.g. 2 ) | return all product lists |
-s | take reversed reaction | take reaction as it is |
A UNIX command that reads reactants from the mols.sdf
file, processes the reaction defined in the r.rxn
file and writes the resulting reaction molecules to the standard output in smiles format:
The same but returns only the second and the third products (note that 2,3
should be written without white space in between):
This example specifies the reaction with reactivity rule and the reactants on the command line, extracts the first product:
The same with an additional selectivity rule and tolerance:
A UNIX command that reads reactants from the mols.sdf
file, processes the reaction defined in the r.rxn
file and writes the product molecules in the file named products.sdf
to be created in the same directory:
The same with verbose output, returning only one product list, then displaying the result in MarvinView:
Assume that the reaction file r.rdf
contains a selectivity rule. Product lists are sorted by decreasing selectivity, all product lists are accepted (-n t
ignores selectivity tolerance). The result is displayed using MarvinView:
Note that such piping does not work in Windows.
Processes a reversed reaction and ignoring both reactivity and selectivity rules:
Performs a reaction on multiple reactants in combinatorial mode, returns the first two product lists sorted by selectivity, for each reactant pairs:
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:
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.