chemaxon.marvin.calculations
Class logDPlugin

java.lang.Object
  extended bychemaxon.marvin.plugin.CalculatorPlugin
      extended bychemaxon.marvin.calculations.logDPlugin

public class logDPlugin
extends CalculatorPlugin

Plugin class for logD calculation.


Field Summary
 
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin
ATOM, CHART, MOLECULE, NAN, SUBRESULT
 
Constructor Summary
logDPlugin()
          Constructor.
 
Method Summary
 double calclogD(double pH)
          Returns the logD value at fixed pH.
 void checkMolecule(Molecule mol)
          Checks the input molecule.
protected  java.lang.String getLicenseKey()
          Returns the built-in license key for the given plugin class.
 double[] getlogDs()
          Returns the logD array.
 java.lang.String getOutputClassName()
          Returns the output provider class name for the command line interface.
 double[] getpHs()
          Returns the pH array.
 double[] getReflogDs()
          Returns the reference logD array.
 double[] getRefpHs()
          Returns the reference pH array.
 java.lang.Object getResult(java.lang.Object type, int index)
          Returns the result item for the specified type and index.
 java.lang.Object getResult(java.lang.Object type, java.lang.String arg)
          Returns the result item for the specified pH.
 java.lang.String getResultAsString(java.lang.Object type, int index, java.lang.Object result)
          Returns the specified result in String format.
 int getResultCount(java.lang.Object type)
          Returns the number of result items for the given result key.
 int getResultDomain(java.lang.Object type)
          Returns the calculation domain CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE.
 java.lang.Object[] getResultTypes()
          Returns the result types.
 java.lang.String getXAxisLabel(java.lang.Object type)
          Returns the X axis label to be displayed in case of chart data.
 java.lang.String[] getXLabels()
          Returns the X label array (pH array as String[]).
 java.lang.String getYAxisLabel(java.lang.Object type)
          Returns the Y axis label to be displayed.
 boolean run()
          Runs the logD calculation.
protected  void setInputMolecule(Molecule mol)
          Sets the input molecule.
 void setParameters(java.util.Properties params)
          Sets the input parameters for the plugin.
protected  void standardize(Molecule mol)
          Standardizes the molecule.
 
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
check, checkLicense, checkLicenseKey, create, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getDoublePrecision, getErrorMessage, getReferenceMolecule, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getTypeString, handlesMultiFragmentMolecules, isLicensed, isNegligibleResult, isRgrouped, setDoublePrecision, setDoublePrecision, setLicense, setMolecule, setMolecule, standardizeNitro, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

logDPlugin

public logDPlugin()
Constructor. Creates the charge calculator object.

Method Detail

getLicenseKey

protected final java.lang.String getLicenseKey()
Returns the built-in license key for the given plugin class. This license key has to be checked against the license key read from the property file.

Overrides:
getLicenseKey in class CalculatorPlugin
Returns:
the built-in license key for the given plugin class
See Also:
CalculatorPlugin.checkLicense()

setParameters

public void setParameters(java.util.Properties params)
                   throws PluginException
Sets the input parameters for the plugin. Charge parameters and value ranges:

Specified by:
setParameters in class CalculatorPlugin
Parameters:
params - is the parameter table
Throws:
PluginException - on error

checkMolecule

public void checkMolecule(Molecule mol)
                   throws PluginException
Checks the input molecule. Throws exception if the molecule is RxnMolecule, if the molecule contains R-groups or if the molecule consists of more than one fragments.

Overrides:
checkMolecule in class CalculatorPlugin
Parameters:
mol - is the input molecule
Throws:
PluginException - with error message for the user if the molecule is refused

setInputMolecule

protected void setInputMolecule(Molecule mol)
                         throws PluginException
Sets the input molecule.

Specified by:
setInputMolecule in class CalculatorPlugin
Parameters:
mol - is the (standardized) input molecule
Throws:
PluginException - on error

run

public boolean run()
            throws PluginException
Runs the logD calculation.

Specified by:
run in class CalculatorPlugin
Returns:
true if the calculation was successful, false on calculation problems
Throws:
PluginException - on error
See Also:
CalculatorPlugin.getErrorMessage()

calclogD

public double calclogD(double pH)
                throws PluginException
Returns the logD value at fixed pH.

Parameters:
pH - is the pH value
Returns:
the logD value at the given pH
Throws:
PluginException - on error

