Package chemaxon.marvin.calculations
Class logDPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.logDPlugin
- All Implemented Interfaces:
TaggedCalculator
,chemaxon.license.Licensable
Plugin class for logD calculation.
API usage example:
// instantiate plugin logDPlugin plugin = new logDPlugin(); // set logP calculation method plugin.setlogPMethod(METHOD_WEIGHTED); // set method weights plugin.setWeightOfMethods(1, 2, 1, 0); // set parameters plugin.setCloridIonConcentration(0.2); plugin.setNaKIonConcentration(0.2); plugin.setpHLower(3.0); plugin.setpHUpper(6.0); plugin.setpHStep(1.0); MolImporter importer = new MolImporter("targets.sdf"); Molecule mol = null; while ((mol = importer.read()) != null) { // set molecule and run calculation plugin.setMolecule(mol); plugin.run(); double[] pHs = plugin.getpHs(); double[] logDs = plugin.getlogDs(); // get and print logD values for (int i=0; i < pHs.length; ++i) { double pH = pHs[i]; double logD = logDs[i]; System.out.println(pH+", "+logD); } } importer.close();
Another example showing logD calculation at a single pH value:
// instantiate plugin logDPlugin plugin = new logDPlugin(); // set pH plugin.setpH(3.0); // set the input molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get result double logD = plugin.getlogD(); // print result System.out.println("logD at pH 3.0: "+logD);For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated, for removal: This API element is subject to removal in a future version.This field will not be available from May 2016.static final int
Deprecated, for removal: This API element is subject to removal in a future version.This field will not be available from May 2016.static final int
Deprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.USER_DEFINED
instead.static final int
Deprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.CHEMAXON
instead.static final int
Deprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.CONSENSUS
instead.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 TypeMethodDescriptiondouble
calclogD
(double pH) Returns the logD value at fixed pH.void
checkMolecule
(Molecule mol) Checks the input molecule.Returns the calculation error information message ifrun()
returned false (calculation error): hydrogen valence error.double
Returns the molecule to be used for legend image.double
getlogD()
Returns the logD value for the pH specified insetpH(double)
.double[]
getlogDs()
Returns the logD array.static String[]
Returns the id's of available logP trainings.double[]
getpHs()
Returns the pH array.Returns the product identifier of the plugin as given byLicenseManager
.double[]
Returns the reference logD array.double[]
Returns the reference pH array.Returns the result item for the specified type and index.Deprecated, for removal: This API element is subject to removal in a future version.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
.Object[]
Returns the result types.Returns the calculation warning message.boolean
run()
Runs the logD calculation.protected void
Deprecated.void
setCloridIonConcentration
(double c) Sets theCl-
concentration (default:0.1
).void
setConsiderHPLCEffect
(boolean hplc) void
setConsiderTautomerization
(boolean considerTautomerization) Sets to consider tautomerization in calculation.protected void
setInputMolecule
(Molecule mol) Sets the input molecule.void
setlogPMethod
(int method) Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #setlogPMethod(LogPMethod))} instead.void
setlogPMethod
(LogPMethod method) Sets the logP calculation method.void
setLogPTraining
(InputStream inputStream) Sets the user defined logP training from a stream of parameters.void
setLogPTrainingId
(String trainingId) Sets the user defined logP training.void
setNaKIonConcentration
(double c) Sets theNa+, K+
concentration (default:0.1
).void
setParameters
(Properties params) Sets the input parameters for the plugin.void
setpH
(double pH) Sets a single pH value for the logD calculation.void
setpHLower
(double lower) Sets pH lower limit (default:0.0
).void
setpHStep
(double step) Sets pH step to be taken between the pH lower and upper limits (default:1.0
).void
setpHUpper
(double upper) Sets pH upper limit (default:14.0
).void
setpKaCorrectionLibrary
(InputStream inputStream) Sets the pKa correction library from a stream.void
setpKaCorrectionLibrary
(String correctionLibraryId) Sets the pKa correction library.void
setWeightOfMethods
(double wVG, double wKLOP, double wPHYS, double wUSER) Deprecated, for removal: This API element is subject to removal in a future version.This function will not be available from May 2016.void
standardize
(Molecule mol) Standardizes the molecule.Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createModifiedInputMolecule, 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, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecule, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getTypeString, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, 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
-
METHOD_VG
Deprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.CHEMAXON
instead.logP calculation method "VG" -
METHOD_KLOP
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static final int METHOD_KLOPDeprecated, for removal: This API element is subject to removal in a future version.This field will not be available from May 2016. UseLogPMethod
instead.logP calculation method "KLOP" -
METHOD_PHYS
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static final int METHOD_PHYSDeprecated, for removal: This API element is subject to removal in a future version.This field will not be available from May 2016. UseLogPMethod
instead.logP calculation method "PHYS" -
METHOD_USER_DEFINED
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static final int METHOD_USER_DEFINEDDeprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.USER_DEFINED
instead.User defined logP calculation method. -
METHOD_WEIGHTED
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public static final int METHOD_WEIGHTEDDeprecated, for removal: This API element is subject to removal in a future version.UseLogPMethod.CONSENSUS
instead.Weighted logP calculation method.
-
-
Constructor Details
-
logDPlugin
public logDPlugin()Constructor. Creates the charge calculator object.
-
-
Method Details
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager
.- Specified by:
getProductName
in classCalculatorPlugin
- Returns:
- The identifier
LicenseManager.PARTITIONING_PLUGIN_GROUP
-
setParameters
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 classCalculatorPlugin
- Parameters:
params
- is the parameter table- Throws:
PluginException
- on error
-
setChemicalTermsArgument
Deprecated.Description copied from class:CalculatorPlugin
Sets the argument string as specified in Chemical Terms expressions. This method may only be called fromCalculatorPlugin.setChemicalTermsParameters(Properties, String)
.- Overrides:
setChemicalTermsArgument
in classCalculatorPlugin
- Parameters:
arg
- The argument, never null. Its meaning is implementation-dependent.- Throws:
PluginException
- on error
-
setCloridIonConcentration
public void setCloridIonConcentration(double c) Sets theCl-
concentration (default:0.1
).- Parameters:
c
- is the concentration
-
setNaKIonConcentration
public void setNaKIonConcentration(double c) Sets theNa+, 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
-
setpHUpper
public void setpHUpper(double upper) 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
-
setpH
public void setpH(double pH) 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
- iftrue
the calculation will be performed considering tautomerization and resonance- Since:
- Marvin 5.0
-
setConsiderHPLCEffect
public void setConsiderHPLCEffect(boolean hplc) -
checkMolecule
Checks the input molecule. Throws exception if the molecule isRxnMolecule
, if the molecule contains R-groups or if the molecule consists of more than one fragments.- 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 (standardized) input molecule- Throws:
PluginException
- on error
-
setlogPMethod
Sets the logP calculation method. The available methods are: The default isLogPMethod.CONSENSUS
.- Parameters:
method
- is the logP calculation method- Since:
- Marvin 15.4.13
-
setlogPMethod
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setlogPMethod(int method) Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #setlogPMethod(LogPMethod))} instead.Sets the logP calculation method. The available methods are: The default isMETHOD_WEIGHTED
.- Parameters:
method
- is the logP calculation method- Since:
- Marvin 5.1.3
- See Also:
-
setWeightOfMethods
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public void setWeightOfMethods(double wVG, double wKLOP, double wPHYS, double wUSER) Deprecated, for removal: This API element is subject to removal in a future version.This function will not be available from May 2016. UsesetlogPMethod(LogPMethod)
instead.Sets the weight of logP calculation methods. Default:- weight of
METHOD_VG
method = 1 - weight of
METHOD_KLOP
method = 1 - weight of
METHOD_PHYS
method = 1 - weight of
METHOD_USER_DEFINED
method = 0
METHOD_WEIGHTED
method.- Parameters:
wVG
- weight ofMETHOD_VG
methodwKLOP
- weight ofMETHOD_KLOP
methodwPHYS
- weight ofMETHOD_PHYS
methodwUSER
- weight ofMETHOD_USER_DEFINED
method- Since:
- Marvin 5.1.3
- See Also:
- weight of
-
getLogPTrainingIds
Returns the id's of available logP trainings.- Returns:
- the id's of available logP trainings
- Since:
- Marvin 5.4
-
setLogPTrainingId
Sets the user defined logP training. NOTE: Overwrites the effect ofsetLogPTraining(InputStream)
- Parameters:
trainingId
- the logP training id- Throws:
PluginException
- if training id is invalid, or parameter file for training cannot be loaded- Since:
- Marvin 5.4
-
setLogPTraining
Sets the user defined logP training from a stream of parameters. NOTE: Overwrites the effect ofsetLogPTrainingId(String)
- Throws:
PluginException
- if parameter file for training cannot be loaded
-
setpKaCorrectionLibrary
Sets the pKa correction library.- Parameters:
correctionLibraryId
- is the pKa correction library identifier- Since:
- Marvin 5.4
-
setpKaCorrectionLibrary
Sets the pKa correction library from a stream.- Throws:
PluginException
-
run
Runs the logD calculation.- Specified by:
run
in classCalculatorPlugin
- Returns:
- true if the calculation was successful, false on calculation problems
- Throws:
PluginException
- on error- See Also:
-
getErrorMessage
Returns the calculation error information message ifrun()
returned false (calculation error): hydrogen valence error.- Overrides:
getErrorMessage
in classCalculatorPlugin
- Returns:
- the calculation error information message
-
getWarningMessage
Returns the calculation warning message.- Overrides:
getWarningMessage
in classCalculatorPlugin
- Returns:
- the calculation warning information message
- See Also:
-
calclogD
Returns the logD value at fixed pH.- Parameters:
pH
- is the pH value- Returns:
- the logD value at the given pH
- Throws:
PluginException
- on error
-
getHidrophobicity
public double getHidrophobicity() -
getChargeCategory
-
getResultTypes
Returns the result types. Possible result types: "logD", "reflogD".- Overrides:
getResultTypes
in classCalculatorPlugin
- Returns:
- the result types
-
getRefpHs
public double[] getRefpHs()Returns the reference pH array.- Returns:
- the reference pH array
-
getReflogDs
public double[] getReflogDs()Returns the reference logD array.- Returns:
- the reference logD array
-
getlogD
public double getlogD()Returns the logD value for the pH specified insetpH(double)
.- Returns:
- the logD value
-
getpHs
public double[] getpHs()Returns the pH array.- Returns:
- the pH array
-
getlogDs
public double[] getlogDs()Returns the logD array.- Returns:
- the logD array
-
getResultDomain
Returns the calculation domainCalculatorPlugin.ATOM
orCalculatorPlugin.MOLECULE
. logD returnsCalculatorPlugin.MOLECULE
.- Overrides:
getResultDomain
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
CalculatorPlugin.MOLECULE
- See Also:
-
getResultCount
Returns the number of result items for the given result key. logD returns1
.- 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 type and index. logD returns the main or reference(pH, logD)
arrays as adouble[2][]
with the 0-th element being thepH
array and the 1-st element being thelogD
array.- Overrides:
getResult
in classCalculatorPlugin
- 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:
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.Returns the result item for the specified pH.- Overrides:
getResult
in classCalculatorPlugin
- Parameters:
type
- is the result type (not used)arg
- is the pH as string- Returns:
- the result item for the specified pH
- Throws:
PluginException
- if the result cannot be returned- See Also:
-
getResultAsString
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 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
-
getImageMolecule
Returns the molecule to be used for legend image.- Returns:
- the image molecule
- Throws:
PluginException
- on error
-
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. Does AROM_BASIC aromatization.- Overrides:
standardize
in classCalculatorPlugin
- Parameters:
mol
- is the molecule to be standardized
-