Initial Scripts¶
You can define molecule sets and other constants in the user-defined initial script $HOME/chemaxon/MARVIN_MAJOR_VERSION/jep.script(Windows) or $HOME/.chemaxon/MARVIN_MAJOR_VERSION/jep.script (UNIX / Linux), where $HOME is your user home directory, and MARVIN_MAJOR_VERSION is the major version of Marvin (e.g. "5.1").
This script is run right after the molecule sets are read and the constants defined here can be used later in your chemical expressions. Any valid chemical terms assignment is allowed here, and the terminating ';' characters may be omitted as long as you write each assignment in a separate line. Typically, you will define a molecule set by
-
listing its members:
-
or deriving it from other sets with the help of set operators:
where "
+"means set-union, "*"means set-join and "-"means exclusion.
Predefined molecules and molecule sets are most useful in query definitions of the match function:
match(amide)will test whether the input molecule matches an amide group,match(reactant(0), {amide,amine})will test whether the first reactant in a reaction context matches an amide or an amine
match(2, {metalloid,alcohol}, 1)will check whether atom2of the input molecule matches either a metalloid or an alcohol carbon - the last parameter1denotes the query atom map which picks the carbon from the alcohol definition;match(ratom(2), {metalloid,alcohol}, 1)is the same in a reaction context with checking target reactant atom which corresponds to the reactant atom with map2in the reaction equation.