Package chemaxon.calculations
Class LogDPlugin
java.lang.Object
chemaxon.calculations.CalculatorPlugin
chemaxon.calculations.LogDPlugin
- All Implemented Interfaces:
TaggedCalculator,Licensable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.calculations.CalculatorPlugin
CalculatorPlugin.HydrogenData -
Field Summary
Fields inherited from class chemaxon.calculations.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalclogD(double ph) Deprecated, for removal: This API element is subject to removal in a future version.doublecalcLogD(double ph) Returns the logD value at fixed pH.voidcheckMolecule(Molecule mol) Checks the input molecule.Returns the calculation error information message ifrun()returned false (calculation error): hydrogen valence error.doubleDeprecated, for removal: This API element is subject to removal in a future version.doubleReturns the molecule to be used for legend image.doublegetlogD()Deprecated, for removal: This API element is subject to removal in a future version.UsegetLogD()instead.doublegetLogD()Returns the logD value for the pH specified insetPh(double).double[]getlogDs()Deprecated, for removal: This API element is subject to removal in a future version.UsegetLogDValues()instead.double[]Returns the logD array.static String[]Returns the IDs of available logP trainings.double[]getpHs()Deprecated, for removal: This API element is subject to removal in a future version.UsegetPhValues()instead.double[]Returns the pH array.Returns the product identifier of the plugin.double[]Returns the reference logD values.double[]Returns the reference pH values.double[]Deprecated, for removal: This API element is subject to removal in a future version.UsegetReferenceLogDValues()instead.double[]Deprecated, for removal: This API element is subject to removal in a future version.UsegetReferencePhValues()instead.Returns the result item for the specified type and index.getResultAsString(Object type, int index, Object result) Returns the specified result in String format.intgetResultCount(Object type) Returns the number of result items for the given result key.intgetResultDomain(Object type) Returns the calculation domainCalculatorPlugin.ATOMorCalculatorPlugin.MOLECULE.Object[]Returns the result types.Returns the calculation warning message.booleanrun()Runs the logD calculation.protected voidDeprecated.voidsetChlorideIonConcentration(double c) Sets theCl-concentration (default:0.1).voidsetCloridIonConcentration(double c) Deprecated, for removal: This API element is subject to removal in a future version.UsesetChlorideIonConcentration(double)instead.voidsetConsiderHPLCEffect(boolean hplc) Sets to take into account the HPLC effect The default is the shake flask's logDvoidsetConsiderTautomerization(boolean considerTautomerization) Sets to consider tautomerization in calculation.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetlogPMethod(LogPMethod method) Deprecated, for removal: This API element is subject to removal in a future version.UsesetLogPMethod(LogPMethod)instead.voidsetLogPMethod(LogPMethod method) Sets the logP calculation method.voidsetLogPTraining(InputStream inputStream) Sets the user defined logP training from a stream of parameters.voidsetLogPTrainingId(String trainingId) Sets the user defined logP training.voidsetNaKIonConcentration(double c) Sets theNa+, K+concentration (default:0.1).voidsetParameters(Properties params) Sets the input parameters for the plugin.voidsetpH(double ph) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPh(double)instead.voidsetPh(double ph) Sets a single pH value for the logD calculation.voidsetpHLower(double lower) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhLower(double)instead.voidsetPhLower(double lower) Sets pH lower limit (default:0.0).voidsetpHStep(double step) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhStep(double)instead.voidsetPhStep(double step) Sets pH step to be taken between the pH lower and upper limits (default:1.0).voidsetpHUpper(double upper) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPhUpper(double)instead.voidsetPhUpper(double upper) Sets pH upper limit (default:14.0).voidsetpKaCorrectionLibrary(InputStream inputStream) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPkaCorrectionLibrary(InputStream)instead.voidsetpKaCorrectionLibrary(String correctionLibraryId) Deprecated, for removal: This API element is subject to removal in a future version.UsesetPkaCorrectionLibrary(String)instead.voidsetPkaCorrectionLibrary(InputStream inputStream) Sets the pKa correction library from a stream.voidsetPkaCorrectionLibrary(String correctionLibraryId) Sets the pKa correction library.voidstandardize(Molecule mol) Standardizes the molecule.Methods inherited from class chemaxon.calculations.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, createStandardizedMolecule, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getExplicitHydrogenData, getInputMolDim, getOriginalMolecule, getpH, getPh, getQueryMoleculeErrorMessage, getRemark, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecule, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getTypeString, handlesMultiFragmentMolecules, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadPluginClass, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroupsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.calculations.api.TaggedCalculator
tags
-
Constructor Details
-
LogDPlugin
public LogDPlugin()Constructor. Creates the charge calculator object.
-
-
Method Details
-
getProductName
Description copied from class:CalculatorPluginReturns the product identifier of the plugin. For internal use only!- Specified by:
getProductNamein classCalculatorPlugin
-
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:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
CalculatorPluginException- on error
-
setChemicalTermsArgument
Deprecated.Description copied from class:CalculatorPluginSets the argument string as specified in Chemical Terms expressions. This method may only be called fromCalculatorPlugin.setChemicalTermsParameters(Properties, String).- Overrides:
setChemicalTermsArgumentin classCalculatorPlugin- Parameters:
arg- The argument, never null. Its meaning is implementation-dependent.- Throws:
CalculatorPluginException- on error
-
setChlorideIonConcentration
public void setChlorideIonConcentration(double c) Sets theCl-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.UsesetChlorideIonConcentration(double)instead. This method will be removed in a future version.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
-
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.UsesetPhLower(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.UsesetPhUpper(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, for removal: This API element is subject to removal in a future version.UsesetPhStep(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, for removal: This API element is subject to removal in a future version.UsesetPh(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- iftruethe 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
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:
checkMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
CalculatorPluginException- with error message for the user if the molecule is refused
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMoleculein classCalculatorPlugin- Parameters:
mol- is the (standardized) input molecule- Throws:
CalculatorPluginException- on error
-
setLogPMethod
Sets the logP calculation method. SeeLogPMethodfor available methods. The default isLogPMethod.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.UsesetLogPMethod(LogPMethod)instead. This method will be removed in a future version.Sets the logP calculation method. SeeLogPMethodfor available methods. The default isLogPMethod.CONSENSUS.- Parameters:
method- the logP calculation method
-
getLogPTrainingIds
Returns the IDs of available logP trainings.- Returns:
- the IDs of available logP trainings
- Since:
- Marvin 5.4
-
setLogPTrainingId
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
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
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.UsesetPkaCorrectionLibrary(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
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.UsesetPkaCorrectionLibrary(InputStream)instead. This method will be removed in a future version.Sets the pKa correction library from a stream.- Throws:
CalculatorPluginException
-
run
Runs the logD calculation.- Specified by:
runin classCalculatorPlugin- Returns:
- true if the calculation was successful, false on calculation problems
- Throws:
CalculatorPluginException- on error- See Also:
-
getErrorMessage
Returns the calculation error information message ifrun()returned false (calculation error): hydrogen valence error.- Overrides:
getErrorMessagein classCalculatorPlugin- Returns:
- the calculation error information message
-
getWarningMessage
Returns the calculation warning message.- Overrides:
getWarningMessagein 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:
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.UsecalcLogD(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, for removal: This API element is subject to removal in a future version. -
getChargeCategory
-
getResultTypes
Returns the result types. Possible result types: "logD", "reflogD".- Overrides:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
getReferencePhValues
public double[] getReferencePhValues()Returns the reference pH values.- Returns:
- the reference pH array
-
getRefpHs
Deprecated, for removal: This API element is subject to removal in a future version.UsegetReferencePhValues()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, for removal: This API element is subject to removal in a future version.UsegetReferenceLogDValues()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 insetPh(double).- Returns:
- the logD value
-
getlogD
Deprecated, for removal: This API element is subject to removal in a future version.UsegetLogD()instead. This method will be removed in a future version.Returns the logD value for the pH specified insetpH(double).- Returns:
- the logD value
-
getPhValues
public double[] getPhValues()Returns the pH array.- Returns:
- the pH array
-
getpHs
Deprecated, for removal: This API element is subject to removal in a future version.UsegetPhValues()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, for removal: This API element is subject to removal in a future version.UsegetLogDValues()instead. This method will be removed in a future version.Returns the logD array.- Returns:
- the logD array
-
getResultDomain
Returns the calculation domainCalculatorPlugin.ATOMorCalculatorPlugin.MOLECULE. logD returnsCalculatorPlugin.MOLECULE.- Overrides:
getResultDomainin 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:
getResultCountin 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 thepHarray and the 1-st element being thelogDarray.- Overrides:
getResultin 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:
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:
getResultAsStringin classCalculatorPlugin- Parameters:
type- is the result typeindex- is the result indexresult- is the result item- Returns:
- the specified result in String format
- Throws:
CalculatorPluginException- if an invalid result item is given
-
getImageMolecule
Returns the molecule to be used for legend image.- Returns:
- the image molecule
- Throws:
CalculatorPluginException- 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:
standardizein classCalculatorPlugin- Parameters:
mol- is the molecule to be standardized
-
calcLogD(double)instead.