Package chemaxon.marvin.calculations
Class ConformerPlugin
- java.lang.Object
-
- chemaxon.marvin.plugin.CalculatorPlugin
-
- chemaxon.marvin.calculations.ConformerPlugin
-
- All Implemented Interfaces:
chemaxon.license.Licensable
@PublicAPI public class ConformerPlugin extends CalculatorPlugin
Plugin class for conformer calculation. Data types:- "structure"
- "structures"
- "count"
- "hasvalidconformer"
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // create plugin ConformerPlugin plugin = new ConformerPlugin(); // set target molecule plugin.setMolecule(mol); // set parameters for calculation plugin.setMaxNumberOfConformers(400); plugin.setTimelimit(900); // run the calculation plugin.run(); // get results Molecule[] conformers = plugin.getConformers(); int conformerCount = plugin.getConformerCount(); Molecule m; for (int i = 0; i < conformerCount; ++i) { m = conformers[i]; // same as m = plugin.getConformer(i); // do something with molecule ... } // do something with the results ...
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
- Since:
- Marvin 4.1, 02/07/2006
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData
-
-
Field Summary
Fields Modifier and Type Field Description static int
OPTIMIZATION_NORMAL
static int
OPTIMIZATION_STRICT
static int
OPTIMIZATION_VERY_LOOSE
static int
OPTIMIZATION_VERY_STRICT
-
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
Constructors Constructor Description ConformerPlugin()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
checkMolecule(Molecule mol)
Checks the input molecule.Molecule
getConformer(int index)
Returns a conformer.int
getConformerCount()
Returns the number of different conformers.Molecule[]
getConformers()
Returns all conformers in a Molecule[] array.Molecule
getConformerWithConformerInfoProperty(int index)
Deprecated.Only intended for internal use.double
getEnergy()
Returns the energy of the lowest energy conformer in kcal/mol.double
getEnergy(int i)
Returns the energy of the i-th conformer in kcal/mol.Molecule
getLowestEnergyConformer()
Returns the calculated lowest energy conformer.String
getProductName()
Returns the product identifier of the plugin as given byLicenseManager
.Object
getResult(Object type, int index)
Returns the result item for the specified key and index.String
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 domain.chemaxon.marvin.plugin.PluginMDocSource
getResultSource()
Returns the result as a document source object.Object[]
getResultTypes()
Returns the result types.String
getTypeString(Object type)
Returns a string representation of the given type.String
getWarningMessage()
Returns a warning message if there are no conformers,null
otherwise.boolean
handlesMultiFragmentMolecules()
Returnstrue
if the plugin handles multifragment molecules,false
otherwise.boolean
hasValidConformer()
Returns true if the input molecule has a valid conformer (has a valid structure in 3D space).boolean
run()
Runs the conformer calculation.void
setDiversity(double limit)
Sets the diversity limit for the calculation.void
setHyperfine(boolean hyp)
Sets the hyperfine option for calculation.protected void
setInputMolecule(Molecule mol)
Sets the input molecule.void
setLowestEnergyConformerCalculation(boolean le)
Switchs the lowest energy conformer calculation on/off.void
setMaxNumberOfConformers(int n)
Sets the maximum number of conformers to be calculated.void
setMMFF94(boolean mmff)
Sets the forcefield to MMFF94.void
setOptimization(int optimization)
Sets the optimization criteria for the calculation.void
setParameters(Properties params)
Sets the input parameters for the plugin.void
setPrehydrogenize(boolean preH)
Turns the prehydrogenization on/off.void
setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used inrun()
to display progress status.void
setTimelimit(int sec)
Sets the timelimit for the calculation.void
standardize(Molecule mol)
Expands sgroups.-
Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getErrorMessage, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecule, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups, standardizeNeutralGroups
-
-
-
-
Field Detail
-
OPTIMIZATION_VERY_LOOSE
public static final int OPTIMIZATION_VERY_LOOSE
- See Also:
- Constant Field Values
-
OPTIMIZATION_NORMAL
public static final int OPTIMIZATION_NORMAL
- See Also:
- Constant Field Values
-
OPTIMIZATION_STRICT
public static final int OPTIMIZATION_STRICT
- See Also:
- Constant Field Values
-
OPTIMIZATION_VERY_STRICT
public static final int OPTIMIZATION_VERY_STRICT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProductName
public String getProductName()
Returns the product identifier of the plugin as given byLicenseManager
.- Specified by:
getProductName
in classCalculatorPlugin
- Returns:
- The identifier
LicenseManager.CONFORMATION_PLUGIN_GROUP
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()
Returnstrue
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.- Overrides:
handlesMultiFragmentMolecules
in classCalculatorPlugin
- Returns:
- true if the plugin handles multifragment molecules, false otherwise
-
setProgressMonitor
public void setProgressMonitor(MProgressMonitor pmon)
Sets a progress observer to be used inrun()
to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.- Overrides:
setProgressMonitor
in classCalculatorPlugin
- Parameters:
pmon
- is the progress observer object, may benull
-
setParameters
public void setParameters(Properties params) throws PluginException
Sets the input parameters for the plugin. Parameters and value ranges:- type: structure, structures, count, hasvalidconformer
- optimization: optimization criteria for the calculation (default: 1 (=Normal))
- maxconformers: maximum naumber of conformers to be calculated (default: 100)
- timelimit: timelimit in sec for the calculation (default: 900)
- prehydrogenize: true if prehydrogenize is needed before calculation (default: false)
- Overrides:
setParameters
in classCalculatorPlugin
- Parameters:
params
- is the parameter table- Throws:
PluginException
- on error
-
checkMolecule
public void checkMolecule(Molecule mol) throws PluginException
Checks the input molecule. Throws exception if the molecule isRxnMolecule
or if the molecule contains R-groups.- Overrides:
checkMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- with error message for the user if the molecule is refused
-
setInputMolecule
protected void setInputMolecule(Molecule mol) throws PluginException
Sets the input molecule.- Specified by:
setInputMolecule
in classCalculatorPlugin
- Parameters:
mol
- is the input molecule- Throws:
PluginException
- on error
-
run
public boolean run() throws PluginException
Runs the conformer calculation.- Specified by:
run
in classCalculatorPlugin
- Returns:
- true if the calculation was successful, false if unsuccessful
- Throws:
PluginException
- on error- See Also:
CalculatorPlugin.getErrorMessage()
-
setMMFF94
public void setMMFF94(boolean mmff)
Sets the forcefield to MMFF94.- Parameters:
mmff
- if true, sets MMFF94
-
setLowestEnergyConformerCalculation
public void setLowestEnergyConformerCalculation(boolean le)
Switchs the lowest energy conformer calculation on/off. If true lowest energy conformer calculation is done, if false conformers of the molecule are calculated.- Parameters:
le
- switchs the lowest energy conformer calculation on/off
-
setMaxNumberOfConformers
public void setMaxNumberOfConformers(int n)
Sets the maximum number of conformers to be calculated. The number of calculated conformers is equal or lower then this number, and can be readed with methodgetConformerCount()
.- Parameters:
n
- is the max number of conformers to be calculated- See Also:
getConformerCount()
-
setTimelimit
public void setTimelimit(int sec)
Sets the timelimit for the calculation.- Parameters:
sec
- is the timelimit for the calculation
-
setDiversity
public void setDiversity(double limit)
Sets the diversity limit for the calculation. Diversity limit should be at least 0.1 (no upper limit).- Parameters:
limit
- is the diversity limit for the calculation- Since:
- Marvin 4.1.3
-
setOptimization
public void setOptimization(int optimization) throws PluginException
Sets the optimization criteria for the calculation. Possible optimization values are:- Parameters:
optimization
- is the optimization method for the calculation- Throws:
PluginException
-
setPrehydrogenize
public void setPrehydrogenize(boolean preH)
Turns the prehydrogenization on/off. If true prehydrogenization is done before calculation, if false no prehydrogenization is done before calculation.- Parameters:
preH
- turns the prehydrogenization on/off
-
setHyperfine
public void setHyperfine(boolean hyp)
Sets the hyperfine option for calculation.- Parameters:
hyp
- sets/unsets the hyperfine option for calculation
-
hasValidConformer
public boolean hasValidConformer() throws PluginException
Returns true if the input molecule has a valid conformer (has a valid structure in 3D space). Otherwise returns false.- Returns:
- true if the input molecule has a valid conformer
- Throws:
PluginException
-
getLowestEnergyConformer
public Molecule getLowestEnergyConformer()
Returns the calculated lowest energy conformer.- Returns:
- the lowest energy conformer
-
getEnergy
public double getEnergy()
Returns the energy of the lowest energy conformer in kcal/mol.- Returns:
- the energy of the lowest energy conformer
- Since:
- Marvin 4.1.4 12/04/2006
- See Also:
setLowestEnergyConformerCalculation(boolean)
-
getEnergy
public double getEnergy(int i)
Returns the energy of the i-th conformer in kcal/mol.- Returns:
- the energy of the i-th conformer
- Since:
- Marvin 4.1.4 12/04/2006
- See Also:
getConformerCount()
-
getResultSource
public chemaxon.marvin.plugin.PluginMDocSource getResultSource() throws PluginException
Returns the result as a document source object. This is useful for displaying the molecules in a viewer dynamically as they become available instead of collecting all results before display.- Overrides:
getResultSource
in classCalculatorPlugin
- Returns:
- the document source interface
- Throws:
PluginException
- on error- Since:
- Marvin 5.0
-
getConformerCount
public int getConformerCount()
Returns the number of different conformers.- Returns:
- the number of different conformers
-
getConformer
public Molecule getConformer(int index)
Returns a conformer.- Parameters:
index
- is the conformer index- Returns:
- the conformer
-
getConformerWithConformerInfoProperty
@Deprecated public Molecule getConformerWithConformerInfoProperty(int index)
Deprecated.Only intended for internal use.Returns a conformer with additional information stored as a molecule property. For internal use only.- Parameters:
index
- is the conformer index- Returns:
- the conformer
-
getConformers
public Molecule[] getConformers()
Returns all conformers in a Molecule[] array.- Returns:
- all conformers
-
getResultTypes
public Object[] getResultTypes()
Returns the result types.- Overrides:
getResultTypes
in classCalculatorPlugin
- Returns:
- the result types
-
getTypeString
public String getTypeString(Object type)
Returns a string representation of the given type.- Overrides:
getTypeString
in classCalculatorPlugin
- Parameters:
type
- is the type object- Returns:
- the type string
-
getResultDomain
public int getResultDomain(Object type)
Returns the calculation domain.- Overrides:
getResultDomain
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
- the calculation domain
- See Also:
getResultTypes()
-
getResultCount
public int getResultCount(Object type)
Returns the number of result items for the given result key.- Overrides:
getResultCount
in classCalculatorPlugin
- Parameters:
type
- is the result type- Returns:
- the number of result items
- See Also:
getResultTypes()
-
getResult
public Object getResult(Object type, int index) throws PluginException
Returns the result item for the specified key and index.- Overrides:
getResult
in classCalculatorPlugin
- Parameters:
type
- is the result typeindex
- is the result index- Returns:
- the result item for the specified key and index
- Throws:
PluginException
- if the result cannot be returned- See Also:
CalculatorPlugin.getResultTypes()
-
getResultAsString
public String getResultAsString(Object type, int index, Object result) throws PluginException
Returns the specified result in String format.- 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
-
getWarningMessage
public String getWarningMessage()
Returns a warning message if there are no conformers,null
otherwise.- Overrides:
getWarningMessage
in classCalculatorPlugin
- Returns:
- a warning message if conformercalculation aborted
-
standardize
public void standardize(Molecule mol)
Expands sgroups.- Overrides:
standardize
in classCalculatorPlugin
- Parameters:
mol
- is the molecule to be standardized
-
-