@PublicAPI public class MSAPlugin extends MajorMicrospeciesAccessorPlugin
Reference:
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin MSAPlugin plugin = new MSAPlugin(); // optional: take major microspecies at pH=7.4 plugin.setpH(7.4); // set surface area type (default: VAN_DER_WAALS) plugin.setSurfaceAreaType(SOLVENT); // set target molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get result double area = plugin.getSurfaceArea(); // print result System.out.println("Solvent accessible surface area (pH=7.4): "+area);
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
CalculatorPlugin.HydrogenData
Modifier and Type | Field and Description |
---|---|
static int |
SOLVENT
Surface area type: 3D solvent accessible surface area.
|
static int |
VAN_DER_WAALS
Surface area type: 3D van der Waals surface area.
|
ionizer
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 and Description |
---|
MSAPlugin()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkMolecule(Molecule mol)
Checks the input molecule.
|
Molecule |
get3DMolecule()
Returns the 3D molecule used in 3D surface area calculation.
|
double |
getASA()
Returns water accessible surface area calculated using a radius of 1.4 A for the water molecule.
|
double |
getASAHydrophobic()
Returns water accessible surface area of all hydrophobic (|qi|<0.125) atoms.
|
double |
getASANegative()
Returns water accessible surface area of all atoms with negative partial charge (strictly less than 0).
|
double |
getASAPlus()
Returns water accessible surface area of all atoms with positive partial charge (strictly greater than 0).
|
double |
getASAPolar()
Returns water accessible surface area of all polar (|qi|>=0.125) atoms.
|
double |
getAtomicSurfaceAreaIncrement(int index)
Returns the 3D surface area increments.
|
protected Molecule |
getDisplayMolecule()
Returns the molecule object to be used for GUI display.
|
java.lang.String |
getErrorMessage()
Returns the calculation error information message if
run()
returned false (calculation 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
or CalculatorPlugin.MOLECULE in case of increments . |
Molecule |
getResultMolecule()
Returns the result molecule for display.
|
java.lang.Object[] |
getResultTypes()
Returns the result types.
|
double |
getSurfaceArea()
Returns the surface area, calculation type is previously
set in
setSurfaceAreaType(int) . |
java.lang.String |
getTypeString(java.lang.Object type)
Returns a string representation of the given type.
|
double |
getVDWSA()
Returns van der Waals surface area.
|
boolean |
isLicensed()
Returns
true if the plugin is licensed. |
boolean |
isMultiThreadedRunEnabled()
For internal use only.
|
boolean |
run()
Runs the surface area calculation.
|
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule.
|
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin.
|
void |
setSolventRadius(double r)
Sets solvent radius.
|
void |
setSurfaceAreaType(int saType)
Sets surface area calculation type:
VAN_DER_WAALS or SOLVENT . |
createModifiedInputMolecule, getIonizerErrorMessage, getpH, setpH, standardize
arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getCalcMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isMsCalc, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroups, standardizeNeutralGroups
public static final int VAN_DER_WAALS
public static final int SOLVENT
public boolean isLicensed()
true
if the plugin is licensed. The license checking
is based on the product name, returned by getProductName()
.isLicensed
in interface chemaxon.license.Licensable
isLicensed
in class MajorMicrospeciesAccessorPlugin
true
if the plugin is licensedpublic java.lang.String getProductName()
LicenseManager
.getProductName
in class CalculatorPlugin
LicenseManager.GEOMETRY_PLUGIN_GROUP
public void setParameters(java.util.Properties params) throws PluginException
setParameters
in class MajorMicrospeciesAccessorPlugin
params
- is the parameter tablePluginException
- on errorpublic void setSurfaceAreaType(int saType)
VAN_DER_WAALS
or SOLVENT
.
The surface area is returned by getSurfaceArea()
.
The atomic increments and the 3D molecule can also be enquired by
getAtomicSurfaceAreaIncrement(int)
and
get3DMolecule()
.
Default: VAN_DER_WAALS
.saType
- is VAN_DER_WAALS
or SOLVENT
public void checkMolecule(Molecule mol) throws PluginException
RxnMolecule
,
if the molecule contains R-groups or if the molecule consists of
more than one fragments.checkMolecule
in class MajorMicrospeciesAccessorPlugin
mol
- is the input moleculePluginException
- with error message for the user if the molecule is refusedprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- is the (standardized) input moleculePluginException
- on errorpublic boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public java.lang.String getErrorMessage()
run()
returned false
(calculation error).
This implementation returns the empty string.getErrorMessage
in class MajorMicrospeciesAccessorPlugin
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public int getResultDomain(java.lang.Object type)
CalculatorPlugin.MOLECULE
or CalculatorPlugin.MOLECULE
in case of increments .getResultDomain
in class CalculatorPlugin
type
- is the result typeCalculatorPlugin.MOLECULE
getResultTypes()
public int getResultCount(java.lang.Object type)
1
for surface area, the atom count
for increments.getResultCount
in class CalculatorPlugin
type
- is the result typegetResultTypes()
public void setSolventRadius(double r)
public double getSurfaceArea()
setSurfaceAreaType(int)
. Default: VAN_DER_WAALS
.public double getVDWSA()
VAN_DER_WAALS
using setSurfaceAreaType(int)
,
and the alculation should be run beforehand by run()
public double getASA()
SOLVENT
using setSurfaceAreaType(int)
,
and the calculation should be run beforehand by run()
public double getASAPlus()
SOLVENT
using setSurfaceAreaType(int)
,
and the calculation should be run beforehand by run()
public double getASANegative()
SOLVENT
using setSurfaceAreaType(int)
,
and the calculation should be run beforehand by run()
public double getASAHydrophobic()
SOLVENT
using setSurfaceAreaType(int)
,
and the calculation should be run beforehand by run()
public double getASAPolar()
SOLVENT
using setSurfaceAreaType(int)
,
and the calculation should be run beforehand by run()
public double getAtomicSurfaceAreaIncrement(int index)
SOLVENT
or VAN_DER_WAALS
in setSurfaceAreaType(int)
.index
- is the atom indexpublic Molecule get3DMolecule()
SOLVENT
or VAN_DER_WAALS
in setSurfaceAreaType(int)
.public java.lang.Object getResult(java.lang.Object type, int index) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexPluginException
- if the result cannot be returnedgetResultTypes()
public java.lang.String getResultAsString(java.lang.Object type, int index, java.lang.Object result) throws PluginException
getResultAsString
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenprotected Molecule getDisplayMolecule()
get3DMolecule()
.getDisplayMolecule
in class CalculatorPlugin
public java.lang.String getTypeString(java.lang.Object type)
getTypeString
in class CalculatorPlugin
type
- is the type objectpublic Molecule getResultMolecule() throws PluginException
MolAtom.getExtraLabel()
).
Molecular results are stored in molecule properties
with keys being the result types
(Molecule.getProperty(String)
).getResultMolecule
in class CalculatorPlugin
PluginException
- on errorpublic boolean isMultiThreadedRunEnabled()
isMultiThreadedRunEnabled
in class CalculatorPlugin
true
if multi-threaded run is enabled