|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.TautomerizationPlugin
public class TautomerizationPlugin
Plugin class for generating tautomer structures.
API usage example:
// read input molecule
MolImporter mi = new MolImporter("test.mol");
Molecule mol = mi.read();
mi.close();
// 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.
| Field Summary |
|---|
| Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin |
|---|
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, licenseEnvironment, MOLECULE, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED |
| Constructor Summary | |
|---|---|
TautomerizationPlugin()
Constructor. |
|
| Method Summary | |
|---|---|
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. Use createStandardizedMolecule(Molecule) instead |
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. |
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()
Returns tautomers in Molecule[] array.. |
boolean |
handlesMultiFragmentMolecules()
Returns true if the plugin handles multifragment molecules,
false otherwise. |
boolean |
isMultiThreadedRunEnabled()
For internal use only. |
boolean |
run()
Calculates the tautomers. |
void |
setCleanResultStructures(boolean clean)
Sets 2D cleaning of the result structures: if true then tautomers returned
by getStructure(int) and getStructures() methods are cleaned in 2D. |
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 |
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 |
setProtectAromacity(boolean pa)
Deprecated. Use setProtectAromaticity(boolean) |
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 |
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 |
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 |
setTakeMostStableTautomer(boolean mostStable)
Sets whether most stable tautomer should be generated. |
void |
standardize(Molecule mol)
Standardizes the molecule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TautomerizationPlugin()
| Method Detail |
|---|
public java.lang.String getProductName()
CalculatorPluginLicenseManager.
The name is used by the CalculatorPlugin.isLicensed() method.
getProductName in class CalculatorPluginpublic 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 CalculatorPluginpublic void setProgressMonitor(MProgressMonitor pmon)
run() to display progress status.
Short calculations may ignore the observer object.
The default implementation does nothing.
setProgressMonitor in class CalculatorPluginpmon - 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 CalculatorPluginparams - is the parameter table
PluginException - on errorpublic void setCleanResultStructures(boolean clean)
true then tautomers returned
by getStructure(int) and getStructures() methods are cleaned in 2D.
Default: false.
clean - if true then result structures are cleaned in 2Dpublic 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)
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 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.
Default: true.
pa - is true if aromaticity should be protectedpublic void setProtectAromacity(boolean pa)
setProtectAromaticity(boolean)
true then aromatic bonds are not modified by the tautomer
generator.
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.
Default: true.
pc - is true if charges should be protectedpublic void setExcludeAntiAromaticCompounds(boolean aa)
true then antiaromatic compounds are not
generated.
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.
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.
Default: false.
protect - is true if labeled tetrahedral stereo centers should be protected by the tautomer
generatorpublic void setInputMoleculeModified(boolean inputMoleculeModified)
false.
inputMoleculeModified - is true if input molecule should be
modified, false if it should be preserved
public void checkMolecule(Molecule mol)
throws PluginException
checkMolecule in class CalculatorPluginmol - is the input molecule
PluginException - with error message for the user if the molecule is refused
protected Molecule createStandardizedMolecule(Molecule mol,
boolean om)
throws PluginException
createStandardizedMolecule(Molecule) instead
createStandardizedMolecule in class CalculatorPluginmol - 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 indexing
PluginException - on error#see #is InputMoleculeModified()
protected Molecule createStandardizedMolecule(Molecule mol)
throws PluginException
createStandardizedMolecule in class CalculatorPluginmol - is the input molecule
PluginException - on error#see #is InputMoleculeModified()
protected void setInputMolecule(Molecule mol)
throws PluginException
setInputMolecule in class CalculatorPluginmol - is the input molecule
PluginException - on errorpublic void setTakeCanonicalForm(boolean canonical)
false.
canonical - is true if canonical form should be generatedgetStructure(int),
getStructures(),
getStructureCount(),
setSymmetryFiltering(boolean)public void setTakeGenericTautomer(boolean generic)
false.
generic - is true if generic tautomer should be generatedgetStructure(int),
getStructures(),
getStructureCount(),
setpH(double)public void setTakeMostStableTautomer(boolean mostStable)
false.
mostStable - is true if most stable 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 CalculatorPluginPluginException - 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 index
setDominantTautomerDistributionCalculation(boolean),
getStructure(int)
public chemaxon.marvin.plugin.PluginMDocSource getResultSource()
throws PluginException
getResultSource in class CalculatorPluginPluginException - on errorpublic int getStructureCount()
setTakeCanonicalForm(boolean),
setTakeDominantTautomers(boolean)public Molecule getStructure(int index)
index - is the structure index
setTakeCanonicalForm(boolean),
setTakeGenericTautomer(boolean),
setTakeMostStableTautomer(boolean),
setTakeDominantTautomers(boolean),
setDominantTautomerDistributionCalculation(boolean)public Molecule[] getStructures()
Molecule[] array..
setTakeCanonicalForm(boolean),
setTakeDominantTautomers(boolean)public java.lang.Object[] getResultTypes()
getResultTypes in class CalculatorPluginpublic int getResultDomain(java.lang.Object type)
getResultDomain in class CalculatorPlugintype - is the result type
getResultTypes()public int getResultCount(java.lang.Object type)
getResultCount in class CalculatorPlugintype - is the result type
getResultTypes()
public java.lang.Object getResult(java.lang.Object type,
int index)
throws PluginException
getResult in class CalculatorPlugintype - is the result typeindex - is the result index
PluginException - 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 CalculatorPlugintype - is the result typeindex - is the result indexresult - is the result item
PluginException - if an invalid result item is givenpublic java.lang.String getRemark()
null otherwise.
getRemark in class CalculatorPluginpublic java.lang.String getErrorMessage()
getErrorMessage in class CalculatorPluginpublic void standardize(Molecule mol)
standardize in class CalculatorPluginmol - is the molecule to be standardizedpublic boolean isMultiThreadedRunEnabled()
isMultiThreadedRunEnabled in class CalculatorPlugintrue if multi-threaded run is enabled
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||