|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.reaction.Reaction
public class Reaction
Stores reaction data. The reaction data consists of:
| Field Summary | |
|---|---|
static int |
ALL_SIDE
Reactant and product sides of the reaction molecule |
protected int |
bcount
Number of changed bonds. |
static int |
DATA_ALL
Required data: all. |
static int |
DATA_ATOMS
Required data: atom data. |
static int |
DATA_BONDS
Required data: bond data. |
static int |
DATA_DOUBLE_BOND_STEREO
Required data: double bond stereo. |
static int |
DATA_PARITY
Required data: parity. |
protected int[] |
emaps
End map numbers: bond atom2. |
protected static int |
LEN
Default array length. |
protected int[] |
map2map
Identical maps. |
protected int[] |
map2pindex
Map number -> product index array. |
protected int[] |
map2rindex
Map number -> reactant index array. |
protected int[] |
map2stereo
Map -> reaction stereo info array. |
protected static int |
MAXMAPS
Maximal number of map values. |
protected java.util.ArrayList |
patomprops
Atom objects for storing product atom properties. |
protected int[] |
pbondtypes
Product bond types. |
protected java.util.ArrayList |
pcistrans
Stores double bond stereo info (product-side). |
protected int[] |
pindex2map
Product index -> map number array. |
protected java.util.ArrayList |
pparities
Stores parity info (product-side). |
static int |
PRODUCT_SIDE
Product side of the reaction molecule |
protected static int |
PROP_CHARGE
Constant: charge atom property. |
protected static int |
PROP_HCOUNT
Constant: hydrogen count atom property. |
protected static int |
PROP_RADICAL
Constant: radical atom property. |
protected static int |
PROP_STGRP
Constant: enhanced stereo atom property. |
protected int[] |
proptypes
Property types corresponding to 'ratomprops', 'patomprops'. |
protected java.util.ArrayList |
ratomprops
Atom objects for storing reactant atom properties. |
protected int[] |
rbondtypes
Reactant bond types. |
protected java.util.ArrayList |
rcistrans
Stores double bond stereo info (reactant-side). |
static int |
REACTANT_SIDE
Reactant side of the reaction molecule |
protected int[] |
rindex2map
Reactant index -> map number array. |
protected ChemJEP |
rjep
The JEP object that evaluates the reactivity (acceptance) rule. |
protected java.util.ArrayList |
rparities
Stores parity info (reactant-side). |
protected RxnMolecule |
rxn
The reaction molecule. |
protected ChemJEP |
sjep
The JEP object that evaluates the selectivity (measure) rule. |
protected int[] |
smaps
Start map numbers: bond atom1. |
protected double[] |
tolerances
The tolerance value corresponding to the selectivity rule. |
| Constructor Summary | |
|---|---|
Reaction()
Default constructor. |
|
Reaction(java.lang.String id)
Constructor. |
|
| Method Summary | |
|---|---|
protected int |
getBaseMap(int map)
Returns the base map corresponding to the given map. |
int[] |
getChangingAtoms(boolean all,
int side)
Returns the indexes of changing atoms. |
int[][] |
getChangingBondData(boolean all)
Returns changing bond data. |
protected java.lang.String |
getFID()
Deprecated. Not used. |
java.lang.String |
getID()
Returns the reaction ID. |
protected Molecule |
getProduct(int i)
Returns the i-th product. |
protected MolAtom |
getProductAtom(int i)
Returns the i-th atom existing only on the product side. |
protected int |
getProductAtomCount()
Returns the number of atoms existing only on the product side. |
protected int |
getProductCount()
Returns the number of products. |
protected Molecule[] |
getProducts()
Returns the reaction products. |
Molecule |
getReactant(int i)
Returns the i-th reactant. |
protected MolAtom |
getReactantAtom(int i)
Returns the i-th atom existing only on the reactant side. |
protected int |
getReactantAtomCount()
Returns the number of atoms existing only on the reactant side. |
int |
getReactantCount()
Returns the number of reactants. |
protected Molecule[] |
getReactants()
Returns the reaction reactants. |
static java.lang.String |
getReactivity(java.lang.String reactivity,
java.lang.String exclude)
Returns reactivity combined with exclude condition. |
static double[] |
getTolerances(java.lang.String tolerances)
Returns double[] created from ";" separated list of
real numbers. |
void |
setFID(java.lang.String fid)
Deprecated. Not used. |
void |
setReaction(Molecule mol)
Sets the reaction molecule representing the reaction equation. |
void |
setReaction(Molecule mol,
boolean fuse)
Sets the reaction molecule representing the reaction equation. |
void |
setReaction(Molecule mol,
boolean fuse,
boolean skipMappingCheck)
Sets the reaction molecule representing the reaction equation. |
void |
setReactivityRule(java.lang.String rule,
Evaluator evaluator)
Sets the reactivity (acceptance) rule. |
void |
setRequiredData(int data)
Sets the required data to be stored. |
void |
setSelectivityRule(java.lang.String rule,
double[] tolerances,
Evaluator evaluator)
Sets the selectivity rule with tolerance. |
void |
setSelectivityRule(java.lang.String rule,
Evaluator evaluator)
Deprecated. Use setSelectivityRule(String, double[], Evaluator) or
setSelectivityRule(String, String, Evaluator) and set
tolerances parameter to null |
void |
setSelectivityRule(java.lang.String rule,
java.lang.String tolerances,
Evaluator evaluator)
Sets the selectivity rule with tolerance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int MAXMAPS
protected static final int LEN
protected static final int PROP_CHARGE
protected static final int PROP_RADICAL
protected static final int PROP_STGRP
protected static final int PROP_HCOUNT
public static final int REACTANT_SIDE
public static final int PRODUCT_SIDE
public static final int ALL_SIDE
public static final int DATA_ATOMS
public static final int DATA_BONDS
public static final int DATA_PARITY
public static final int DATA_DOUBLE_BOND_STEREO
public static final int DATA_ALL
protected RxnMolecule rxn
protected ChemJEP rjep
protected ChemJEP sjep
protected double[] tolerances
protected int[] map2map
protected int[] smaps
protected int[] emaps
protected int[] rbondtypes
protected int[] pbondtypes
protected int bcount
protected int[] proptypes
protected java.util.ArrayList ratomprops
protected java.util.ArrayList patomprops
protected int[] map2stereo
protected int[] map2rindex
-1 if the mapped atom
exists only on the product side.
protected int[] map2pindex
-1 if the mapped atom
exists only on the reactant side.
protected int[] rindex2map
protected int[] pindex2map
protected java.util.ArrayList rparities
protected java.util.ArrayList pparities
protected java.util.ArrayList rcistrans
StereoConstants.CIS,
StereoConstants.TRANS,
StereoConstants.CTUNSPECprotected java.util.ArrayList pcistrans
StereoConstants.CIS,
StereoConstants.TRANS,
StereoConstants.CTUNSPEC| Constructor Detail |
|---|
public Reaction()
public Reaction(java.lang.String id)
id - is the reaction ID| Method Detail |
|---|
public void setRequiredData(int data)
DATA_ALL.
data - is the required data, an OR-ed combination of the
DATA_ constants (e.g. DATA_ATOMS | DATA_BONDS)DATA_ATOMS,
DATA_BONDS,
DATA_PARITY,
DATA_DOUBLE_BOND_STEREOpublic int[][] getChangingBondData(boolean all)
DATA_BONDS flag should be set
to get this result (see setRequiredData(int)). By default,
all flags are set.
Format: an array of int[6] elements.
If we denote one such int[6] element by 'b' then:
-1 if bond exists only on the product side
-1 if atom exists only on the product side
-1 if atom exists only on the product side
-1 if bond exists only on the reactant side
-1 if atom exists only on the reactant side
-1 if atom exists only on the reactant side
all - is true if all changing bonds should be returned,
false if bonds between orphan/widow atoms should be
excluded
public int[] getChangingAtoms(boolean all,
int side)
DATA_BONDS flag should be set to include atoms having changing bonds
and the DATA_ATOMS flag should be set to include atoms having changing
atom properties (see setRequiredData(int)). By default,
all flags are set.
all - is true if all changing atoms should be returned,
false if orphan/widow atoms with only orphan/widow
neighbours should be excludedside - REACTANT_SIDE to get changing atoms from the reactant side
PRODUCT_SIDE to get changing atoms from the product side
ALL_SIDE to get all changing atoms
public static java.lang.String getReactivity(java.lang.String reactivity,
java.lang.String exclude)
reactivity && !exclude
reactivity - is the reactivity ruleexclude - is the exclude rule
public static double[] getTolerances(java.lang.String tolerances)
throws ReactionException
double[] created from ";" separated list of
real numbers. Empty string in the list is converted to Reactor.DEF_TOLERANCE.
tolerances - is the string: ";" separated list of real numbers
double[]
ReactionException - on format error
public void setReactivityRule(java.lang.String rule,
Evaluator evaluator)
throws ReactionException
true
precisely if the products should be accepted.
Evaluation of the reactivity rule precedes the evaluation of the
selectivity rule set by setSelectivityRule(String, Evaluator).
rule - is the rule chemical terms stringevaluator - is the evaluator object
ReactionException - on parse error
public void setSelectivityRule(java.lang.String rule,
Evaluator evaluator)
throws ReactionException
setSelectivityRule(String, double[], Evaluator) or
setSelectivityRule(String, String, Evaluator) and set
tolerances parameter to null
Reactor.DEF_TOLERANCE.
This rule is used to sort product sets by decreasing evaluation order,
that is, the product set with the largest evaluation result will be
returned first by Reactor.react().
The tolerance value is used to filter product sets based on their selectivity
compared to the maximal selectivity: a product set is accepted only if
the difference between the maximum selectivity and its selectivity
is not greater than the specified tolerance.
The default tolerance is set such that only values that are approximately
equal to the maximum are accepted.
rule - is the rule chemical terms stringevaluator - is the evaluator object
ReactionException - on parse error
public void setSelectivityRule(java.lang.String rule,
java.lang.String tolerances,
Evaluator evaluator)
throws ReactionException
tolerances parameter is
null then default tolerance (Reactor.DEF_TOLERANCE) is used.
This rule is used to sort product sets by decreasing evaluation order,
that is, the product set with the largest evaluation result will be
returned first by Reactor.react().
The tolerance value is used to filter product sets based on their selectivity
compared to the maximal selectivity: a product set is accepted only if
the difference between the maximum selectivity and its selectivity
is not greater than the specified tolerance.
rule - is the rule chemical terms string, items separated by ";"evaluator - is the evaluator objecttolerances - is the selectivity acceptance tolerance string,
items separated by ";". If null then
Reactor.DEF_TOLERANCE is used.
ReactionException - on parse error
public void setSelectivityRule(java.lang.String rule,
double[] tolerances,
Evaluator evaluator)
throws ReactionException
tolerances parameter is
null then default tolerance (Reactor.DEF_TOLERANCE) is used.
This rule is used to sort product sets by decreasing evaluation order,
that is, the product set with the largest evaluation result will be
returned first by Reactor.react().
The tolerance value is used to filter product sets based on their selectivity
compared to the maximal selectivity: a product set is accepted only if
the difference between the maximum selectivity and its selectivity
is not greater than the specified tolerance.
rule - is the rule chemical terms string, items separated by ";"evaluator - is the evaluator objecttolerances - is the selectivity acceptance tolerance array. If null then
Reactor.DEF_TOLERANCE is used.
ReactionException - on parse errorpublic java.lang.String getID()
public void setFID(java.lang.String fid)
fid - is the fragmentation IDprotected java.lang.String getFID()
public Molecule getReactant(int i)
i - is the reactant index
protected Molecule[] getReactants()
public int getReactantCount()
protected Molecule getProduct(int i)
i - is the product index
protected Molecule[] getProducts()
protected int getProductCount()
protected int getProductAtomCount()
protected MolAtom getProductAtom(int i)
i - is the atom index
protected int getReactantAtomCount()
protected MolAtom getReactantAtom(int i)
i - is the atom index
public void setReaction(Molecule mol)
throws ReactionException
mol - is the reaction molecule
ReactionException - on error (standardization, mapping, ...)
public void setReaction(Molecule mol,
boolean fuse)
throws ReactionException
mol - is the reaction moleculefuse - is true if reaction reactants / products
should be fused to form a 1-reactant 1-product molecule
used in Standardizer and Reactor
transform mode (see Reactor.setTransform(boolean))
ReactionException - on error (standardization, mapping, ...)
public void setReaction(Molecule mol,
boolean fuse,
boolean skipMappingCheck)
throws ReactionException
mol - is the reaction moleculefuse - is true if reaction reactants / products
should be fused to form a 1-reactant 1-product molecule
used in Standardizer and Reactor
transform mode (see Reactor.setTransform(boolean))skipMappingCheck - if true reaction mapping will not be checked
ReactionException - on error (standardization, mapping, ...)protected int getBaseMap(int map)
map - is the map
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||