@PublicAPI public class IsoelectricPointPlugin extends CalculatorPlugin
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 < pHs.length; ++i) { System.out.println(plugin.format(pHs[i])+"\t"+ plugin.format(charges[i])); }
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 java.lang.String |
TYPE_DISTR
Type constant for microspecies distribution.
|
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 |
---|
IsoelectricPointPlugin()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkMolecule(Molecule mol)
Checks the input molecule.
|
protected Molecule |
createModifiedInputMolecule(Molecule mol)
Returns the major tautomeric form of the molecule.
|
double[] |
getChargeDistribution()
Returns the charge distribution array over pH values.
|
double[][] |
getChargePlusMinusDistribution()
Returns the plus and the minus parts of 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.
|
double[][] |
getpKaOfpI()
Returns the pKa values of the calculated 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.
|
void |
setConsiderTautomerization(boolean considerTautomerization)
Sets to consider tautomerization.
|
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule.
|
void |
setKeepExplicitHydrogens(boolean keepExplicitHydrogens)
Sets if result molecule keeps explicit hydrogens or not
|
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(MProgressMonitor pmon)
Sets a progress observer to be used in
run() to display progress status. |
void |
standardize(Molecule mol)
Standardizes the molecule.
|
arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups, standardizeNeutralGroups
public static final java.lang.String TYPE_DISTR
public IsoelectricPointPlugin()
public java.lang.String getProductName()
LicenseManager
.getProductName
in class CalculatorPlugin
LicenseManager.PROTONATION_PLUGIN_GROUP
public void setProgressMonitor(MProgressMonitor pmon)
run()
to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.setProgressMonitor
in class CalculatorPlugin
pmon
- is the progress monitor, may be null
public void setParameters(java.util.Properties params) throws PluginException
setParameters
in class CalculatorPlugin
params
- is the parameter tablePluginException
- on errorprotected boolean isChargeCalc()
true
if pH-Charge calculation.true
if pH-Charge calculationpublic void setpHLower(double lower)
0.0
).lower
- is the pH lower limitpublic void setpHUpper(double upper)
14.0
).upper
- is the pH upper limitpublic void setpHStep(double step)
0.0
and 0.5
.
The default value is 0.5
.step
- is the pH steppublic void setpH(double pH)
pH
- is the pH valuepublic void setConsiderTautomerization(boolean considerTautomerization)
false
.considerTautomerization
- the calculation will consider tautomerization and resonance if set (true
)public void checkMolecule(Molecule mol) throws PluginException
checkMolecule
in class CalculatorPlugin
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 input moleculePluginException
- on errorprotected final Molecule createModifiedInputMolecule(Molecule mol) throws PluginException
createModifiedInputMolecule
in class CalculatorPlugin
mol
- is the 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): hydrogen valence error.getErrorMessage
in class CalculatorPlugin
public double getpI()
public double[][] getpKaOfpI()
public double[] getpHs()
public double[] getChargeDistribution()
getpHs()
public double[][] getChargePlusMinusDistribution()
getpHs()
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public int getResultDomain(java.lang.Object type)
getResultDomain
in class CalculatorPlugin
type
- is the result typegetResultTypes()
public int getResultCount(java.lang.Object type)
getResultCount
in class CalculatorPlugin
type
- is the result typegetResultTypes()
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 returnedCalculatorPlugin.getResultTypes()
public java.lang.Object getResult(java.lang.Object type, java.lang.String arg) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result type (not used)arg
- is the pH as stringPluginException
- if the result cannot be returnedCalculatorPlugin.getResultTypes()
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 givenpublic java.lang.String getTypeString(java.lang.Object type)
getTypeString
in class CalculatorPlugin
type
- is the type objectpublic java.lang.String getWarningMessage()
getWarningMessage
in class CalculatorPlugin
public 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 void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- is the molecule to be standardizedpublic void setKeepExplicitHydrogens(boolean keepExplicitHydrogens)
keepExplicitHydrogens
- if the result should keep explicit hydrogens or not