Package chemaxon.calculations
Class IsoelectricPointPlugin
java.lang.Object
chemaxon.calculations.CalculatorPlugin
chemaxon.calculations.IsoelectricPointPlugin
- All Implemented Interfaces:
TaggedCalculator,Licensable
Plugin class for isoelectric point and pH - charge distribution calculation.
API usage example:
// Import molecule
Molecule mol = MolImporter.importMol("CC(=O)OC1=CC=CC=C1C(O)=O");
// 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 iep = plugin.getIsoelectricPoint();
// Charge distribution
double[] phValues = plugin.getPhValues();
double[] charges = plugin.getChargeDistribution();
// Print results
if (Double.isNaN(iep)) {
System.out.println("No isoelectric point.");
} else {
System.out.println("pI = "+plugin.format(iep));
}
System.out.println("\npH\tcharge");
for (int i=0; i < phValues.length; ++i) {
System.out.println(plugin.format(phValues[i]) + "\t" + plugin.format(charges[i]));
}
For calculator plugin example applications using Chemaxon's concurrent framework, refer to the Calculator Plugins Developer's Guide.
- Since:
- Marvin 3.6
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.calculations.CalculatorPlugin
CalculatorPlugin.HydrogenData -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringType constant for microspecies distribution.Fields inherited from class chemaxon.calculations.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMolecule(Molecule mol) Checks the input molecule.protected final MoleculeReturns the major tautomeric form of the molecule.double[]Returns the charge distribution array over pH values.double[][]Returns the plus and the minus parts of the charge distribution array over pH values.Returns the calculation error information message ifrun()returned false (calculation error): hydrogen valence error.doubleReturns the isoelectric point.double[]getpHs()Deprecated, for removal: This API element is subject to removal in a future version.double[]Returns the pH array.doublegetpI()Deprecated, for removal: This API element is subject to removal in a future version.UsegetIsoelectricPoint()instead.double[][]Returns the pKa values of the calculated isoelectric point.double[][]Deprecated, for removal: This API element is subject to removal in a future version.UsegetPkaOfIsoelectricPoint()instead.Returns the product identifier of the plugin.Returns the result item for the specified key and index.getResultAsString(Object type, int index, Object result) Returns the specified result in String format.intgetResultCount(Object type) Returns the number of result items for the given result key.intgetResultDomain(Object type) Returns the calculation domain.Returns the result molecule for display.Object[]Returns the result types.getTypeString(Object type) Returns a string representation of the given type.Returns the calculation warning information message if no isoelectric point exists, returns the empty string otherwise.booleanReturnstrueif pH-Charge calculation.booleanrun()Runs the isoelectric point and charge distribution calculations.protected voidDeprecated.voidsetConsiderTautomerization(boolean considerTautomerization) Sets to consider tautomerization.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetKeepExplicitHydrogens(boolean keepExplicitHydrogens) Sets if result molecule keeps explicit hydrogens or notvoidsetParameters(Properties params) Sets the input parameters for the plugin.voidsetpH(double ph) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPh(double)instead.voidsetPh(double ph) Sets a single pH value for the calculation of charge distribution.voidsetpHLower(double lower) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhLower(double)instead.voidsetPhLower(double lower) Sets pH lower limit for the calculation of charge distribution (default:0.0).voidsetpHStep(double step) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhStep(double)instead.voidsetPhStep(double step) Sets pH step for the calculation of charge distribution.voidsetpHUpper(double upper) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhUpper(double)instead.voidsetPhUpper(double upper) Sets pH upper limit for the calculation of charge distribution (default:14.0).voidSets a progress observer to be used inrun()to display progress status.voidstandardize(Molecule mol) Standardizes the molecule.tags()Returns the set of tags reported by this calculator.Methods inherited from class chemaxon.calculations.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createStandardizedMolecule, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getOriginalMolecule, getpH, getPh, getQueryMoleculeErrorMessage, getRemark, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadPluginClass, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups
-
Field Details
-
TYPE_DISTR
Type constant for microspecies distribution.- See Also:
-
-
Constructor Details
-
IsoelectricPointPlugin
public IsoelectricPointPlugin()Constructor. Creates the isoelectric point calculator object.
-
-
Method Details
-
getProductName
Description copied from class:CalculatorPluginReturns the product identifier of the plugin. For internal use only!- Specified by:
getProductNamein classCalculatorPlugin
-
setProgressMonitor
Sets a progress observer to be used inrun()to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.- Overrides:
setProgressMonitorin classCalculatorPlugin- Parameters:
pmon- is the progress monitor, may benull
-
setParameters
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:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
CalculatorPluginException- on error
-
setChemicalTermsArgument
Deprecated.Description copied from class:CalculatorPluginSets the argument string as specified in Chemical Terms expressions. This method may only be called fromCalculatorPlugin.setChemicalTermsParameters(Properties, String).- Overrides:
setChemicalTermsArgumentin classCalculatorPlugin- Parameters:
arg- The argument, never null. Its meaning is implementation-dependent.- Throws:
CalculatorPluginException- on error
-
isChargeCalc
public boolean isChargeCalc()Returnstrueif pH-Charge calculation.- Returns:
trueif 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
-
setpHLower
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpHLower(double lower) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhLower(double)instead. This method will be removed in a future version.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
-
setpHUpper
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpHUpper(double upper) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhUpper(double)instead. This method will be removed in a future version.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: between0.0and0.5. The default value is0.5.- Parameters:
step- is the pH step
-
setpHStep
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhStep(double)instead. This method will be removed in a future version.Sets pH step for the calculation of charge distribution. Range: between0.0and0.5. The default value is0.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
-
setpH
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPh(double)instead. This method will be removed in a future version.Sets a single pH value for the calculation of charge distribution.- Parameters:
ph- is the pH value- Since:
- Marvin 5.2
-
setConsiderTautomerization
public void setConsiderTautomerization(boolean considerTautomerization) Sets to consider tautomerization. Default:false.- Parameters:
considerTautomerization- the calculation will consider tautomerization and resonance if set (true)
-
checkMolecule
Checks the input molecule. Throws exception if the molecule molecule contains R-groups.- Overrides:
checkMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
CalculatorPluginException- with error message for the user if the molecule is refused
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
CalculatorPluginException- on error
-
createModifiedInputMolecule
Returns the major tautomeric form of the molecule.- Overrides:
createModifiedInputMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Returns:
- the major tautomeric form of the molecule
- Throws:
CalculatorPluginException- on error
-
run
Runs the isoelectric point and charge distribution calculations.- Specified by:
runin classCalculatorPlugin- Returns:
- true if the calculation was successful, false if the number of ionizable atoms exceeds the specified limit
- Throws:
CalculatorPluginException- on error- See Also:
-
getErrorMessage
Returns the calculation error information message ifrun()returned false (calculation error): hydrogen valence error.- Overrides:
getErrorMessagein classCalculatorPlugin- Returns:
- the calculation error information message
-
getIsoelectricPoint
public double getIsoelectricPoint()Returns the isoelectric point.- Returns:
- the isoelectric point
-
getpI
Deprecated, for removal: This API element is subject to removal in a future version.UsegetIsoelectricPoint()instead. This method will be removed in a future version.Returns the isoelectric point.- Returns:
- the isoelectric point
-
getPkaOfIsoelectricPoint
public double[][] getPkaOfIsoelectricPoint()Returns the pKa values of the calculated isoelectric point.- Returns:
- array of the pKa values acidic pKa is returned in the zero column e.g [atomindex][0] basic pKa is returned in the first column e.g. [atomindex][1]
-
getpKaOfpI
Deprecated, for removal: This API element is subject to removal in a future version.UsegetPkaOfIsoelectricPoint()instead. This method will be removed in a future version.Returns the pKa values of the calculated isoelectric point.- Returns:
- array of the pKa values acidic pKa is returned in the zero column e.g [atomindex][0] basic pKa is returned in the first column e.g. [atomindex][1]
-
getPhValues
public double[] getPhValues()Returns the pH array.- Returns:
- the pH array
-
getpHs
Deprecated, for removal: This API element is subject to removal in a future version.UsegetPhValues()instead. This method will be removed in a future version.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:
-
getChargePlusMinusDistribution
public double[][] getChargePlusMinusDistribution()Returns the plus and the minus parts of the charge distribution array over pH values.- Returns:
- the distribution array of the negative and the positive charge count.
Negative charge count:
[0..size][0], positive charge count:[0..size][1], size:(phUpper - phLower) / phStepSize. - See Also:
-
getResultTypes
Returns the result types.- Overrides:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
getResultDomain
Returns the calculation domain.- Overrides:
getResultDomainin classCalculatorPlugin- Parameters:
type- is the result type- Returns:
- the calculation domain
- See Also:
-
getResultCount
Returns the number of result items for the given result key. pKa returns the atom count.- Overrides:
getResultCountin classCalculatorPlugin- Parameters:
type- is the result type- Returns:
- the number of result items
- See Also:
-
getResult
Returns the result item for the specified key and index.- Overrides:
getResultin classCalculatorPlugin- Parameters:
type- is the result typeindex- is the result index- Returns:
- the result item for the specified key and index
- Throws:
CalculatorPluginException- if the result cannot be returned- See Also:
-
getResultAsString
public String getResultAsString(Object type, int index, Object result) throws CalculatorPluginException 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:
getResultAsStringin classCalculatorPlugin- Parameters:
type- is the result typeindex- is the result indexresult- is the result item- Returns:
- the specified result in String format
- Throws:
CalculatorPluginException- if an invalid result item is given
-
getTypeString
Returns a string representation of the given type.- Overrides:
getTypeStringin classCalculatorPlugin- Parameters:
type- is the type object- Returns:
- the type string
-
getWarningMessage
Returns the calculation warning information message if no isoelectric point exists, returns the empty string otherwise.- Overrides:
getWarningMessagein classCalculatorPlugin- Returns:
- the calculation warning information message
-
getResultMolecule
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 (MPropHandler.convertToString(MPropertyContainer, String)).- Overrides:
getResultMoleculein classCalculatorPlugin- Returns:
- the result molecule
- Throws:
CalculatorPluginException- on error- Since:
- Marvin 4.0
-
standardize
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 macro pKa values and types are queried and the new atom indices should be mapped to the original ones. TODO: replace by call to chemaxon.standardizer.Standardizer- Overrides:
standardizein classCalculatorPlugin- Parameters:
mol- is the molecule to be standardized
-
setKeepExplicitHydrogens
public void setKeepExplicitHydrogens(boolean keepExplicitHydrogens) Sets if result molecule keeps explicit hydrogens or not- Parameters:
keepExplicitHydrogens- if the result should keep explicit hydrogens or not
-
tags
Description copied from interface:TaggedCalculatorReturns the set of tags reported by this calculator. The same tags should be returned unless the calculator is modified using a mutator method, e.g. if some settings are changed.New tags can be introduced and reported in the future by existing calculators, so do not depend on the exact set of reported tags, only check for the presence of certain tags.
- Returns:
- the tags
-
getPhValues()instead.