Returns the calculation error information message if run()
returned false (calculation error): the number of ionizable atoms
exceeds the specified limit (given in the "ions" parameter) or
hydrogen valence error.

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.

setMicropKaCalc

setCalcAlways

@Deprecated
public void setCalcAlways(boolean calcAlways)

Deprecated.replaced by setModel(int)

Sets whether to perform calculation if the maximum number of ionizable atoms
is exceeded.
If set to true, 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 - is true if calculation should be performed
if the maximum number of ionizable atoms is exceeded

setMaxIons

public void setMaxIons(int n)

In case of MODEL_SMALL model, it
sets the maximum number of ionizable atoms to be considered
and uses simple calculation method to compute pKa values.
In case of MODEL_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 is 8.

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 when MODEL_LARGE is used.
Use isOverflowCalculation() to check the used model.

Returns:

the number of microspecies and/or distributions.

getMsMolecule

Returns the microspecies molecule.
Calculated only if macro pKa is computed and
the "mscalc" parameter is set to "true".
Microspecies are calculated only when MODEL_SMALL is used.
Use isOverflowCalculation() 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 in setpH(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

getpKa

public double getpKa(int index)

Returns the most significant pKa value for the given atom index. Use this
to get the pKa if STATICpKaPREFIX prefix type is set. The pKa
calculation has to be run beforehand by calling run().

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

isOverflowCalculation

getErrorMessage

public java.lang.String getErrorMessage()

Returns the calculation error information message if run()
returned false (calculation error): the number of ionizable atoms
exceeds the specified limit (given in the "ions" parameter) or
hydrogen valence error.

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.

getResult

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.
Returns Double.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).

getSortedValues

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 calling run().
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).

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 to Double.NaN if there are less
pKa values than the array length

indexes - is the corresponding atom index array to be filled (may be null),
the index is set to -1 for non-existent values
(Double.NaN)

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 calling run().
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).

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 to Double.NaN if there are less
pKa values than the array length

indexes - is the corresponding atom index array to be filled (may be null),
the index is set to -1 for non-existent values
(Double.NaN)

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 is Double.NaN then returns the empty string.

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.reaction.Standardizer