getResultTypes

public java.lang.Object[] getResultTypes()
Returns the result types. Possible result types: "logD", "reflogD".

Specified by:
getResultTypes in class CalculatorPlugin
Returns:
the result types

getRefpHs

public double[] getRefpHs()
Returns the reference pH array.

Returns:
the reference pH array

getReflogDs

public double[] getReflogDs()
Returns the reference logD array.

Returns:
the reference logD array

getpHs

public double[] getpHs()
Returns the pH array.

Returns:
the pH array

getlogDs

public double[] getlogDs()
Returns the logD array.

Returns:
the logD array

getXAxisLabel

public java.lang.String getXAxisLabel(java.lang.Object type)
Returns the X axis label to be displayed in case of chart data.

Overrides:
getXAxisLabel in class CalculatorPlugin
Parameters:
type - is the result type

getYAxisLabel

public java.lang.String getYAxisLabel(java.lang.Object type)
Returns the Y axis label to be displayed.

Overrides:
getYAxisLabel in class CalculatorPlugin
Parameters:
type - is the result type

getResultDomain

public int getResultDomain(java.lang.Object type)
Returns the calculation domain CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE. Can be combined with CalculatorPlugin.CHART to denote chart-type data. logD returns CalculatorPlugin.MOLECULE combined with CalculatorPlugin.CHART for type "logD", CalculatorPlugin.MOLECULE combined with CalculatorPlugin.SUBRESULT for type "reflogD".

Specified by:
getResultDomain in class CalculatorPlugin
Parameters:
type - is the result type
Returns:
CalculatorPlugin.MOLECULE
See Also:
CalculatorPlugin.getResultTypes()

getResultCount

public int getResultCount(java.lang.Object type)
Returns the number of result items for the given result key. logD returns 1.

Specified by:
getResultCount in class CalculatorPlugin
Parameters:
type - is the result type
Returns:
the number of result items
See Also:
CalculatorPlugin.getResultTypes()

getResult

public java.lang.Object getResult(java.lang.Object type,
                                  int index)
                           throws PluginException
Returns the result item for the specified type and index. logD returns the main or reference (pH, logD) arrays as a double[2][] with the 0-th element the pH array and the 1-st element the logD array.

Specified by:
getResult in class CalculatorPlugin
Parameters:
type - is the result type: "logD" or "reflogD"
index - is the result index
Returns:
the result item for the specified type and index
Throws:
PluginException - if the result cannot be returned
See Also:
CalculatorPlugin.getResultTypes()

getResult

public java.lang.Object getResult(java.lang.Object type,
                                  java.lang.String arg)
                           throws PluginException
Returns the result item for the specified pH.

Overrides:
getResult in class CalculatorPlugin
Parameters:
type - is the result type (not used)
arg - is the pH as string
Returns:
the result item for the specified pH
Throws:
PluginException - if the result cannot be returned
See Also:
CalculatorPlugin.getResultTypes()

getResultAsString

public java.lang.String getResultAsString(java.lang.Object type,
                                          int index,
                                          java.lang.Object result)
                                   throws PluginException
Returns the specified result in String format. logD returns the rounded (pH, logD) value pairs in string format: the values are rounded using the 'precision' input parameter that determines the number of fractional digits displayed, pH and logD are separated by a tab character.

Specified by:
getResultAsString in class CalculatorPlugin
Parameters:
type - is the result type
index - is the result index
result - is the result item
Returns:
the specified result in String format
Throws:
PluginException - if an invalid result item is given

getXLabels

public java.lang.String[] getXLabels()
Returns the X label array (pH array as String[]).

Overrides:
getXLabels in class CalculatorPlugin
Returns:
the X label array

getOutputClassName

public java.lang.String getOutputClassName()
Returns the output provider class name for the command line interface.

Overrides:
getOutputClassName in class CalculatorPlugin
Returns:
the output provider class name

standardize

protected void standardize(Molecule mol)
Standardizes the molecule. This is done by performing the transformations necessary to run the plugin (e.g. aromatize, dehydrogenize, bring nitro groups to common form). Apart from the default standardization (aromatize and nitro) removes explicit hydrogens. TODO: replace by call to chemaxon.reaction.Standardizer

Overrides:
standardize in class CalculatorPlugin
Parameters:
mol - is the molecule to be standardized