|
|||||||||
| 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.ResonancePlugin
public class ResonancePlugin
Plugin class for finding resonant structures.
API usage example:
// read input molecule
MolImporter mi = new MolImporter("test.mol");
Molecule mol = mi.read();
mi.close();
// create plugin
ResonancePlugin plugin = new ResonancePlugin();
// set target molecule
plugin.setMolecule(mol);
// run the calculation
plugin.run();
// get the resonant structures
System.out.println("Resonant structures");
int count = plugin.getStructureCount();
for (int i=0; i < count; ++i) {
Molecule structure = plugin.getStructure(i);
System.out.println(structure.toFormat("smiles"));
}
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 | |
|---|---|
ResonancePlugin()
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 |
java.lang.String |
getErrorMessage()
Returns the calculation error information message or the empty string if there is no error. |
java.lang.String |
getRemark()
Returns a warning message if there are no resonants, 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 resonant structure. |
int |
getStructureCount()
Returns the number of different resonant structures. |
Molecule[] |
getStructures()
Returns resonant structures in Molecule[] array. |
boolean |
handlesMultiFragmentMolecules()
Returns true if the plugin handles multifragment molecules,
false otherwise. |
boolean |
isLicensed()
Returns true if the plugin is licensed. |
boolean |
isMultiThreadedRunEnabled()
For internal use only. |
boolean |
run()
Calculates the resonant structures. |
protected void |
setInputMolecule(Molecule mol)
Sets the input molecule. |
void |
setInputMoleculeModified(boolean inputMoleculeModified)
Deprecated. Not used. |
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)
Deprecated. As of Marvin 5.0 pH effect is not considered |
void |
setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used in run() to display progress status. |
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 taken. |
void |
setTakeMajorContributors(boolean mcontrib)
Sets whether major contributors should be taken. |
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 ResonancePlugin()
| Method Detail |
|---|
public boolean isLicensed()
CalculatorPlugintrue if the plugin is licensed. Implement this only if you want to sell your plugin and
protect it with a license key. The default implementation always returns true which means that
the plugin is free: no license key is required. This method returns only information about the licensing,
license checking has to be implemented separately.
isLicensed in interface chemaxon.license.LicensableisLicensed in class CalculatorPlugintrue if the plugin is licensedpublic 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 setSymmetryFiltering(boolean filtering)
true then symmetrical structures
are filtered out, otherwise symmetrical structures are returned as duplicates.
Default: true.
filtering - is true if symmetrical structures should be filtered outpublic 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 valuepublic 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 takengetStructure(int),
getStructures(),
getStructureCount()public void setTakeMajorContributors(boolean mcontrib)
true.
mcontrib - is true if major contributors should be takengetStructure(int),
getStructures(),
getStructureCount()
public boolean run()
throws PluginException
run in class CalculatorPluginPluginException - on errorCalculatorPlugin.getErrorMessage()
public chemaxon.marvin.plugin.PluginMDocSource getResultSource()
throws PluginException
getResultSource in class CalculatorPluginPluginException - on errorpublic int getStructureCount()
setTakeCanonicalForm(boolean),
setTakeMajorContributors(boolean)public Molecule getStructure(int index)
index - is the structure index
setTakeCanonicalForm(boolean),
setTakeMajorContributors(boolean)public Molecule[] getStructures()
Molecule[] array.
setTakeCanonicalForm(boolean),
setTakeMajorContributors(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 | ||||||||