Class PkaPlugin

All Implemented Interfaces:
TaggedCalculator, Licensable

@PublicApi public class PkaPlugin extends CalculatorPlugin
Plugin class for macro/micro pKa calculation.

API usage example:


    // Import molecule
    Molecule mol = MolImporter.importMol("CC(=O)OC1=CC=CC=C1C(O)=O");

    // 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

    // 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.getPkaValues(i, PkaPlugin.ACIDIC);
        double[] bpka = plugin.getPkaValues(i, PkaPlugin.BASIC);
    }

    // Get microspecies distributions
    double[] phValues = plugin.getPhValues();
    int msCount = plugin.getMsCount(); // number of microspecies
    for (int i = 0; i < msCount; ++i) {
        Molecule ms = plugin.getMsMolecule(i);
        double[] distr = plugin.getMsDistribution(i); // distr values for pH values
    }
 

Another example showing microspecies distributions at a single pH value:


    // Import molecule
    Molecule mol = MolImporter.importMol("CC(=O)OC1=CC=CC=C1C(O)=O");

    // Instantiate plugin
    PkaPlugin plugin = new PkaPlugin();

    // Set pH
    plugin.setPh(3.0);

    // Set molecule and run calculation
    plugin.setMolecule(mol);
    plugin.run();

    // Get microspecies data (molecule and distribution)
    int msCount = plugin.getMsCount(); // number of microspecies
    for (int i = 0; i < msCount; ++i) {
        Molecule ms = plugin.getMsMolecule(i);
        double distr = plugin.getSingleMsDistribution(i);
    }
 

Another example showing macro pKa calculation:


    // Import molecule
    Molecule mol = MolImporter.importMol("CC(=O)OC1=CC=CC=C1C(O)=O");

    // Instantiate plugin
    PkaPlugin plugin = new PkaPlugin();

    // 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);
 

For calculator plugin example applications using Chemaxon's concurrent framework, refer to the Calculator Plugins Developer's Guide.

