Package chemaxon.marvin.calculations
Class ConformerPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.ConformerPlugin
- All Implemented Interfaces:
TaggedCalculator,chemaxon.license.Licensable
Plugin class for conformer calculation. Data types:
- "structure"
- "structures"
- "count"
- "hasvalidconformer"
API usage example:
try (MolImporter mi = new MolImporter("test.mol")) {
// read input molecule
Molecule mol = mi.read();
// 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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMolecule(Molecule mol) Checks the input molecule.getConformer(int index) Returns a conformer.intReturns the number of different conformers.Molecule[]Returns all conformers in a Molecule[] array.getConformerWithConformerInfoProperty(int index) Deprecated.Only intended for internal use.doubleReturns the energy of the lowest energy conformer in kcal/mol.doublegetEnergy(int i) Returns the energy of the i-th conformer in kcal/mol.Returns the calculated lowest energy conformer.Returns the product identifier of the plugin as given byLicenseManager.Returns the result item for the specified key 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 domain.Returns the result as a document source object.Object[]Returns the result types.getTypeString(Object type) Returns a string representation of the given type.Returns a warning message if there are no conformers,nullotherwise.booleanReturnstrueif the plugin handles multifragment molecules,falseotherwise.booleanReturns true if the input molecule has a valid conformer (has a valid structure in 3D space).booleanrun()Runs the conformer calculation.voidsetDiversity(double limit) Sets the diversity limit for the calculation.voidsetHyperfine(boolean hyp) Sets the hyperfine option for calculation.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetLowestEnergyConformerCalculation(boolean le) Switchs the lowest energy conformer calculation on/off.voidsetMaxNumberOfConformers(int n) Sets the maximum number of conformers to be calculated.voidsetMMFF94(boolean mmff) Sets the forcefield to MMFF94.voidsetOptimization(int optimization) Sets the optimization criteria for the calculation.voidsetParameters(Properties params) Sets the input parameters for the plugin.voidsetPrehydrogenize(boolean preH) Turns the prehydrogenization on/off.voidSets a progress observer to be used inrun()to display progress status.voidsetTimelimit(int sec) Sets the timelimit for the calculation.voidstandardize(Molecule mol) Expands sgroups.tags()Returns the set of tags reported by this calculator.Methods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, canRepeat, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, 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, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsArgument, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, standardizeIonicGroups
-
Field Details
-
OPTIMIZATION_VERY_LOOSE
public static final int OPTIMIZATION_VERY_LOOSE- See Also:
-
OPTIMIZATION_NORMAL
public static final int OPTIMIZATION_NORMAL- See Also:
-
OPTIMIZATION_STRICT
public static final int OPTIMIZATION_STRICT- See Also:
-
OPTIMIZATION_VERY_STRICT
public static final int OPTIMIZATION_VERY_STRICT- See Also:
-
-
Constructor Details
-
ConformerPlugin
public ConformerPlugin()
-
-
Method Details
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager.- Specified by:
getProductNamein classCalculatorPlugin- Returns:
- The identifier
LicenseManager.CONFORMATION_PLUGIN_GROUP
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()Returnstrueif the plugin handles multifragment molecules,falseotherwise. In the latter case the plugin takes the fragment with more atoms if a multifragment molecule is given as input.- Overrides:
handlesMultiFragmentMoleculesin classCalculatorPlugin- Returns:
- true if the plugin handles multifragment molecules, false otherwise
-
setProgressMonitor
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:
setProgressMonitorin classCalculatorPlugin- Parameters:
pmon- is the progress observer object, may benull
-
setParameters
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:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
PluginException- on error
-
checkMolecule
Checks the input molecule. Throws exception if the molecule isRxnMoleculeor if the molecule contains R-groups.- Overrides:
checkMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
PluginException- with error message for the user if the molecule is refused
-
setInputMolecule
Sets the input molecule.- Specified by:
setInputMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
PluginException- on error
-
run
Runs the conformer calculation.- Specified by:
runin classCalculatorPlugin- Returns:
- true if the calculation was successful, false if unsuccessful
- Throws:
PluginException- on error- See Also:
-
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:
-
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
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
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
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:
-
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:
-
getResultSource
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:
getResultSourcein 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
Returns a conformer.- Parameters:
index- is the conformer index- Returns:
- the conformer
-
getConformerWithConformerInfoProperty
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
Returns all conformers in a Molecule[] array.- Returns:
- all conformers
-
getResultTypes
Returns the result types.- Overrides:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
getTypeString
Returns a string representation of the given type.- Overrides:
getTypeStringin classCalculatorPlugin- Parameters:
type- is the type object- Returns:
- the type string
-
getResultDomain
Returns the calculation domain.- Overrides:
getResultDomainin classCalculatorPlugin- Parameters:
type- is the result type- Returns:
- the calculation domain
- See Also:
-
getResultCount
Returns the number of result items for the given result key.- 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 key and index.- Overrides:
getResultin 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:
-
getResultAsString
Returns the specified result in String format.- 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:
PluginException- if an invalid result item is given
-
getWarningMessage
Returns a warning message if there are no conformers,nullotherwise.- Overrides:
getWarningMessagein classCalculatorPlugin- Returns:
- a warning message if conformercalculation aborted
-
standardize
Expands sgroups.- Overrides:
standardizein classCalculatorPlugin- Parameters:
mol- is the molecule to be standardized
-
tags
Description copied from interface:TaggedCalculatorReturns the set of tags reported by this calculator. The same tags should be returned unless the calculator is modified using a mutator method, e.g. if some settings are changed.New tags can be introduced and reported in the future by existing calculators, so do not depend on the exact set of reported tags, only check for the presence of certain tags.
- Returns:
- the tags
-