The Evaluatorclass provides an interface to the Chemical Terms library. It requires the creation of aChemJEPobject. ChemJEP is the actual expression parser/compiler and evaluator for the chemical terms in in the Evaluator call. The API forEvaluatorpresents many fine examples but we will present a simple case as example. This command will calculate the first acidic pKa for a molecule.

For how to get the Molecule from the selected row see theReading a molecule scriptlet.

import chemaxon.jep.Evaluator
import chemaxon.jep.ChemJEP
import chemaxon.jep.context.MolContext
import chemaxon.struc.Molecule
import chemaxon.formats.MolImporter

// create the molecule. We use benzoic acid
Molecule mol = MolImporter.importMol('c1ccccc1C(=O)O')

// evaluator stuff
Evaluator evaluator = new Evaluator()
ChemJEP chemJEP = evaluator.compile("pKa('acidic','1')", MolContext.class)
MolContext context = new MolContext()
def result = chemJEP.evaluate(context)
println "result=$result"

Versions: This script has been tested on IJC version 6.0

Copyright © 1999-2012 ChemAxon Ltd.    All rights reserved.