@PublicAPI public class TautomerizationPlugin extends CalculatorPlugin
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); // create plugin TautomerizationPlugin plugin = new TautomerizationPlugin(); // set dominant tautomer distribution calculation plugin.setDominantTautomerDistributionCalculation(true); // set pH (consider pH effect at this pH; only has effect when dominant tautomers are generated) plugin.setpH(7.4); // set the input molecule plugin.setMolecule(mol); // run the calculation plugin.run(); // get the dominant tautomers System.out.println("Dominant tautomer distribution"); int count = plugin.getStructureCount(); for (int i=0; i < count; ++i) { Molecule tautomer = plugin.getStructure(i); double distribution = plugin.getDominantTautomerDistribution(i); System.out.println(tautomer.toFormat("smiles") + " " + distribution); }
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
CalculatorPlugin.HydrogenData
Modifier and Type | Field and Description |
---|---|
static boolean |
warningMsgOn |
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 and Description |
---|
TautomerizationPlugin()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkMolecule(Molecule mol)
Checks the input molecule.
|
protected Molecule |
createStandardizedMolecule(Molecule mol)
Creates standardized molecule, the original input molecule is cloned
only if the original molecule should not be modified.
|
protected Molecule |
createStandardizedMolecule(Molecule mol,
boolean om)
Deprecated.
|
int[] |
getChangedAtomIndexes()
Returns the indexes of the atoms changed during tautomerization.
|
double |
getDominantTautomerDistribution(int index)
Returns the distribution of the dominant tautomer.
|
java.lang.String |
getErrorMessage()
Returns the calculation error information message
or the empty string if there is no error.
|
protected java.util.List<CalculatorPlugin.HydrogenData> |
getExplicitHydrogenData(Molecule cmol,
int n) |
int[] |
getNewOldIndexMap() |
int[] |
getOldNewIndexMap() |
java.lang.String |
getProductName()
Returns the product identifier of the plugin as given by
LicenseManager . |
java.lang.String |
getRemark()
Returns a warning message if there are no tautomers,
null otherwise. |
java.lang.Object |
getResult(java.lang.Object type,
int index)
Returns the result item for the specified key and index.
|
java.lang.String |
getResultAsString(java.lang.Object type,
int index,
java.lang.Object result)
Returns the specified result in String format.
|
int |
getResultCount(java.lang.Object type)
Returns the number of result items for the given result key.
|
int |
getResultDomain(java.lang.Object type)
Returns the calculation domain.
|
chemaxon.marvin.plugin.PluginMDocSource |
getResultSource()
Returns the result as a document source object.
|
java.lang.Object[] |
getResultTypes()
Returns the result types.
|
Molecule |
getStructure(int index)
Returns a tautomer.
|
int |
getStructureCount()
Returns the number of different tautomers.
|
Molecule[] |
getStructures()
Deprecated.
since Marvin 5.9 replaced by
getStructure(int) |
protected java.lang.String |
getTitle()
Returns the frame title.
|
java.lang.String |
getWarningMessage()
Returns the calculation warning information message.
|
boolean |
handlesMultiFragmentMolecules()
Returns
true if the plugin handles multifragment molecules,
false otherwise. |
static boolean |
hasTautomers(Molecule mol)
Returns if a molecule has tautomers.
|
boolean |
isMultiThreadedRunEnabled()
For internal use only.
|
boolean |
run()
Calculates the tautomers.
|
void |
setCleanResultStructures(boolean clean)
Deprecated.
obsolate method
|
void |
setDominantTautomerDistributionCalculation(boolean distrib)
Sets dominant tautomer distribution calculation: if
true then dominant tautomer
distribution is calculated. |
void |
setExcludeAntiAromaticCompounds(boolean aa)
Sets whether antiaromatic compounds should be generated.
|
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule.
|
void |
setInputMoleculeModified(boolean inputMoleculeModified)
Deprecated.
Not used.
|
void |
setMaximumTautomerizationPathLength(int length)
Sets the maximum allowed length of the tautomerization path in chemical bonds.
|
void |
setMaxStructureCount(int max)
Sets the maximum number of structures to be generated.
|
void |
setNormalTautomerGenerationMode(boolean normal)
Generates only normal tautomers.
|
void |
setParameters(java.util.Properties params)
Sets the input parameters for the plugin.
|
void |
setpH(double pH)
Sets the pH to be considered in dominant tautomer generation.
|
void |
setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used in
run() to display progress status. |
void |
setProtectAllTetrahedralStereoCenters(boolean protect)
Sets the protection of all tetrahedral stereo centers: if
true then all tetrahedral stereo
information is preserved by the tautomer generator. |
void |
setProtectAromaticity(boolean pa)
Sets aromaticity protection: if
true then aromatic bonds are not modified by the tautomer
generator. |
void |
setProtectCharge(boolean pc)
Sets charge protection: if
true then the charge of charged atoms are not modified by the tautomer
generator. |
void |
setProtectDoubleBondStereo(boolean protect)
Sets double bond stereo protection: if
true then double bonds stereo information is preserved by
the tautomer generator. |
void |
setProtectEsterGroups(boolean protect)
Sets the protection of ester groups: if
true then ester groups are excluded from the tautomerization. |
void |
setProtectLabeledTetrahedralStereoCenters(boolean protect)
Sets the protection of labeled tetrahedral stereo centers: if
true then labeled tetrahedral stereo
centers are protected by the tautomer generator. |
void |
setRationalTautomerGenerationMode(boolean rational)
Deprecated.
|
void |
setRingChainTautomerizationAllowed(boolean allowed)
Sets if ring tautomers are allowed or not.
Default true |
void |
setSymmetryFiltering(boolean filtering)
Sets symmetry fitlering: if
true then symmetrical structures
are filtered out, otherwise symmetrical structures are returned as duplicates. |
void |
setTakeCanonicalForm(boolean canonical)
Sets whether canonical form should be generated.
|
void |
setTakeDominantTautomers(boolean dominants)
Sets whether dominant tautomers should be generated.
|
void |
setTakeGenericTautomer(boolean generic)
Sets whether generic tautomer should be generated.
|
void |
setTakeMajorTautomer(boolean major)
Sets whether major tautomer should be generated.
|
void |
setTakeMostStableTautomer(boolean mostStable)
Deprecated.
Not used.
|
void |
setTakePartialNeutralization(boolean pn)
Sets if partial neutralization prior to canonical tauotmer generation is allowed or not.
|
void |
setTakeStandardForm(boolean s)
For internal use only.
|
void |
setTimeLimit(double t)
Sets an upper time limit for the canonical tautomer generation.
|
void |
setWigglyBondVisibility(boolean vis)
Sets how wiggly bonds connected to double bonds are displayed.
For internal use only. |
void |
standardize(Molecule mol)
Standardizes the molecule.
|
arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecule, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getTypeString, isInputMoleculeAromatized, isLicensed, isMsCalc, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups, standardizeNeutralGroups
public TautomerizationPlugin()
public java.lang.String getProductName()
LicenseManager
.getProductName
in class CalculatorPlugin
LicenseManager.ISOMERS_PLUGIN_GROUP
public static boolean hasTautomers(Molecule mol)
mol
- the moleculetrue
if molecule has tautomerspublic boolean handlesMultiFragmentMolecules()
true
if the plugin handles multifragment molecules,
false
otherwise. In the latter case the plugin takes the
fragment with more atoms if a multifragment molecule is given as input.
Returns true
if parameter "single" is set to "false",
false
otherwise (default: false
).handlesMultiFragmentMolecules
in class CalculatorPlugin
public void setProgressMonitor(MProgressMonitor pmon)
run()
to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.setProgressMonitor
in class CalculatorPlugin
pmon
- is the progress monitor, may be null
public void setParameters(java.util.Properties params) throws PluginException
Double.NaN
- do not consider pH effect)
setParameters
in class CalculatorPlugin
params
- is the parameter tablePluginException
- on error@Deprecated public void setCleanResultStructures(boolean clean)
true
then the changed atoms in
tautomers returned by getStructure(int)
are partial cleaned in 2D.
Should be called before setting input molecule.
Default: false
.clean
- if true
then result structures are cleaned in 2Dpublic int[] getChangedAtomIndexes()
run()
. Returns null
if none of the atoms has changed.
For internal use only.public void setSymmetryFiltering(boolean filtering)
true
then symmetrical structures
are filtered out, otherwise symmetrical structures are returned as duplicates.
Symmetry filtering is always performed when canonical tautomer form is taken,
regardless of the actual setting of the filtering
parameter.
Default: true
.filtering
- is true
if symmetrical structures should be filtered outsetTakeCanonicalForm(boolean)
public void setMaxStructureCount(int max)
getStructure(int)
returns only the unique tautomers,
getStructureCount()
returns unique tautormer count.
Default: 1000
.max
- is the maximum number of structures to be generatedpublic void setpH(double pH)
Double.NaN
).pH
- is the pH valuesetTakeDominantTautomers(boolean)
public void setTimeLimit(double t)
Double.NaN
).t
- is the maximum allowed calculation time/molecule. It should be given in second.setTakeCanonicalForm(boolean)
public void setMaximumTautomerizationPathLength(int length)
length = 0
is set then no limit is applied.
Default: 4
.length
- is the maximum allowed tautomerization path lengthpublic void setProtectAromaticity(boolean pa)
true
then aromatic bonds are not modified by the tautomer
generator. Has no effect in case of generic tautomer.
Default: true
.pa
- is true
if aromaticity should be protectedpublic void setProtectCharge(boolean pc)
true
then the charge of charged atoms are not modified by the tautomer
generator. Has no effect in case of generic tautomer.
Default: true
.pc
- is true
if charges should be protectedpublic void setExcludeAntiAromaticCompounds(boolean aa)
true
then antiaromatic compounds are not
generated. Has no effect in case of generic tautomer.
Default: true
.aa
- is true
if antiaromatic compounds should not be generatedpublic void setProtectDoubleBondStereo(boolean protect)
true
then double bonds stereo information is preserved by
the tautomer generator. Has no effect in case of generic tautomer.
Default: false
.protect
- is true
if double bond stereo information should be protected by the tautomer
generatorpublic void setProtectAllTetrahedralStereoCenters(boolean protect)
true
then all tetrahedral stereo
information is preserved by the tautomer generator.
Default: false
.protect
- is true
if all tetrahedral stereo information should be preserved by the tautomer
generatorpublic void setProtectLabeledTetrahedralStereoCenters(boolean protect)
true
then labeled tetrahedral stereo
centers are protected by the tautomer generator. Has no effect in case of generic tautomer.
Default: false
.protect
- is true
if labeled tetrahedral stereo centers should be protected by the tautomer
generatorpublic void setProtectEsterGroups(boolean protect)
true
then ester groups are excluded from the tautomerization.
Default: true
. Has no effect in case of generic tautomer.protect
- is true
if ester groups should be excluded from the tautomerizationpublic void setRingChainTautomerizationAllowed(boolean allowed)
true
allowed
- @Deprecated public void setInputMoleculeModified(boolean inputMoleculeModified)
false
.inputMoleculeModified
- is true
if input molecule should be
modified, false
if it should be preservedpublic void checkMolecule(Molecule mol) throws PluginException
checkMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- with error message for the user if the molecule is refused@Deprecated protected Molecule createStandardizedMolecule(Molecule mol, boolean om) throws PluginException
createStandardizedMolecule
in class CalculatorPlugin
mol
- is the input moleculeom
- is true if original input molecule is to be used for atom indexing
false if modified molecule is to be used for atom indexingPluginException
- on error#see #is InputMoleculeModified()
protected Molecule createStandardizedMolecule(Molecule mol) throws PluginException
createStandardizedMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- on error#see #is InputMoleculeModified()
protected java.util.List<CalculatorPlugin.HydrogenData> getExplicitHydrogenData(Molecule cmol, int n)
getExplicitHydrogenData
in class CalculatorPlugin
protected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- on errorpublic void setTakePartialNeutralization(boolean pn)
pn
- if true
then partial neutralization is allowedpublic void setWigglyBondVisibility(boolean vis)
vis
- if true
then wiggly bonds connected to double bonds are show as wiggly bonds,
if false
then wiggly bonds connected to double bonds are show as single bondspublic void setTakeCanonicalForm(boolean canonical)
false
.canonical
- is true
if canonical form should be generatedgetStructure(int)
,
getStructures()
,
getStructureCount()
,
setSymmetryFiltering(boolean)
public void setTakeStandardForm(boolean s)
public void setNormalTautomerGenerationMode(boolean normal)
normal
- @Deprecated public void setRationalTautomerGenerationMode(boolean rational)
setNormalTautomerGenerationMode(boolean)
insteadpublic void setTakeGenericTautomer(boolean generic)
false
.generic
- is true
if generic tautomer should be generatedgetStructure(int)
,
getStructures()
,
getStructureCount()
,
setProtectAllTetrahedralStereoCenters(boolean)
@Deprecated public void setTakeMostStableTautomer(boolean mostStable)
false
.mostStable
- is true
if most stable tautomer should be generatedgetStructure(int)
,
getStructures()
,
getStructureCount()
,
setpH(double)
public void setTakeMajorTautomer(boolean major)
false
.major
- is true
if major tautomer should be generatedgetStructure(int)
,
getStructures()
,
getStructureCount()
,
setpH(double)
public void setTakeDominantTautomers(boolean dominants)
false
.dominants
- is true
if dominant structures should be generatedgetStructure(int)
,
getStructures()
,
getStructureCount()
,
setpH(double)
public void setDominantTautomerDistributionCalculation(boolean distrib)
true
then dominant tautomer
distribution is calculated. Use getStructure(int)
to get the dominant tautomer structure and
getDominantTautomerDistribution(int)
to get its distribution.distrib
- if true
then dominant tautomer distribution calculation is performedgetDominantTautomerDistribution(int)
,
getStructure(int)
,
getStructures()
,
getStructureCount()
,
setpH(double)
public boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public double getDominantTautomerDistribution(int index)
index = 0
) is the major
tautomer with largest distribution, followed by other dominant tautomers
in descending distribution order. Use getStructure(int)
to get the
dominant tautomer structure.index
- is the dominant tautomer indexsetDominantTautomerDistributionCalculation(boolean)
,
getStructure(int)
public int[] getNewOldIndexMap()
public int[] getOldNewIndexMap()
public chemaxon.marvin.plugin.PluginMDocSource getResultSource() throws PluginException
getResultSource
in class CalculatorPlugin
PluginException
- on errorpublic int getStructureCount()
setTakeCanonicalForm(boolean)
,
setTakeDominantTautomers(boolean)
public Molecule getStructure(int index)
index
- is the structure indexsetTakeCanonicalForm(boolean)
,
setTakeGenericTautomer(boolean)
,
setTakeMajorTautomer(boolean)
,
setTakeDominantTautomers(boolean)
,
setDominantTautomerDistributionCalculation(boolean)
@Deprecated public Molecule[] getStructures()
getStructure(int)
Molecule[]
array..setTakeCanonicalForm(boolean)
,
setTakeDominantTautomers(boolean)
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public int getResultDomain(java.lang.Object type)
getResultDomain
in class CalculatorPlugin
type
- is the result typegetResultTypes()
public int getResultCount(java.lang.Object type)
getResultCount
in class CalculatorPlugin
type
- is the result typegetResultTypes()
public java.lang.Object getResult(java.lang.Object type, int index) throws PluginException
getResult
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexPluginException
- if the result cannot be returnedCalculatorPlugin.getResultTypes()
public java.lang.String getResultAsString(java.lang.Object type, int index, java.lang.Object result) throws PluginException
getResultAsString
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexresult
- is the result itemPluginException
- if an invalid result item is givenpublic java.lang.String getRemark()
null
otherwise.getRemark
in class CalculatorPlugin
public java.lang.String getErrorMessage()
getErrorMessage
in class CalculatorPlugin
protected java.lang.String getTitle()
public void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- is the molecule to be standardizedpublic boolean isMultiThreadedRunEnabled()
isMultiThreadedRunEnabled
in class CalculatorPlugin
true
if multi-threaded run is enabledpublic java.lang.String getWarningMessage()
CalculatorPlugin
getWarningMessage
in class CalculatorPlugin