Package chemaxon.marvin.calculations
Class pKaPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.pKaPlugin
- All Implemented Interfaces:
TaggedCalculator
,chemaxon.license.Licensable
Plugin class for macro/micro pKa calculation.
API usage example:
// instantiate plugin pKaPlugin plugin = new pKaPlugin(); // set parameters plugin.setMaxIons(6); plugin.setBasicpKaLowerLimit(-5.0); plugin.setAcidicpKaUpperLimit(25.0); plugin.setpHLower(3.0); // for ms distr plugin.setpHUpper(6.0); // for ms distr plugin.setpHStep(1.0); // for ms distr MolImporter importer = new MolImporter("mols.sdf"); Molecule mol = null; while ((mol = importer.read()) != null) { // set molecule and run calculation plugin.setMolecule(mol); plugin.run(); // get the 3 strongest ACIDIC pKa values double[] acidicpKa = new double[3]; int[] acidicIndexes = new int[3]; plugin.getMacropKaValues(pKaPlugin.ACIDIC, acidicpKa, acidicIndexes); // get the 3 strongest BASIC pKa values double[] basicpKa = new double[3]; int[] basicIndexes = new int[3]; plugin.getMacropKaValues(pKaPlugin.BASIC, basicpKa, basicIndexes); // get pKa values for each atom int count = mol.getAtomCount(); for (int i=0; i < count; ++i) { // get ACIDIC and BASIC pKa values double apka = plugin.getpKa(i, pKaPlugin.ACIDIC); double bpka = plugin.getpKa(i, pKaPlugin.BASIC); } // get microspecies distributions double[] pHs = plugin.getpHs(); // pH values int mscount = plugin.getMsCount(); for (int i=0; i < mscount; ++i) { Molecule ms = plugin.getMsMolecule(i); double[] distr = plugin.getMsDistribution(i); // distr values for pHs } } importer.close();
Another example showing microspecies distributions at a single pH value:
// instantiate plugin pKaPlugin plugin = new pKaPlugin(); // set pH plugin.setpH(3.0); MolImporter importer = new MolImporter("mols.sdf"); Molecule mol = null; while ((mol = importer.read()) != null) { // set molecule and run calculation plugin.setMolecule(mol); plugin.run(); // get microspecies data (molecule and distribution) int count = plugin.getMsCount(); for (int i=0; i < count; ++i) { Molecule ms = plugin.getMsMolecule(i); double distr = plugin.getSingleMsDistribution(i); } } importer.close();
Another example showing macro pKa calculation:
// instantiate plugin pKaPlugin plugin = new pKaPlugin(); MolImporter importer = new MolImporter("mols.sdf"); Molecule mol = null; while ((mol = importer.read()) != null) { // set molecule and run calculation plugin.setMolecule(mol); plugin.run(); // get the acidic and basic macro pKa values double[] acidicpKaValues = plugin.getMacropKaValues(pKaPlugin.ACIDIC); double[] basicpKaValues = plugin.getMacropKaValues(pKaPlugin.BASIC); } importer.close();
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
- Since:
- Marvin 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant denoting acidic pKa.static final int
Constant denoting basic pKa.static final double
The default ionic strength of the pKa calculation models (small and large).static final int
The default value of the number of ionizable atoms to consider.static final double
The default temperature in Kelvins.static final int
pKa's prefix (acidic/basic) does depend on the submitted micro statestatic final int
Calculation model: large (always precise, can take more time).static final int
Calculation model: small (precise up to the specified number of ionizable atoms).static final int
pKa's prefix (acidic/basic) does not depend on the submitted micro state (default)static final String
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, 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkMolecule
(Molecule mol) Checks the input molecule.protected final Molecule
Returns the canonical tautomeric form of the molecule.static String[]
Returns the id's of available pKa correction libraries.Returns the calculation error information message ifrun()
returned false (calculation error): the number of ionizable atoms exceeds the specified limit (given in the "ions" parameter) or hydrogen valence error.double
double[][]
Returns the macrospecies distribution arrays for all macro pKa values: the i-th row is the disrtibution vector of the i-th ionization state as function of the pH.double[]
getMacroDistributions
(int macroIndex) Returns the i-th macrospecies distribution as function of the pHdouble[]
getMacropKaValues
(int pkatype) Calculates the acidic pKa values in ascending order or the basic pKa values in descending order.void
getMacropKaValues
(int pkatype, double[] values, int[] indexes) Calculates the least acidic pKa values in ascending order or the biggest basic pKa values in descending order.int
getMacroSpeciesCharge
(int msIndex) Returns the formal charges of a given macrospecies.int
Returns the number of macrospecies count.int
Returns the number of microspecies and/or distributions.double[]
getMsDistribution
(int msIndex) Returns the microspecies distribution array.double[][]
Returns the microspecies distribution arrays for all microspecies: the i-th element is the disrtibution array of the i-th microspecies.getMsMolecule
(int msIndex) Returns the microspecies molecule.double[]
getpHs()
Returns the pH array.double
getpKa
(int index) Returns the most significant pKa value for the given atom index.double
getpKa
(int index, int type) Deprecated.double
getpKaConc
(int index) Returns the so called concentration ionization constant.double
getpKaMixed
(int index) Returns the so called mixed ionization constantint
Returns the pKa prefix type.int
getpKaType
(int index) double[]
getpKaValues
(int index, int type) Returns the pKa values for the given atom index and pKa type.Returns the product identifier of the plugin as given byLicenseManager
.Returns the result item for the specified key and index.Deprecated, for removal: This API element is subject to removal in a future version.Some implementations of this method modify the state of the plugin, which is a very confusing behavior, so the method is now deprecated and should no longer be used.int
getResultAsRGB
(Object type, int index, Object result) Returns the specified result color as int format (alpha<<24 + red<<16 + green<<8 + blue): RED for acidic pKa, BLUE for basic pKa.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 domainCalculatorPlugin.ATOM
orCalculatorPlugin.MOLECULE
.Returns the result molecule for display.long
getResultsAsRGB
(Object type, int index, Object result) Returns the specified result color(s) as int format (alpha<<24 + red<<16 + green<<8 + blue).getResultsAsString
(Object type, int index, Object result) Returns the specified result with possible subresults (both pKa values instead of the most significant pKa) in String format.Object[]
Returns the result types (possible types: pKa, acidic, basic, msdistr).boolean
double
getSingleMsDistribution
(int msIndex) Returns the microspecies distribution at the specified pH value set insetpH(double)
.void
getSortedValues
(int pkatype, double[] values, int[] indexes) Deprecated, for removal: This API element is subject to removal in a future version.UsegetMacropKaValues(int, double[], int[])
insteadReturns the calculation warning information message.boolean
isMsCalc()
Returnstrue
if microspecies calculation.boolean
isNegligible
(double[] distr) boolean
isNegligibleResult
(Object type, int index, Object result) Returns whether the result can be ignored.boolean
Returnstrue
if overflow calculation: maximum number of ionizable atoms exceeded and protein ionization invoked.boolean
run()
Runs the macro pKa calculation.void
setAcidicpKaUpperLimit
(double maxA) Sets the maximum acidic pKa (default:20
).void
setBasicpKaLowerLimit
(double minB) Sets the minimum basic pKa (default:-10
).void
setCalcAlways
(boolean calcAlways) Deprecated, for removal: This API element is subject to removal in a future version.replaced bysetModel(int)
protected void
Deprecated.For internal use only.void
setConsiderTautomerization
(boolean considerTautomerization) Sets to consider tautomerization.void
setCorrectionData
(PKaTrainingResult trainingResult) Sets correction data for calculationvoid
setCorrectionLibrary
(String correctionLibraryId) Sets the correction library.void
setCorrectionLibraryPath
(String correctionLibraryPath) Sets the correction library file directly.protected void
setInputMolecule
(Molecule mol) Sets the input molecule.void
setKeepExplicitHydrogens
(boolean keepExplicitHydrogens) Sets if result molecule keeps explicit hydrogens or notvoid
setMaxIons
(int n) In case ofMODEL_SMALL
model, it sets the maximum number of ionizable atoms to be considered and uses simple calculation method to compute pKa values.void
setMicropKaCalc
(boolean micro) Sets micro pKa calculation.void
setModel
(int model) Sets the calculation model.void
setMsCalc
(boolean mscalc) Sets calculation of microspecies distributions.void
setParameters
(Properties params) Sets the input parameters for the plugin.void
setpH
(double pH) Sets the pH value for the calculation of microspecies distributions.void
setpHLower
(double lower) Sets pH lower limit for the calculation of microspecies distributions.void
setpHStep
(double step) Sets pH step for the calculation of microspecies distributions.void
setpHUpper
(double upper) Sets pH upper limit for the calculation of microspecies distributions.void
setpKaPrefixType
(int pKaPtype) Sets pKa prefix type (default:STATICpKaPREFIX
) STATIC pKa prefix: pKa's prefix does not depend on the submitted micro state DYNAMIC pKa prefix: pKa's prefix does depend on the submitted micro statevoid
Sets a progress observer to be used inrun()
to display progress status.void
setTakeFullTautomerizationSpectrum
(boolean takeFullTauSpectrum) Sets to consider the full tautomer distribution upon the macro pka calculation.void
setTakeMajorTatomericForm
(boolean takeMajorTautomericForm) Deprecated, for removal: This API element is subject to removal in a future version.void
setTemperature
(double temperature) Sets the temperature (default:298
Kelvin).void
standardize
(Molecule mol) Standardizes the molecule.void
useCorrectionLibrary
(boolean use) Deprecated.Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsString, getResultSource, getTypeString, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isLicensed, isMultiThreadedRunEnabled, isOK, isRgrouped, loadClass, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface chemaxon.calculator.TaggedCalculator
tags
-
Field Details
-
ACIDIC
public static final int ACIDICConstant denoting acidic pKa.- See Also:
-
BASIC
public static final int BASICConstant denoting basic pKa.- See Also:
-
TYPE_DISTR
Type constant for microspecies distribution.- See Also:
-
STATICpKaPREFIX
public static final int STATICpKaPREFIXpKa's prefix (acidic/basic) does not depend on the submitted micro state (default)- See Also:
-
DYNAMICpKaPREFIX
public static final int DYNAMICpKaPREFIXpKa's prefix (acidic/basic) does depend on the submitted micro state- See Also:
-
DEF_MAXIONS
public static final int DEF_MAXIONSThe default value of the number of ionizable atoms to consider.- See Also:
-
DEF_TEMPERATURE
public static final double DEF_TEMPERATUREThe default temperature in Kelvins.- See Also:
-
MODEL_SMALL
public static final int MODEL_SMALLCalculation model: small (precise up to the specified number of ionizable atoms).- See Also:
-
MODEL_LARGE
public static final int MODEL_LARGECalculation model: large (always precise, can take more time).- See Also:
-
DEF_IONICSTRENGTH
public static final double DEF_IONICSTRENGTHThe default ionic strength of the pKa calculation models (small and large). Alternative ionic strength can be specified optionally. Please note that the thermodynamic pKa value can be calculated with adjusting of zero ionic strength.- See Also:
-
-
Constructor Details
-
pKaPlugin
public pKaPlugin()Constructor. Creates the macro pKa calculator object.
-
-
Method Details
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager
.- Specified by:
getProductName
in classCalculatorPlugin
- Returns:
- The identifier
LicenseManager.PROTONATION_PLUGIN_GROUP
-
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:
setProgressMonitor
in classCalculatorPlugin
- Parameters:
pmon
- is the progress monitor, may benull
-
setParameters
Sets the input parameters for the plugin. pKa parameters and value ranges:- type: pKa,acidic,basic (pKa is either the basic or the acidic pKa)
- precision:
0-8
or inf (default:2
) (number of displayed fractional digits, inf for unrounded value) - mode: macro or micro (default: macro)
- prefix: static or dynamic acid/base prefix (default: static)
- min: the minimal basic micro pKa threshold
- max: the maximal acidic micro pKa threshold
- temperature: temperature (in Kelvin, default:
298
) - ions: maximum number of ionizable atoms (default:
8
) - calcAlways: true if calculation to be performed even if the maximum number of ionizable atoms is exceeded (deprecated, see 'model' below)
- model: "small" or "large" (replaces 'calcAlways')
- small: precise up to the number of ionizable atoms given in 'ions'
(
8
by default), equivalent tocalcAlways=false
(cxcalc and API default) - large: always precise but can take more time,
equivalent to
calcAlways=true
(GUI default)
- small: precise up to the number of ionizable atoms given in 'ions'
(
mode
is "macro" then we have additional parameters for microspecies distribution:- mscalc: true if microspecies distribution to be shown, false otherwise (default: false)
- 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.2)
- majortautomer: true or false (take major tautomeric form)
- Overrides:
setParameters
in classCalculatorPlugin
- Parameters:
params
- is the parameter table- Throws:
PluginException
- on error
-
setChemicalTermsArgument
Deprecated.For internal use only.Sets the argument string as specified in Chemical Terms expressions.- Overrides:
setChemicalTermsArgument
in classCalculatorPlugin
- Parameters:
arg
- is the strength order index ("1" means the strongest value, "2" means the second strongest value, etc.)- Throws:
PluginException
- on error
-
useCorrectionLibrary
Deprecated.Sets the usage of the correction library. (default:false
)- Parameters:
use
- iftrue
, then the calculation will use the correction library- Since:
- Marvin 5.2
-
setCorrectionLibrary
Sets the correction library.- Parameters:
correctionLibraryId
- is the correction library identifier- Since:
- Marvin 5.4
-
setCorrectionData
Sets correction data for calculation- Parameters:
trainingResult
- correction data
-
setCorrectionLibraryPath
Sets the correction library file directly.- Since:
- Marvin 6.0
-
getCorrectionLibraryIds
Returns the id's of available pKa correction libraries.- Returns:
- the id's of available pKa correction libraries
- Since:
- Marvin 5.4
-
setMicropKaCalc
public void setMicropKaCalc(boolean micro) Sets micro pKa calculation. Default:false
(macro pKa calculation).- Parameters:
micro
- istrue
if micro pKa calculation is required.- Since:
- Marvin 4.1
-
setCalcAlways
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setCalcAlways(boolean calcAlways) Deprecated, for removal: This API element is subject to removal in a future version.replaced bysetModel(int)
Sets whether to perform calculation if the maximum number of ionizable atoms is exceeded. If set totrue
, pKa values are calculated with a different, more time-consuming method in this case. Note, that microspecies are not determined in this case. Default:false
.- Parameters:
calcAlways
- istrue
if calculation should be performed if the maximum number of ionizable atoms is exceeded- See Also:
-
setModel
public void setModel(int model) Sets the calculation model.- Parameters:
model
- is the calculation model:MODEL_SMALL
: optimized for a small number of ionizable atoms (default)MODEL_LARGE
: optimized for a large number of ionizable atoms
- Since:
- Marvin 4.0
- See Also:
-
setMaxIons
public void setMaxIons(int n) In case ofMODEL_SMALL
model, it sets the maximum number of ionizable atoms to be considered and uses simple calculation method to compute pKa values. In case ofMODEL_LARGE
model, it switches the simple calculation method to a more complicated one when the number of ionizable atoms exceeds this limit. The default value is8
.- Parameters:
n
- is the maximum number of ionizable atoms to be considered- See Also:
-
setBasicpKaLowerLimit
public void setBasicpKaLowerLimit(double minB) Sets the minimum basic pKa (default:-10
).- Parameters:
minB
- is the minimum basic pKa
-
setAcidicpKaUpperLimit
public void setAcidicpKaUpperLimit(double maxA) Sets the maximum acidic pKa (default:20
).- Parameters:
maxA
- is the maximum acidic pKa
-
setTemperature
public void setTemperature(double temperature) Sets the temperature (default:298
Kelvin).- Parameters:
temperature
- is the temperature (Kelvin)- Since:
- Marvin 3.5.1
-
setpHLower
public void setpHLower(double lower) Sets pH lower limit for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is0.0
.- Parameters:
lower
- is the pH lower limit
-
setpHUpper
public void setpHUpper(double upper) Sets pH upper limit for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is14.0
.- Parameters:
upper
- is the pH upper limit
-
setpHStep
public void setpHStep(double step) Sets pH step for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is1.0
.- Parameters:
step
- is the pH step
-
setpH
public void setpH(double pH) Sets the pH value for the calculation of microspecies distributions. This method activates the calculation of microspecies distributions at a single pH value.- Parameters:
pH
- is the pH value
-
setMsCalc
public void setMsCalc(boolean mscalc) Sets calculation of microspecies distributions. By default, microsepcies distributions are computed in the[0.0, 14.0]
pH interval with pH step size1.0
.- Parameters:
mscalc
- istrue
if calculation of microspecies distributions is required- See Also:
-
isMsCalc
public boolean isMsCalc()Returnstrue
if microspecies calculation.- Overrides:
isMsCalc
in classCalculatorPlugin
- Returns:
true
if microspecies calculation
-
setpKaPrefixType
public void setpKaPrefixType(int pKaPtype) Sets pKa prefix type (default:STATICpKaPREFIX
)- STATIC pKa prefix: pKa's prefix does not depend on the submitted micro state
- DYNAMIC pKa prefix: pKa's prefix does depend on the submitted micro state
- Parameters:
pKaPtype
- may have two values:STATICpKaPREFIX
orDYNAMICpKaPREFIX
- Since:
- Marvin 4.1.3
-
getpKaPrefixType
public int getpKaPrefixType()Returns the pKa prefix type.STATICpKaPREFIX
: pKa's prefix does not depend on the submitted micro stateDYNAMICpKaPREFIX
: pKa's prefix does depend on the submitted micro state
- Returns:
- the pKa prefix type
- Since:
- Marvin 4.1.3
-
setConsiderTautomerization
public void setConsiderTautomerization(boolean considerTautomerization) Sets to consider tautomerization. Default:false
.- Parameters:
considerTautomerization
- the calculation will consider tautomerization and resonance if set (true
)- Since:
- Marvin 5.4
-
setTakeFullTautomerizationSpectrum
public void setTakeFullTautomerizationSpectrum(boolean takeFullTauSpectrum) Sets to consider the full tautomer distribution upon the macro pka calculation. Default:false
.- Parameters:
takeFullTauSpectrum
- the calculation will consider all meaningful tautomer structure if set (true
)- Since:
- Marvin 22.22
-
setTakeMajorTatomericForm
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setTakeMajorTatomericForm(boolean takeMajorTautomericForm) Deprecated, for removal: This API element is subject to removal in a future version.Sets to use major tautomeric form in calculation. Default:false
.- Parameters:
takeMajorTautomericForm
- the calculation will be performed on the major tutomeric form of the input molecule if set (true
)- Since:
- Marvin 5.0
-
createModifiedInputMolecule
Returns the canonical tautomeric form of the molecule.- Overrides:
createModifiedInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Returns:
- the canonical tautomeric form of the molecule
- Throws:
PluginException
- on error- Since:
- Marvin 5.0
-
checkMolecule
Checks the input molecule. Throws exception if the molecule molecule contains R-groups.- Overrides:
checkMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- with error message for the user if the molecule is refused
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- on error
-
run
Runs the macro pKa calculation.- Specified by:
run
in classCalculatorPlugin
- Returns:
- true if the calculation was successful, false if the number of ionizable atoms exceeds the specified limit
- Throws:
PluginException
- on error- See Also:
-
getMsCount
public int getMsCount()Returns the number of microspecies and/or distributions. Calculated only if macro pKa is computed and the "mscalc" parameter is set to "true".
NOTE that no microspecies are calculated whenMODEL_LARGE
is used. UseisOverflowCalculation()
to check the used model.- Returns:
- the number of microspecies and/or distributions.
-
getMacroSpeciesCount
public int getMacroSpeciesCount()Returns the number of macrospecies count. Calculated only if macro pKa is computed.
NOTE that no microspecies are calculated whenMODEL_LARGE
is used. UseisOverflowCalculation()
to check the used model.- Returns:
- the number of macrospecies count.
-
getMsMolecule
Returns the microspecies molecule. Calculated only if macro pKa is computed and the "mscalc" parameter is set to "true".
Microspecies are calculated only whenMODEL_SMALL
is used. UseisOverflowCalculation()
to check the used model.- Parameters:
msIndex
- is the microspecies index- Returns:
- the microspecies molecule
-
getSingleMsDistribution
public double getSingleMsDistribution(int msIndex) Returns the microspecies distribution at the specified pH value set insetpH(double)
.- Parameters:
msIndex
- is the microspecies index- Returns:
- the microspecies distribution at the previously given pH
-
getpHs
public double[] getpHs()Returns the pH array.- Returns:
- the pH array
-
getMsDistribution
public double[] getMsDistribution(int msIndex) Returns the microspecies distribution array.- Parameters:
msIndex
- is the microspecies index- Returns:
- the microspecies distribution array
-
getMsDistributions
public double[][] getMsDistributions()Returns the microspecies distribution arrays for all microspecies: the i-th element is the disrtibution array of the i-th microspecies.- Returns:
- the microspecies distribution arrays
-
getMacroDistributions
public double[][] getMacroDistributions()Returns the macrospecies distribution arrays for all macro pKa values: the i-th row is the disrtibution vector of the i-th ionization state as function of the pH.- Returns:
- the macrospecies distribution arrays
-
getMacroDistributions
public double[] getMacroDistributions(int macroIndex) Returns the i-th macrospecies distribution as function of the pH- Returns:
- the i-th macrospecies distribution
-
getpKa
public double getpKa(int index) Returns the most significant pKa value for the given atom index. Use this to get the pKa ifSTATICpKaPREFIX
prefix type is set. The pKa calculation has to be run beforehand by callingrun()
.- Parameters:
index
- is the atom index- Returns:
- the pKa value, or
Double.NaN
if there is no pKa value for the given atom index and pKa type - Since:
- Marvin 3.6
- See Also:
-
getpKaMixed
public double getpKaMixed(int index) Returns the so called mixed ionization constant- Parameters:
index
- is the atom index- Returns:
- the pKa,mix. value, or
Double.NaN
if there is no pKa value for the given atom index and pKa type
-
getpKaConc
public double getpKaConc(int index) Returns the so called concentration ionization constant.- Parameters:
index
- is the atom index- Returns:
- the pKa,mix. value, or
Double.NaN
if there is no pKa value for the given atom index and pKa type
-
getpKa
Deprecated.Returns the pKa value for the given atom index and pKa type. The pKa calculation has to be run beforehand by callingrun()
.- Parameters:
index
- is the atom indextype
- is the pka type:ACIDIC
orBASIC
- Returns:
- the pKa value, or
Double.NaN
if there is no pKa value for the given atom index and pKa type - See Also:
-
getpKaValues
public double[] getpKaValues(int index, int type) Returns the pKa values for the given atom index and pKa type. The pKa calculation has to be run beforehand by callingrun()
. -
getpKaType
public int getpKaType(int index) -
getMacroSpeciesCharge
public int getMacroSpeciesCharge(int msIndex) Returns the formal charges of a given macrospecies. Valid only in case of overflow calculation.- Parameters:
msIndex
- is the macrospecies index- Returns:
- the formal charges of a given macrospecies
- See Also:
-
isOverflowCalculation
public boolean isOverflowCalculation()Returnstrue
if overflow calculation: maximum number of ionizable atoms exceeded and protein ionization invoked.- Returns:
true
if overflow calculation
-
getErrorMessage
Returns the calculation error information message ifrun()
returned false (calculation error): the number of ionizable atoms exceeds the specified limit (given in the "ions" parameter) or hydrogen valence error.- Overrides:
getErrorMessage
in classCalculatorPlugin
- Returns:
- the calculation error information message
-
getWarningMessage
Returns the calculation warning information message.- Overrides:
getWarningMessage
in classCalculatorPlugin
- Returns:
- the calculation warning information message
-
getResultTypes
Returns the result types (possible types: pKa, acidic, basic, msdistr).- Overrides:
getResultTypes
in classCalculatorPlugin
- Returns:
- the result types
-
getResultDomain
Returns the calculation domainCalculatorPlugin.ATOM
orCalculatorPlugin.MOLECULE
. pKa always returnsCalculatorPlugin.ATOM
.- Overrides:
getResultDomain
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
CalculatorPlugin.ATOM
- See Also:
-
getResultCount
Returns the number of result items for the given result key. pKa returns the atom count.- Overrides:
getResultCount
in 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. If the type is "msdistr" then returns the pH - distribution table as a double[][] 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 pKa returns the required pKa value as a Double object for the given atom index (result index). Returns Double.NaN if the atom with the given index does not have a valid macro pKa value for the specified result type.- Overrides:
getResult
in classCalculatorPlugin
- 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:
-
getResult
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public Object getResult(Object type, String arg) throws PluginException Deprecated, for removal: This API element is subject to removal in a future version.Some implementations of this method modify the state of the plugin, which is a very confusing behavior, so the method is now deprecated and should no longer be used. If you used this method with an index argument, parse the index instead, and callgetResult(Object, int)
. Otherwise, call the appropriate setter method of the plugin to configure it with the argument, and callgetResult(Object, int)
with a 0 index.Returns the result item for the specified type ("acidic" or "basic") and the specified strength index ("1" means the strongest value, "2" means the second strongest value, etc.) given in the argument string. ReturnsDouble.NaN
for non-existent values (e.g. when the type is "acidic" and the arg string is "2" but there is only one acidic pKa value for the input molecule).- Overrides:
getResult
in classCalculatorPlugin
- Parameters:
type
- is the result type ("acidic" or "basic")arg
- is the strength order index- Returns:
- the result item for the specified type and strength index
- Throws:
PluginException
- if the result cannot be returned- See Also:
-
getSortedValues
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void getSortedValues(int pkatype, double[] values, int[] indexes) throws PluginException Deprecated, for removal: This API element is subject to removal in a future version.UsegetMacropKaValues(int, double[], int[])
insteadCalculates the least acidic pKa values in ascending order or the biggest basic pKa values in descending order. The pKa calculation has to be run beforehand by callingrun()
. The length of the result value array determines the number of pKa values to be computed. If the index array is non-null then it is assumed to have the same length as the value array and will be filled with the corresponding atom indices (0-based).- Parameters:
pkatype
- is the pKa type (ACIDIC
orBASIC
)values
- is the pKa value array to be filled with pKa values in descending strength order (increasing for acidic pKa, descending for basic pKa values), the last entries are set toDouble.NaN
if there are less pKa values than the array lengthindexes
- is the corresponding atom index array to be filled (may be null), the index is set to-1
for non-existent values (Double.NaN
)- Throws:
PluginException
- if an error occurs during the calculation
-
getMacropKaValues
Calculates the least acidic pKa values in ascending order or the biggest basic pKa values in descending order. The pKa calculation has to be run beforehand by callingrun()
. The length of the result value array determines the number of pKa values to be computed. If the index array is non-null then it is assumed to have the same length as the value array and will be filled with the corresponding atom indices (0-based).- Parameters:
pkatype
- is the pKa type (ACIDIC
orBASIC
)values
- is the pKa value array to be filled with pKa values in descending strength order (increasing for acidic pKa, descending for basic pKa values), the last entries are set toDouble.NaN
if there are less pKa values than the array lengthindexes
- is the corresponding atom index array to be filled (may be null), the index is set to-1
for non-existent values (Double.NaN
)- Throws:
PluginException
- if an error occurs during the calculation- Since:
- Marvin 5.0.7
-
getMacropKaValues
Calculates the acidic pKa values in ascending order or the basic pKa values in descending order. The pKa calculation has to be run beforehand by callingrun()
.- Parameters:
pkatype
- is the pKa type (ACIDIC
orBASIC
)- Returns:
- the pKa value array with pKa values in descending strength order
(increasing for acidic pKa, descending for basic pKa values) or
null
if there are no ionizable atoms in the molecule - Throws:
PluginException
- if an error occurs during the calculation- Since:
- Marvin 5.0.7
-
getResultAsString
Returns the specified result in String format. If the type is "msdistr" 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 pKa returns the rounded pKa value in string format: the value is rounded using the 'precision' input parameter that determines the number of fractional digits displayed. If the result isDouble.NaN
then returns the empty string.- Overrides:
getResultAsString
in classCalculatorPlugin
- 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
-
getResultsAsString
Returns the specified result with possible subresults (both pKa values instead of the most significant pKa) in String format.- Overrides:
getResultsAsString
in classCalculatorPlugin
- 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
-
getResultAsRGB
Returns the specified result color as int format (alpha<<24 + red<<16 + green<<8 + blue): RED for acidic pKa, BLUE for basic pKa.- Overrides:
getResultAsRGB
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result indexresult
- is the result item- Returns:
- the specified result in color as int format
- Throws:
PluginException
- if an invalid result item is given
-
getResultsAsRGB
Returns the specified result color(s) as int format (alpha<<24 + red<<16 + green<<8 + blue). (e.g. both pKa colors instead of the most significant pKa color) as long (lower and upper bits).- Overrides:
getResultsAsRGB
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result indexresult
- is the result item- Returns:
- the specified result in color as int
- Throws:
PluginException
- if an invalid result item is given
-
isNegligibleResult
Returns whether the result can be ignored. Returnstrue
for microspecies distributions belowCalculatorPlugin.EPSILON
. Returnsfalse
for all other results.- Overrides:
isNegligibleResult
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result indexresult
- is the result object- Returns:
- true for microspecies distributions below
CalculatorPlugin.EPSILON
- Throws:
PluginException
-
isNegligible
public boolean isNegligible(double[] distr) -
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:
getResultMolecule
in classCalculatorPlugin
- Returns:
- the result molecule
- Throws:
PluginException
- 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 macropKa 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:
standardize
in 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
-
getShowLogPercentage
public boolean getShowLogPercentage() -
getLogPercentageLimit
public double getLogPercentageLimit()
-
getpKaValues(int, int)