Since:
Marvin 3.0
  • Field Details

    • ACIDIC

      public static final int ACIDIC
      Constant denoting acidic pKa.
      See Also:
    • BASIC

      public static final int BASIC
      Constant denoting basic pKa.
      See Also:
    • TYPE_DISTR

      public static final String TYPE_DISTR
      Type constant for microspecies distribution.
      See Also:
    • STATIC_PKA_PREFIX

      public static final int STATIC_PKA_PREFIX
      pKa's prefix (acidic/basic) does not depend on the submitted micro state (default)
      See Also:
    • STATICpKaPREFIX

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public static final int STATICpKaPREFIX
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use STATIC_PKA_PREFIX instead. This constant will be removed in a future release.
      pKa's prefix (acidic/basic) does not depend on the submitted microstate (default)
      See Also:
    • DYNAMIC_PKA_PREFIX

      public static final int DYNAMIC_PKA_PREFIX
      pKa's prefix (acidic/basic) does depend on the submitted microstate
      See Also:
    • DYNAMICpKaPREFIX

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public static final int DYNAMICpKaPREFIX
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use DYNAMIC_PKA_PREFIX instead. This constant will be removed in a future release.
      pKa's prefix (acidic/basic) does depend on the submitted microstate
      See Also:
    • DEF_MAX_IONS

      public static final int DEF_MAX_IONS
      The default value of the number of ionizable atoms to consider.
      See Also:
    • DEF_MAXIONS

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public static final int DEF_MAXIONS
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use DEF_MAX_IONS instead. This constant will be removed in a future release.
      The default value of the number of ionizable atoms to consider.
      See Also:
    • DEF_TEMPERATURE

      public static final double DEF_TEMPERATURE
      The default temperature in Kelvins.
      See Also:
    • MODEL_SMALL

      public static final int MODEL_SMALL
      Calculation model: small (precise up to the specified number of ionizable atoms).
      See Also:
    • MODEL_LARGE

      public static final int MODEL_LARGE
      Calculation model: large (always precise, can take more time).
      See Also:
    • DEF_IONIC_STRENGTH

      public static final double DEF_IONIC_STRENGTH
      The 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:
    • DEF_IONICSTRENGTH

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public static final double DEF_IONICSTRENGTH
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use DEF_IONIC_STRENGTH instead. This constant will be removed in a future release.
      The 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

      public String getProductName()
      Description copied from class: CalculatorPlugin
      Returns the product identifier of the plugin. For internal use only!
      Specified by:
      getProductName in class CalculatorPlugin
    • setProgressMonitor

      public void setProgressMonitor(ProgressMonitor pmon)
      Sets a progress observer to be used in run() to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.
      Overrides:
      setProgressMonitor in class CalculatorPlugin
      Parameters:
      pmon - is the progress monitor, may be null
    • setParameters

      public void setParameters(Properties params) throws CalculatorPluginException
      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)
      • ionicstrength: ionic strength (in mol/l, default: 0.05)invalid input: '<'/>
      • 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 to calcAlways=false (cxcalc and API default)
        • large: always precise but can take more time, equivalent to calcAlways=true (GUI default)
      If 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 class CalculatorPlugin
      Parameters:
      params - is the parameter table
      Throws:
      CalculatorPluginException - on error
    • setChemicalTermsArgument

      @Deprecated protected void setChemicalTermsArgument(String arg) throws CalculatorPluginException
      Deprecated.
      For internal use only.
      Sets the argument string as specified in Chemical Terms expressions.
      Overrides:
      setChemicalTermsArgument in class CalculatorPlugin
      Parameters:
      arg - is the strength order index ("1" means the strongest value, "2" means the second strongest value, etc.)
      Throws:
      CalculatorPluginException - on error
    • useCorrectionLibrary

      @Deprecated public void useCorrectionLibrary(boolean use)
      Sets the usage of the correction library. (default: false)
      Parameters:
      use - if true, then the calculation will use the correction library
      Since:
      Marvin 5.2
    • setCorrectionLibrary

      public void setCorrectionLibrary(String correctionLibraryId)
      Sets the correction library.
      Parameters:
      correctionLibraryId - is the correction library identifier
      Since:
      Marvin 5.4
    • setCorrectionData

      public void setCorrectionData(PkaTrainingResult trainingResult)
      Sets correction data for calculation
      Parameters:
      trainingResult - correction data
    • setCorrectionLibraryPath

      public void setCorrectionLibraryPath(String correctionLibraryPath)
      Sets the correction library file directly.
      Since:
      Marvin 6.0
    • getCorrectionLibraryIds

      public static String[] 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 - is true if micro pKa calculation is required.
    • setMicropKaCalc

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setMicropKaCalc(boolean micro)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setMicroPkaCalc(boolean) instead. This method will be removed in a future version.
      Sets micro pKa calculation. Default: false (macro pKa calculation).
      Parameters:
      micro - is true if micro pKa calculation is required.
      Since:
      Marvin 4.1
    • 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 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.
      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
    • setBasicpKaLowerLimit

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setBasicpKaLowerLimit(double minB)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setBasicPkaLowerLimit(double) instead. This method will be removed in a future version.
      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
    • setAcidicpKaUpperLimit

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setAcidicpKaUpperLimit(double maxA)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setAcidicPkaUpperLimit(double) instead. This method will be removed in a future version.
      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 is 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.
      Use setPhLower(double) instead. This method will be removed in a future version.
      Sets pH lower limit for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is 0.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 is 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.
      Use setPhUpper(double) instead. This method will be removed in a future version.
      Sets pH upper limit for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is 14.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 is 1.0.
      Parameters:
      step - is the pH step
    • setpHStep

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpHStep(double step)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setPhStep(double) instead. This method will be removed in a future version.
      Sets pH step for the calculation of microspecies distributions. Also activates the calculation of microspecies distributions. The default value is 1.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
    • setpH

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpH(double ph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setPh(double) instead. This method will be removed in a future version.
      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 size 1.0.
      Parameters:
      mscalc - is true if calculation of microspecies distributions is required
      See Also:
    • isMsCalc

      public boolean isMsCalc()
      Returns true if microspecies calculation.
      Overrides:
      isMsCalc in class CalculatorPlugin
      Returns:
      true if microspecies calculation
    • setPkaPrefixType

      public void setPkaPrefixType(int pkaPrefixType)
      Sets pKa prefix type (default: STATIC_PKA_PREFIX)
      • STATIC pKa prefix: pKa's prefix does not depend on the submitted microstate
      • DYNAMIC pKa prefix: pKa's prefix does depend on the submitted microstate
      Parameters:
      pkaPrefixType - may have two values: STATIC_PKA_PREFIX or DYNAMIC_PKA_PREFIX
    • setpKaPrefixType

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpKaPrefixType(int pkaPrefixType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setPkaPrefixType(int) instead. This method will be removed in a future version.
      Sets pKa prefix type (default: STATIC_PKA_PREFIX)
      • STATIC pKa prefix: pKa's prefix does not depend on the submitted microstate
      • DYNAMIC pKa prefix: pKa's prefix does depend on the submitted microstate
      Parameters:
      pkaPrefixType - may have two values: STATIC_PKA_PREFIX or DYNAMIC_PKA_PREFIX
      Since:
      Marvin 4.1.3
    • getPkaPrefixType

      public int getPkaPrefixType()
      Returns the pKa prefix type.
      Returns:
      the pKa prefix type
    • getpKaPrefixType

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public int getpKaPrefixType()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPkaPrefixType() instead. This method will be removed in a future version.
      Returns the pKa prefix type.
      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
    • setIonicStrength

      public void setIonicStrength(double ionicStr)
      Sets the ionic strength (default : 0.05).
      Parameters:
      ionicStr - is the ionic strength
    • createModifiedInputMolecule

      protected final Molecule createModifiedInputMolecule(Molecule mol) throws CalculatorPluginException
      Returns the canonical tautomeric form of the molecule.
      Overrides:
      createModifiedInputMolecule in class CalculatorPlugin
      Parameters:
      mol - is the input molecule
      Returns:
      the canonical tautomeric form of the molecule
      Throws:
      CalculatorPluginException - on error
      Since:
      Marvin 5.0
    • checkMolecule

      public void checkMolecule(Molecule mol) throws CalculatorPluginException
      Checks the input molecule. Throws exception if the molecule contains R-groups.
      Overrides:
      checkMolecule in class CalculatorPlugin
      Parameters:
      mol - is the input molecule
      Throws:
      CalculatorPluginException - with error message for the user if the molecule is refused
    • setInputMolecule

      protected void setInputMolecule(Molecule mol) throws CalculatorPluginException
      Sets the input molecule.
      Specified by:
      setInputMolecule in class CalculatorPlugin
      Parameters:
      mol - is the input molecule
      Throws:
      CalculatorPluginException - on error
    • run

      public boolean run() throws CalculatorPluginException
      Runs the macro pKa calculation.
      Specified by:
      run in class CalculatorPlugin
      Returns:
      true if the calculation was successful, false if the number of ionizable atoms exceeds the specified limit
      Throws:
      CalculatorPluginException - 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 when MODEL_LARGE is used. Use isOverflowCalculation() to check the used model.
      Returns:
      the number of microspecies and/or distributions.
    • getMacroSpeciesCount

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public int getMacroSpeciesCount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No replacement. This method will be removed in a future version.
      Returns the number of macrospecies count. Calculated only if macro pKa is computed.
      NOTE that no microspecies are calculated when MODEL_LARGE is used. Use isOverflowCalculation() to check the used model.
      Returns:
      the number of macrospecies count.
    • getMsMolecule

      public Molecule getMsMolecule(int msIndex)
      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
    • getPhValues

      public double[] getPhValues()
      Returns the pH array.
      Returns:
      the pH array
    • getpHs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getpHs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPhValues() instead. This method will be removed in a future version.
      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 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
      Since:
      Marvin 3.6
      See Also:
    • getpKa

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getpKa(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPka(int) instead. This method will be removed in a future version.
      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
      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
    • getpKaMixed

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getpKaMixed(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPkaMixed(int) instead. This method will be removed in a future version.
      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
    • getPkaConcentration

      public double getPkaConcentration(int index)
      Returns the so-called concentration ionization constant.
      Parameters:
      index - is the atom index
      Returns:
      the pKa,conc. value, or Double.NaN if there is no pKa value for the given atom index and pKa type
    • getpKaConc

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getpKaConc(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPkaConcentration(int) instead. This method will be removed in a future version.
      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 public double getPka(int index, int type)
      Deprecated.
      Returns the pKa value for the given atom index and pKa type. The pKa calculation has to be run beforehand by calling run().
      Parameters:
      index - is the atom index
      type - is the pka type: ACIDIC or BASIC
      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 calling run().
      Parameters:
      index - is the atom index
      type - is the pka type: ACIDIC or BASIC
      Returns:
      the pKa values, or null if there is no pKa value for the given atom index and pKa type
      See Also:
    • getpKaValues

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getpKaValues(int index, int type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPkaValues(int, int) instead. This method will be removed in a future version.
      Returns the pKa values for the given atom index and pKa type. The pKa calculation has to be run beforehand by calling run().
      Parameters:
      index - is the atom index
      type - is the pka type: ACIDIC or BASIC
      Returns:
      the pKa values, or null if there is no pKa value for the given atom index and pKa type
      Since:
      Marvin 4.1.3
      See Also:
    • getPkaType

      public int getPkaType(int index)
      Returns the pKa type: ACIDIC, BASIC or 0 if there is no pKa value for the given atom.
      Parameters:
      index - is the atom index
      Returns:
      the pKa type: ACIDIC, BASIC or 0.
    • getpKaType

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public int getpKaType(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getPkaType(int) instead. This method will be removed in a future version.
      Returns the pKa type: ACIDIC, BASIC or 0 if there is no pKa value for the given atom.
      Parameters:
      index - is the atom index
      Returns:
      the pKa type: ACIDIC, BASIC or 0.
      Since:
      Marvin 3.6
    • 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:
    • getMacroSpeciesCharge

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public int getMacroSpeciesCharge(int msIndex)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getMacrospeciesCharge(int) instead. This method will be removed in a future version.
      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()
      Returns true if overflow calculation: maximum number of ionizable atoms exceeded and protein ionization invoked.
      Returns:
      true if overflow calculation
    • getErrorMessage

      public 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.
      Overrides:
      getErrorMessage in class CalculatorPlugin
      Returns:
      the calculation error information message
    • getWarningMessage

      public String getWarningMessage()
      Returns the calculation warning information message.
      Overrides:
      getWarningMessage in class CalculatorPlugin
      Returns:
      the calculation warning information message
    • getResultTypes

      public Object[] getResultTypes()
      Returns the result types (possible types: pKa, acidic, basic, msdistr).
      Overrides:
      getResultTypes in class CalculatorPlugin
      Returns:
      the result types
    • getResultDomain

      public int getResultDomain(Object type)
      Returns the calculation domain CalculatorPlugin.ATOM or CalculatorPlugin.MOLECULE. pKa always returns CalculatorPlugin.ATOM.
      Overrides:
      getResultDomain in class CalculatorPlugin
      Parameters:
      type - is the result type
      Returns:
      CalculatorPlugin.ATOM
      See Also:
    • getResultCount

      public int getResultCount(Object type)
      Returns the number of result items for the given result key. pKa returns the atom count.
      Overrides:
      getResultCount in class CalculatorPlugin
      Parameters:
      type - is the result type
      Returns:
      the number of result items
      See Also:
    • getResult

      public Object getResult(Object type, int index) throws CalculatorPluginException
      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 class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      Returns:
      the result item for the specified key and index
      Throws:
      CalculatorPluginException - if the result cannot be returned
      See Also:
    • getMacroPkaValues

      public void getMacroPkaValues(int pkaType, double[] values, int[] indexes) throws CalculatorPluginException
      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).
      Parameters:
      pkaType - is the pKa type (ACIDIC or BASIC)
      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)
      Throws:
      CalculatorPluginException - if an error occurs during the calculation
      Since:
      Marvin 5.0.7
    • getMacropKaValues

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void getMacropKaValues(int pkaType, double[] values, int[] indexes) throws CalculatorPluginException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getMacroPkaValues(int, double[], int[]) instead. This method will be removed in a future version.
      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).
      Parameters:
      pkaType - is the pKa type (ACIDIC or BASIC)
      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)
      Throws:
      CalculatorPluginException - if an error occurs during the calculation
      Since:
      Marvin 5.0.7
    • getMacroPkaValues

      public double[] getMacroPkaValues(int pkaType) throws CalculatorPluginException
      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 calling run().
      Parameters:
      pkaType - is the pKa type (ACIDIC or BASIC)
      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:
      CalculatorPluginException - if an error occurs during the calculation
      Since:
      Marvin 5.0.7
    • getMacropKaValues

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getMacropKaValues(int pkaType) throws CalculatorPluginException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getMacroPkaValues(int) instead. This method will be removed in a future version.
      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 calling run().
      Parameters:
      pkaType - is the pKa type (ACIDIC or BASIC)
      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:
      CalculatorPluginException - if an error occurs during the calculation
      Since:
      Marvin 5.0.7
    • getResultAsString

      public String getResultAsString(Object type, int index, Object result) throws CalculatorPluginException
      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.
      Overrides:
      getResultAsString in class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      result - is the result item
      Returns:
      the specified result in String format
      Throws:
      CalculatorPluginException - if an invalid result item is given
    • getResultsAsString

      public String getResultsAsString(Object type, int index, Object result) throws CalculatorPluginException
      Returns the specified result with possible subresults (both pKa values instead of the most significant pKa) in String format.
      Overrides:
      getResultsAsString in class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      result - is the result item
      Returns:
      the specified result in String format
      Throws:
      CalculatorPluginException - if an invalid result item is given
    • getResultAsRGB

      public int getResultAsRGB(Object type, int index, Object result) throws CalculatorPluginException
      Returns the specified result color as int format (alphainvalid input: '<'invalid input: '<'24 + redinvalid input: '<'invalid input: '<'16 + greeninvalid input: '<'invalid input: '<'8 + blue): RED for acidic pKa, BLUE for basic pKa.
      Overrides:
      getResultAsRGB in class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      result - is the result item
      Returns:
      the specified result in color as int format
      Throws:
      CalculatorPluginException - if an invalid result item is given
    • getResultsAsRGB

      public long getResultsAsRGB(Object type, int index, Object result) throws CalculatorPluginException
      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 class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      result - is the result item
      Returns:
      the specified result in color as int
      Throws:
      CalculatorPluginException - if an invalid result item is given
    • isNegligibleResult

      public boolean isNegligibleResult(Object type, int index, Object result) throws CalculatorPluginException
      Returns whether the result can be ignored. Returns true for microspecies distributions below CalculatorPlugin.EPSILON. Returns false for all other results.
      Overrides:
      isNegligibleResult in class CalculatorPlugin
      Parameters:
      type - is the result type
      index - is the result index
      result - is the result object
      Returns:
      true for microspecies distributions below CalculatorPlugin.EPSILON
      Throws:
      CalculatorPluginException
    • isNegligible

      public boolean isNegligible(double[] distr)
    • getResultMolecule

      public Molecule getResultMolecule() throws CalculatorPluginException
      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 class CalculatorPlugin
      Returns:
      the result molecule
      Throws:
      CalculatorPluginException - on error
      Since:
      Marvin 4.0
    • standardize

      public void standardize(Molecule mol)
      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:
      standardize in class CalculatorPlugin
      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()