Class LogDPlugin

All Implemented Interfaces:
TaggedCalculator, Licensable

@PublicApi public class LogDPlugin extends CalculatorPlugin
Plugin class for logD calculation.

API usage example:


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

     // Set logP calculation method
     plugin.setlogPMethod(LogPMethod.CONSENSUS);

     // Set parameters
     plugin.setChlorideIonConcentration(0.2);
     plugin.setNaKIonConcentration(0.2);
     plugin.setPhLower(3.0);
     plugin.setPhUpper(6.0);
     plugin.setPhStep(1.0);

     try (MolImporter importer = new MolImporter("targets.sdf")) {
        Molecule mol = null;
        while ((mol = importer.read()) != null) {
            // Set molecule and run calculation
            plugin.setMolecule(mol);
            plugin.run();

            // Get and print logD values
            double[] phValues = plugin.getPhValues();
            double[] logDValues = plugin.getLogDValues();
            for (int i = 0; i < phValues.length; ++i) {
                System.out.println(phValues[i] + ": " + logDValues[i]);
            }
        }
     }
 

Another example showing logD calculation at a single pH value:

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

    // Set pH
    plugin.setPh(3.0);

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

    // Get and print logD value
    double logD = plugin.getLogD();
    System.out.println("logD at pH 3.0: " + logD);
 
 

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

  • Constructor Details

    • LogDPlugin

      public LogDPlugin()
      Constructor. Creates the charge 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
    • setParameters

      public void setParameters(Properties params) throws CalculatorPluginException
      Sets the input parameters for the plugin. Charge parameters and value ranges:
      • precision: 0-8 or inf (number of displayed fractional digits, inf for unrounded value)
      • anion: Cl- ion concentration (default: 0.1)
      • kation: Na+ plus K+ ion concentration (default: 0.1)
      • pH: pH value - calculate logD at a single pH
      • lower: pH lower limit (default: 0.0)
      • upper: pH upper limit (default: 14.0)
      • count: pH step size between lower and upper limits (default: 0.5)
      • ref1-ref4: reference pH values
      • considertautomerization: consider tautomerization
      • method: vg, klop, phys, user, weighted
      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.
      Description copied from class: CalculatorPlugin
      Sets the argument string as specified in Chemical Terms expressions. This method may only be called from CalculatorPlugin.setChemicalTermsParameters(Properties, String).
      Overrides:
      setChemicalTermsArgument in class CalculatorPlugin
      Parameters:
      arg - The argument, never null. Its meaning is implementation-dependent.
      Throws:
      CalculatorPluginException - on error
    • setChlorideIonConcentration

      public void setChlorideIonConcentration(double c)
      Sets the Cl- concentration (default: 0.1).
      Parameters:
      c - is the concentration
    • setCloridIonConcentration

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setCloridIonConcentration(double c)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setChlorideIonConcentration(double) instead. This method will be removed in a future version.
      Sets the Cl- concentration (default: 0.1).
      Parameters:
      c - is the concentration
    • setNaKIonConcentration

      public void setNaKIonConcentration(double c)
      Sets the Na+, K+ concentration (default: 0.1).
      Parameters:
      c - is the concentration
    • setPhLower

      public void setPhLower(double lower)
      Sets pH lower limit (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.
      Use setPhLower(double) instead. This method will be removed in a future version.
      Sets pH lower limit (default: 0.0).
      Parameters:
      lower - is the pH lower limit
    • setPhUpper

      public void setPhUpper(double upper)
      Sets pH upper limit (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.
      Use setPhUpper(double) instead. This method will be removed in a future version.
      Sets pH upper limit (default: 14.0).
      Parameters:
      upper - is the pH upper limit
    • setPhStep

      public void setPhStep(double step)
      Sets pH step to be taken between the pH lower and upper limits (default: 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 to be taken between the pH lower and upper limits (default: 1.0).
      Parameters:
      step - is the pH step
    • setPh

      public void setPh(double ph)
      Sets a single pH value for the logD calculation.
      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 a single pH value for the logD calculation.
      Parameters:
      ph - is the pH value
    • setConsiderTautomerization

      public void setConsiderTautomerization(boolean considerTautomerization)
      Sets to consider tautomerization in calculation. Default: false.
      Parameters:
      considerTautomerization - if true the calculation will be performed considering tautomerization and resonance
      Since:
      Marvin 5.0
    • setConsiderHPLCEffect

      public void setConsiderHPLCEffect(boolean hplc)
      Sets to take into account the HPLC effect The default is the shake flask's logD
    • checkMolecule

      public void checkMolecule(Molecule mol) throws CalculatorPluginException
      Checks the input molecule. Throws exception if the molecule is RxnMolecule, if the molecule contains R-groups or if the molecule consists of more than one fragments.
      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 (standardized) input molecule
      Throws:
      CalculatorPluginException - on error
    • setLogPMethod

      public void setLogPMethod(LogPMethod method)
      Sets the logP calculation method. See LogPMethod for available methods. The default is LogPMethod.CONSENSUS.
      Parameters:
      method - the logP calculation method
    • setlogPMethod

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setlogPMethod(LogPMethod method)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setLogPMethod(LogPMethod) instead. This method will be removed in a future version.
      Sets the logP calculation method. See LogPMethod for available methods. The default is LogPMethod.CONSENSUS.
      Parameters:
      method - the logP calculation method
    • getLogPTrainingIds

      public static String[] getLogPTrainingIds()
      Returns the IDs of available logP trainings.
      Returns:
      the IDs of available logP trainings
      Since:
      Marvin 5.4
    • setLogPTrainingId

      public void setLogPTrainingId(String trainingId) throws CalculatorPluginException
      Sets the user defined logP training.

      NOTE: This method overwrites the effect of setLogPTraining(InputStream)

      Parameters:
      trainingId - the logP training id
      Throws:
      CalculatorPluginException - if training id is invalid, or parameter file for training cannot be loaded
      Since:
      Marvin 5.4
    • setLogPTraining

      public void setLogPTraining(InputStream inputStream) throws CalculatorPluginException
      Sets the user defined logP training from a stream of parameters.

      NOTE: This method overwrites the effect of setLogPTrainingId(String)

      Throws:
      CalculatorPluginException - if parameter file for training cannot be loaded
    • setPkaCorrectionLibrary

      public void setPkaCorrectionLibrary(String correctionLibraryId)
      Sets the pKa correction library.
      Parameters:
      correctionLibraryId - is the pKa correction library identifier
    • setpKaCorrectionLibrary

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpKaCorrectionLibrary(String correctionLibraryId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setPkaCorrectionLibrary(String) instead. This method will be removed in a future version.
      Sets the pKa correction library.
      Parameters:
      correctionLibraryId - is the pKa correction library identifier
      Since:
      Marvin 5.4
    • setPkaCorrectionLibrary

      public void setPkaCorrectionLibrary(InputStream inputStream) throws CalculatorPluginException
      Sets the pKa correction library from a stream.
      Throws:
      CalculatorPluginException
    • setpKaCorrectionLibrary

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public void setpKaCorrectionLibrary(InputStream inputStream) throws CalculatorPluginException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setPkaCorrectionLibrary(InputStream) instead. This method will be removed in a future version.
      Sets the pKa correction library from a stream.
      Throws:
      CalculatorPluginException
    • run

      public boolean run() throws CalculatorPluginException
      Runs the logD calculation.
      Specified by:
      run in class CalculatorPlugin
      Returns:
      true if the calculation was successful, false on calculation problems
      Throws:
      CalculatorPluginException - on error
      See Also:
    • getErrorMessage

      public String getErrorMessage()
      Returns the calculation error information message if run() returned false (calculation error): hydrogen valence error.
      Overrides:
      getErrorMessage in class CalculatorPlugin
      Returns:
      the calculation error information message
    • getWarningMessage

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

      public double calcLogD(double ph) throws CalculatorPluginException
      Returns the logD value at fixed pH.
      Parameters:
      ph - is the pH value
      Returns:
      the logD value at the given pH
      Throws:
      CalculatorPluginException - on error
    • calclogD

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double calclogD(double ph) throws CalculatorPluginException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use calcLogD(double) instead. This method will be removed in a future version.
      Returns the logD value at fixed pH.
      Parameters:
      ph - is the pH value
      Returns:
      the logD value at the given pH
      Throws:
      CalculatorPluginException - on error
    • getHydrophobicity

      public double getHydrophobicity()
    • getHidrophobicity

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getHidrophobicity()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getChargeCategory

      public String getChargeCategory()
    • getResultTypes

      public Object[] getResultTypes()
      Returns the result types. Possible result types: "logD", "reflogD".
      Overrides:
      getResultTypes in class CalculatorPlugin
      Returns:
      the result types
    • getReferencePhValues

      public double[] getReferencePhValues()
      Returns the reference pH values.
      Returns:
      the reference pH array
    • getRefpHs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getRefpHs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getReferencePhValues() instead. This method will be removed in a future version.
      Returns the reference pH values.
      Returns:
      the reference pH array
    • getReferenceLogDValues

      public double[] getReferenceLogDValues()
      Returns the reference logD values.
      Returns:
      the reference logD array
    • getReflogDs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getReflogDs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getReferenceLogDValues() instead. This method will be removed in a future version.
      Returns the reference logD values.
      Returns:
      the reference logD array
    • getLogD

      public double getLogD()
      Returns the logD value for the pH specified in setPh(double).
      Returns:
      the logD value
    • getlogD

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getlogD()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogD() instead. This method will be removed in a future version.
      Returns the logD value for the pH specified in setpH(double).
      Returns:
      the logD value
    • 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
    • getLogDValues

      public double[] getLogDValues()
      Returns the logD array.
      Returns:
      the logD array
    • getlogDs

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double[] getlogDs()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogDValues() instead. This method will be removed in a future version.
      Returns the logD array.
      Returns:
      the logD array
    • getResultDomain

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

      public int getResultCount(Object type)
      Returns the number of result items for the given result key. logD returns 1.
      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 type and index. logD returns the main or reference (pH, logD) arrays as a double[2][] with the 0-th element being the pH array and the 1-st element being the logD array.
      Overrides:
      getResult in class CalculatorPlugin
      Parameters:
      type - is the result type: "logD" or "reflogD"
      index - is the result index
      Returns:
      the result item for the specified type 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. logD returns the rounded (pH, logD) value pairs in string format: the values are rounded using the 'precision' input parameter that determines the number of fractional digits displayed, pH and logD are separated by a tab character.
      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
    • getImageMolecule

      public Molecule getImageMolecule() throws CalculatorPluginException
      Returns the molecule to be used for legend image.
      Returns:
      the image molecule
      Throws:
      CalculatorPluginException - on error
    • 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. Does AROM_BASIC aromatization.
      Overrides:
      standardize in class CalculatorPlugin
      Parameters:
      mol - is the molecule to be standardized