chemaxon.marvin.calculations
Class TPSAPlugin

java.lang.Object
  extended by chemaxon.marvin.plugin.CalculatorPlugin
      extended by chemaxon.marvin.calculations.MajorMicrospeciesAccessorPlugin
          extended by chemaxon.marvin.calculations.TPSAPlugin
All Implemented Interfaces:
chemaxon.license.Licensable

public class TPSAPlugin
extends MajorMicrospeciesAccessorPlugin

Plugin class for TPSA (topological polar surface area) calculation.

Reference:

  1. Ertl, P., Rohde, B., Selzer, P., J. Med. Chem., 2000, 43, pp. 3714-3717

API usage example:

    // read input molecule
    MolImporter mi = new MolImporter("test.mol");
    Molecule mol = mi.read();
    mi.close();

    // create plugin
    TPSAPlugin plugin = new TPSAPlugin();

    // optional: take major microspecies at pH=7.4
    plugin.setpH(7.4);

    // set target molecule
    plugin.setMolecule(mol);
        
    // run the calculation
    plugin.run();

    // get result
    double area = plugin.getSurfaceArea();

    // print result
    System.out.println("Polar surface area (pH=7.4): "+area);
 

For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.

Version:
Marvin 5.3.3
Author:
Nora Mate, Zsolt Mohacsi

Nested Class Summary
 
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData
 
Field Summary
 
Fields inherited from class chemaxon.marvin.calculations.MajorMicrospeciesAccessorPlugin
ionizer
 
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, explicitHydrogens, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, KEEP_HYDROGENS, keepHydrogens, licenseEnvironment, MOLECULE, MOLECULES, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED, TRUE
 
Constructor Summary
TPSAPlugin()
          Constructor.
 
Method Summary
 void checkMolecule(Molecule mol)
          Checks the input molecule.
 java.lang.String getErrorMessage()
          Returns the calculation error information message if run() returned false (calculation error): hydrogen valence error.
 java.lang.String getProductName()
          Returns the product identifier of the plugin as given by LicenseManager.
 java.lang.Object getResult(java.lang.Object type, int index)
          Returns the result item for the specified key and index.
 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.MOLECULE.
 Molecule getResultMolecule()
          Returns the result molecule for display.
 java.lang.Object[] getResultTypes()
          Returns the result types.
 double getSurfaceArea()
          Returns the surface area.
 double getTPSA()
          Deprecated. as of Marvin 4.1, replaced by getSurfaceArea()
 java.lang.String getTypeString(java.lang.Object type)
          Returns a string representation of the given type.
 boolean run()
          Runs the surface area calculation.
 void setExcludePhosphorus(boolean p)
          Sets to exclude phosphorus from PSA calculation.
 void setExcludeSulfur(boolean s)
          Sets to exclude sulfur from PSA calculation.
protected  void setInputMolecule(Molecule mol)
          Sets the input molecule.
 void setParameters(java.util.Properties params)
          Sets the input parameters for the plugin.
 
Methods inherited from class chemaxon.marvin.calculations.MajorMicrospeciesAccessorPlugin
createModifiedInputMolecule, getIonizerErrorMessage, getpH, isLicensed, setpH, standardize
 
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroups, standardizeNeutralGroups
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TPSAPlugin

public TPSAPlugin()
Constructor. Creates the TPSA calculator object.

Method Detail

getProductName

public java.lang.String getProductName()
Description copied from class: CalculatorPlugin
Returns the product identifier of the plugin as given by LicenseManager. The name is used by the CalculatorPlugin.isLicensed() method.

Specified by:
getProductName in class CalculatorPlugin
Returns:
product identifier or a default string

setParameters

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

Overrides:
setParameters in class MajorMicrospeciesAccessorPlugin
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 MajorMicrospeciesAccessorPlugin
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

setExcludeSulfur

public void setExcludeSulfur(boolean s)
Sets to exclude sulfur from PSA calculation.
Default: true, sulfur i excluded.

Parameters:
s - if true sulfur is excluded from PSA calculation
Since:
Marvin 5.3.3

setExcludePhosphorus

public void setExcludePhosphorus(boolean p)
Sets to exclude phosphorus from PSA calculation.
Default: true, phosphorus i excluded.

Parameters:
p - if true phosphorus is excluded from PSA calculation
Since:
Marvin 5.3.3

run

public boolean run()
            throws PluginException
Runs the surface area 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()

getErrorMessage

public java.lang.String getErrorMessage()
Returns the calculation error information message if run() returned false (calculation error): hydrogen valence error.

Overrides:
getErrorMessage in class MajorMicrospeciesAccessorPlugin
Returns:
the calculation error information message

getResultTypes

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

Overrides:
getResultTypes in class CalculatorPlugin
Returns:
the result types

getResultDomain

public int getResultDomain(java.lang.Object type)
Returns the calculation domain CalculatorPlugin.MOLECULE.

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

getResultCount

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

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

getTPSA

@Deprecated
public double getTPSA()
Deprecated. as of Marvin 4.1, replaced by getSurfaceArea()

Returns the TPSA value.

Returns:
the TPSA value

getSurfaceArea

public double getSurfaceArea()
Returns the surface area.

Returns:
the surface area
Since:
Marvin 4.1

getResult

public java.lang.Object getResult(java.lang.Object type,
                                  int index)
                           throws PluginException
Returns the result item for the specified key and index. TPSA returns the required TPSA value as a Double object.

Overrides:
getResult in class CalculatorPlugin
Parameters:
type - is the result type
index - is the result index
Returns:
the result item for the specified key and index
Throws:
PluginException - if the result cannot be returned
See Also:
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.

Overrides:
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

getTypeString

public java.lang.String getTypeString(java.lang.Object type)
Returns a string representation of the given type.

Overrides:
getTypeString in class CalculatorPlugin
Parameters:
type - is the type object
Returns:
the type string

getResultMolecule

public Molecule getResultMolecule()
                           throws PluginException
Returns the result molecule for display. Atomic results are stored in atom extra labels (MolAtom.getExtraLabel()). Molecular results are stored in molecule properties with keys being the result types (Molecule.getProperty(String)).

Overrides:
getResultMolecule in class CalculatorPlugin
Returns:
the result molecule
Throws:
PluginException - on error
Since:
Marvin 4.0