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
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 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.
|
double[] |
getChargeDistribution()
Returns the charge distribution array over pH values.
|
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.
|
String |
getProductName()
Returns the product identifier of the plugin as given by
LicenseManager. |
Object |
getResult(Object type,
int index)
Returns the result item for the specified key and index.
|
Object |
getResult(Object type,
String arg)
Returns the result item for the specified pH.
|
String |
getResultAsString(Object type,
int index,
Object result)
Returns the specified result in String format.
|
int |
getResultCount(Object type)
Returns the number of result items for the given result key.
|
int |
getResultDomain(Object type)
Returns the calculation domain.
|
Molecule |
getResultMolecule()
Returns the result molecule for display.
|
Object[] |
getResultTypes()
Returns the result types.
|
String |
getTypeString(Object type)
Returns a string representation of the given type.
|
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 |
setKeepExplicitHydrogens(boolean keepExplicitHydrogens)
Sets if result molecule keeps explicit hydrogens or not
|
void |
setParameters(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, createModifiedInputMolecule, 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, standardizeNeutralGroupspublic static final String TYPE_DISTR
public IsoelectricPointPlugin()
public String getProductName()
LicenseManager.getProductName in class CalculatorPluginLicenseManager.PROTONATION_PLUGIN_GROUPpublic void setProgressMonitor(MProgressMonitor pmon)
run() to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.setProgressMonitor in class CalculatorPluginpmon - is the progress monitor, may be nullpublic void setParameters(Properties params) throws PluginException
setParameters in class CalculatorPluginparams - 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 checkMolecule(Molecule mol) throws PluginException
checkMolecule in class CalculatorPluginmol - is the input moleculePluginException - with error message for the user if the molecule is refusedprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule in class CalculatorPluginmol - is the input moleculePluginException - on errorpublic boolean run()
throws PluginException
run in class CalculatorPluginPluginException - on errorCalculatorPlugin.getErrorMessage()public String getErrorMessage()
run()
returned false (calculation error): hydrogen valence error.getErrorMessage in class CalculatorPluginpublic double getpI()
public double[] getpHs()
public double[] getChargeDistribution()
getpHs()public Object[] getResultTypes()
getResultTypes in class CalculatorPluginpublic int getResultDomain(Object type)
getResultDomain in class CalculatorPlugintype - is the result typegetResultTypes()public int getResultCount(Object type)
getResultCount in class CalculatorPlugintype - is the result typegetResultTypes()public Object getResult(Object type, int index) throws PluginException
getResult in class CalculatorPlugintype - is the result typeindex - is the result indexPluginException - if the result cannot be returnedCalculatorPlugin.getResultTypes()public Object getResult(Object type, String arg) throws PluginException
getResult in class CalculatorPlugintype - is the result type (not used)arg - is the pH as stringPluginException - if the result cannot be returnedCalculatorPlugin.getResultTypes()public String getResultAsString(Object type, int index, Object result) throws PluginException
getResultAsString in class CalculatorPlugintype - is the result typeindex - is the result indexresult - is the result itemPluginException - if an invalid result item is givenpublic String getTypeString(Object type)
getTypeString in class CalculatorPlugintype - is the type objectpublic String getWarningMessage()
getWarningMessage in class CalculatorPluginpublic 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 CalculatorPluginPluginException - on errorpublic void standardize(Molecule mol)
standardize in class CalculatorPluginmol - is the molecule to be standardizedpublic void setKeepExplicitHydrogens(boolean keepExplicitHydrogens)
keepExplicitHydrogens - if the result should keep explicit hydrogens or not