|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.IsoelectricPointPlugin
public class IsoelectricPointPlugin
Plugin class for isoelectric point and pH - charge distribution calculation.
API usage example:
// create plugin
IsoelectricPointPlugin plugin = new IsoelectricPointPlugin();
// set plugin parameters
plugin.setpHStep(0.4);
// set target molecule
plugin.setMolecule(mol);
// run the calculation
plugin.run();
// get results
// isoelectric point
double pI = plugin.getpI();
// charge distribution
double[] pHs = plugin.getpHs();
double[] charges = plugin.getChargeDistribution();
// print results
if (Double.isNaN(pI)) {
System.out.println("No isoelectric point.");
} else {
System.out.println("pI = "+plugin.format(pI));
}
System.out.println("\npH\tcharge");
for (int i=0; i
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the
Concurrent plugin examples.
- Since:
- Marvin 3.6
- Version:
- 5.2.2 05/07/2009
- Author:
- Nora Mate, Zsolt Mohacsi
Field Summary
static java.lang.String
TYPE_DISTR
Type constant for microspecies distribution.
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, licenseEnvironment, MOLECULE, MOLECULES, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED
Constructor Summary
IsoelectricPointPlugin()
Constructor.
Method Summary
void
checkMolecule(Molecule mol)
Checks the input molecule.
double[]
getChargeDistribution()
Returns the charge distribution array over pH values.
java.lang.String
getErrorMessage()
Returns the calculation error information message if run()
returned false (calculation error): hydrogen valence error.
double[]
getpHs()
Returns the pH array.
double
getpI()
Returns the isoelectric point.
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.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.
Molecule
getResultMolecule()
Returns the result molecule for display.
java.lang.Object[]
getResultTypes()
Returns the result types.
java.lang.String
getTypeString(java.lang.Object type)
Returns a string representation of the given type.
java.lang.String
getWarningMessage()
Returns the calculation warning information message
if no isoelectric point exists, returns the empty string otherwise.
protected boolean
isChargeCalc()
Returns true if pH-Charge calculation.
boolean
run()
Runs the isoelectric point and charge distribution calculations.
protected void
setInputMolecule(Molecule mol)
Sets the input molecule.
void
setParameters(java.util.Properties params)
Sets the input parameters for the plugin.
void
setpH(double pH)
Sets a single pH value for the calculation of charge distribution.
void
setpHLower(double lower)
Sets pH lower limit for the calculation of charge distribution
(default: 0.0).
void
setpHStep(double step)
Sets pH step for the calculation of charge distribution.
void
setpHUpper(double upper)
Sets pH upper limit for the calculation of charge distribution
(default: 14.0).
void
setProgressMonitor(chemaxon.common.util.MProgressMonitor pmon)
Sets a progress observer to be used in run() to display progress status.
void
standardize(Molecule mol)
Standardizes the molecule.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
TYPE_DISTR
public static final java.lang.String TYPE_DISTR
- Type constant for microspecies distribution.
- See Also:
- Constant Field Values
Constructor Detail
IsoelectricPointPlugin
public IsoelectricPointPlugin()
- Constructor.
Creates the isoelectric point calculator object.
Method Detail
getProductName
public java.lang.String getProductName()
- Returns the product identifier of the plugin as given by
LicenseManager.
- Specified by:
getProductName in class CalculatorPlugin
- Returns:
- The identifier
LicenseManager.PROTONATION_PLUGIN_GROUP
setProgressMonitor
public void setProgressMonitor(chemaxon.common.util.MProgressMonitor pmon)
- Sets a progress observer to be used in
run() to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.
- Overrides:
setProgressMonitor in class CalculatorPlugin
- Parameters:
pmon - is the progress monitor, may be null
setParameters
public void setParameters(java.util.Properties params)
throws PluginException
- Sets the input parameters for the plugin.
Isoelectric point parameters and value ranges:
- type: pI,chargedistr
- precision: 0-8 or inf (default: 2)
- pH: pH value - calculate charge distribution at a single pH
- lower: pH lower limit (default: 0.0)
- upper: pH upper limit (default: 14.0)
- step: pH step to be taken between lower and upper limits (default: 0.5)
- Overrides:
setParameters in class CalculatorPlugin
- Parameters:
params - is the parameter table
- Throws:
PluginException - on error
isChargeCalc
protected boolean isChargeCalc()
- Returns
true if pH-Charge calculation.
- Returns:
true if pH-Charge calculation
setpHLower
public void setpHLower(double lower)
- Sets pH lower limit for the calculation of charge distribution
(default:
0.0).
- Parameters:
lower - is the pH lower limit- Since:
- Marvin 5.2
setpHUpper
public void setpHUpper(double upper)
- Sets pH upper limit for the calculation of charge distribution
(default:
14.0).
- Parameters:
upper - is the pH upper limit- Since:
- Marvin 5.2
setpHStep
public void setpHStep(double step)
- Sets pH step for the calculation of charge distribution.
Range: between
0.0 and 0.5.
The default value is 0.5.
- Parameters:
step - is the pH step
setpH
public void setpH(double pH)
- Sets a single pH value for the calculation of charge distribution.
- Parameters:
pH - is the pH value- Since:
- Marvin 5.2
checkMolecule
public void checkMolecule(Molecule mol)
throws PluginException
- Checks the input molecule.
Throws exception if the molecule molecule contains R-groups.
- 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 input molecule
- Throws:
PluginException - on error
run
public boolean run()
throws PluginException
- Runs the isoelectric point and charge distribution calculations.
- Specified by:
run in class CalculatorPlugin
- Returns:
- true if the calculation was successful,
false if the number of ionizable atoms exceeds the specified limit
- 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 CalculatorPlugin
- Returns:
- the calculation error information message
getpI
public double getpI()
- Returns the isoelectric point.
- Returns:
- the isoelectric point
getpHs
public double[] getpHs()
- Returns the pH array.
- Returns:
- the pH array
getChargeDistribution
public double[] getChargeDistribution()
- Returns the charge distribution array over pH values.
- Returns:
- the charge distribution array
- See Also:
getpHs()
getResultTypes
public java.lang.Object[] getResultTypes()
- Returns the result types.
- Overrides:
getResultTypes in class CalculatorPlugin
- Returns:
- the result types
getResultDomain
public int getResultDomain(java.lang.Object type)
- Returns the calculation domain.
- Overrides:
getResultDomain in class CalculatorPlugin
- Parameters:
type - is the result type
- Returns:
- the calculation domain
- See Also:
getResultTypes()
getResultCount
public int getResultCount(java.lang.Object type)
- Returns the number of result items for the given result key.
pKa returns the atom count.
- Overrides:
getResultCount in class CalculatorPlugin
- Parameters:
type - is the result type
- Returns:
- the number of result items
- See Also:
getResultTypes()
getResult
public java.lang.Object getResult(java.lang.Object type,
int index)
throws PluginException
- Returns the result item for the specified key and index.
- Overrides:
getResult in class CalculatorPlugin
- Parameters:
type - is the result typeindex - is the result index
- Returns:
- the result item for the specified key 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.
If the type is TYPE_DISTR then returns the pH - distribution
table as a 2-column tab-separated table with the 0-th element
the pH array and the 1-st element the distribution array
corresponding to the microspecies with the specified index (result index).
Otherwise returns the rounded pI value with one fractional digit precision.
- Overrides:
getResultAsString in class CalculatorPlugin
- Parameters:
type - is the result typeindex - is the result indexresult - 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
getWarningMessage
public java.lang.String getWarningMessage()
- Returns the calculation warning information message
if no isoelectric point exists, returns the empty string otherwise.
- Overrides:
getWarningMessage in class CalculatorPlugin
- Returns:
- the calculation warning information message
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
standardize
public 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 and stores the index-map between atom indices
in the original and the new molecule. This map is used when the macropKa
values and types are queried and the new atom indices should be mapped to
the original ones.
TODO: replace by call to chemaxon.reaction.Standardizer
- Overrides:
standardize in class CalculatorPlugin
- Parameters:
mol - is the molecule to be standardized
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD