Class LogPPlugin

All Implemented Interfaces:
TaggedCalculator, Licensable

@PublicApi public class LogPPlugin extends CalculatorPlugin
Plugin class for logP calculation. Both the incremental logP values for atoms and the overal logP value for the molecule can be calculated by this plugin.

Reference:

  1. J.Chem.Inf.Comput.Sci. 1989, 29, 163-172

API usage example:


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

    // Fill parameters
    Properties params = new Properties();
    params.put("type", "logP");

    // Create plugin
    LogPPlugin plugin = new LogPPlugin();

    // Set logP calculation method
    plugin.setLogPMethod(LogPPlugin.METHOD_WEIGHTED);

    // Set method weights
    plugin.setWeightOfMethods(1, 2, 1, 0);

    // Set parameters
    plugin.setChlorideIonConcentration(0.2);
    plugin.setNaKIonConcentration(0.2);

    // Set result types
    plugin.setUserTypes("logPTrue,logPMicro");

    // Set the input molecule
    plugin.setMolecule(mol);

    // Run the calculation
    plugin.run();

    // Get the overall logP value
    double logp = plugin.getLogPTrue();
    double logpm = plugin.getLogPMicro();

    System.out.println("True logP: " + logp);
    System.out.println("Micro logP: " + logpm);
 

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

  • Constructor Details

    • LogPPlugin

      public LogPPlugin()
      Constructor. Creates the logP 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. logP 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)
      • type: increments,logP,logPTrue,logPMicro,logPNonionic,logDpI,logPInvivo (logP means all of, logPTrue means the most typical of logPMicro,logPNonionic,logDpI which exists for the input molecule)
      • h: true or false (display increments on implicit H atoms)
      • majortautomer: true or false (take major tautomeric form)
      • method: vg, klop, phys, user, weighted
      Overrides:
      setParameters in class CalculatorPlugin
      Parameters:
      params - is the parameter table
      Throws:
      CalculatorPluginException - on error
    • setPh

      public void setPh(double ph)
      Sets the pH for logP calculation
      Parameters:
      ph - is the pH
    • 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
    • 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
    • createModifiedInputMolecule

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

      public void setUserTypes(String chtypes) throws CalculatorPluginException
      Sets user types. Possible types: logP,logPTrue,logPMicro,logPNonionic,logDpI,logPInvivo (logP means all of, logPTrue means the most typical of logPMicro,logPNonionic,logDpI which exists for the input molecule) multiple values should be separated by "," (e.g.: "logPTrue,logPNonionic,logDpI").
      Parameters:
      chtypes - is the type string
      Throws:
      CalculatorPluginException - for invalid type
    • 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
    • getTrainingIds

      public static String[] getTrainingIds()
      Returns the id's of available logP trainings.
      Returns:
      the id's of available logP trainings
      Since:
      Marvin 5.4
    • setTraining

      public void setTraining(String trainingId) throws CalculatorPluginException
      Sets the user defined training.
      Parameters:
      trainingId - the training id
      Throws:
      CalculatorPluginException - if training id is invalid, or parameter file for training cannot be loaded
      Since:
      Marvin 5.4
    • setTrainingResults

      public void setTrainingResults(InputStream trainingResultStream) throws CalculatorPluginException
      Sets the user defined training from a stream.
      Throws:
      CalculatorPluginException - for I/O problems.
    • run

      public boolean run() throws CalculatorPluginException
      Runs the logP 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:
    • getLogPMicro

      public double getLogPMicro()
      Returns the micro logP value. The logP calculation should be run beforehand by run().
      Returns:
      the micro logP value
    • getlogPMicro

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getlogPMicro()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogPMicro() instead. This method will be removed in a future version.
      Returns the micro logP value. The logP calculation should be run beforehand by run().
      Returns:
      the micro logP value
    • getLogPNonionic

      public double getLogPNonionic()
      Returns the logP value for the non-ionic form. The logP calculation should be run beforehand by run().
      Returns:
      the nonionic logP value
    • getlogPNonionic

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getlogPNonionic()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogPNonionic() instead. This method will be removed in a future version.
      Returns the logP value for the non-ionic form. The logP calculation should be run beforehand by run().
      Returns:
      the nonionic logP value
    • getLogDAtIsoelectricPoint

      public double getLogDAtIsoelectricPoint()
      Returns the logD value at the isoelectric point (pI). The logP calculation should be run beforehand by run().
      Returns:
      the logDpI value
    • getlogDpI

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getlogDpI()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogDAtIsoelectricPoint() instead. This method will be removed in a future version.
      Returns the logD value at the isoelectric point (pI). The logP calculation should be run beforehand by run().
      Returns:
      the logDpI value
    • getLogPTrue

      public double getLogPTrue()
      Returns the most typical logP among logD at pI, micro logP and nonionic logP.
      Returns:
      the most typical logP value
    • getlogPTrue

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getlogPTrue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getLogPTrue() instead. This method will be removed in a future version.
      Returns the most typical logP among logD at pI, micro logP and nonionic logP.
      Returns:
      the most typical logP value
    • getAtomLogPIncrement

      public double getAtomLogPIncrement(int index)
      Returns the logP increment for the specified atom.
      Parameters:
      index - is the atom index
      Returns:
      the logP increment
    • getAtomlogPIncrement

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getAtomlogPIncrement(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getAtomLogPIncrement(int) instead. This method will be removed in a future version.
      Returns the logP increment for the specified atom.
      Parameters:
      index - is the atom index
      Returns:
      the logP increment
    • getStructuralLogPIncrement

      public double getStructuralLogPIncrement()
      Returns the structural logP increment. The sum of atomic increments and structural increment is the predicted logP.
      Returns:
      the structural logP increment
    • getStructurallogPIncrement

      @Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2027) public double getStructurallogPIncrement()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getStructuralLogPIncrement() instead. This method will be removed in a future version.
      Returns the structural logP increment. The sum of atomic increments and structural increment is the predicted logP.
      Returns:
      the structural logP increment
      Since:
      Marvin 5.4
    • getResultTypes

      public Object[] getResultTypes()
      Returns the result types. Possible result types: "logPTrue" (most typical logP) "logPMicro", "logPNonionic", "logDpI", "increments".
      Overrides:
      getResultTypes in class CalculatorPlugin
      Returns:
      the result types
    • getUserTypes

      public Object[] getUserTypes()
      Returns the user defined result types. Possible result types: "logP" (all of micro logP, nonionic logP and logD at pI), "logPTrue" (most typical logP), "logPMicro", "logPNonionic", "logDpI", "increments".
      Returns:
      the result types
    • getTypeString

      public String getTypeString(Object type)
      Returns a string representation of the given type.
      Overrides:
      getTypeString in class CalculatorPlugin
      Parameters:
      type - is the type object
      Returns:
      the type string
    • getResultDomain

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

      public int getResultCount(Object type)
      Returns the number of result items for the given result key. logP returns the atom count for types "increments" 1 otherwise.
      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. logP returns the required logP value as a Double object.
      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:
    • getStandardError

      public double getStandardError(Object type, int index)
    • getResultAsString

      public String getResultAsString(Object type, int index, Object result) throws CalculatorPluginException
      Returns the specified result in String format. logP returns the rounded logP value in string format: the value is rounded using the 'precision' input parameter that determines the number of fractional digits displayed.
      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
    • 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. Does AROM_BASIC aromatization.
      Overrides:
      standardize in class CalculatorPlugin
      Parameters:
      mol - is the molecule to be standardized
    • needError

      public boolean needError()