@PublicAPI public class ConformerPlugin extends CalculatorPlugin
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.
CalculatorPlugin.HydrogenData
Modifier and Type | Field and Description |
---|---|
static int |
OPTIMIZATION_NORMAL |
static int |
OPTIMIZATION_STRICT |
static int |
OPTIMIZATION_VERY_LOOSE |
static int |
OPTIMIZATION_VERY_STRICT |
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 |
---|
ConformerPlugin()
Constructor.
|
Modifier and Type | Method and 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.
|
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.
|
java.lang.String |
getProductName()
Returns the product identifier of the plugin as given by
LicenseManager . |
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.
|
java.lang.String |
getTypeString(java.lang.Object type)
Returns a string representation of the given type.
|
java.lang.String |
getWarningMessage()
Returns a warning message if there are no conformers,
null
otherwise. |
boolean |
handlesMultiFragmentMolecules()
Returns
true 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(java.util.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 in
run() to display progress
status. |
void |
setTimelimit(int sec)
Sets the timelimit for the calculation.
|
void |
standardize(Molecule mol)
Expands sgroups.
|
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
public static final int OPTIMIZATION_VERY_LOOSE
public static final int OPTIMIZATION_NORMAL
public static final int OPTIMIZATION_STRICT
public static final int OPTIMIZATION_VERY_STRICT
public java.lang.String getProductName()
LicenseManager
.getProductName
in class CalculatorPlugin
LicenseManager.CONFORMATION_PLUGIN_GROUP
public 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.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 observer object, may be null
public void setParameters(java.util.Properties params) throws PluginException
setParameters
in class CalculatorPlugin
params
- is the parameter tablePluginException
- on errorpublic void checkMolecule(Molecule mol) throws PluginException
RxnMolecule
or if the molecule contains R-groups.checkMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- with error message for the user if the molecule
is refusedprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- on errorpublic boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
- on errorCalculatorPlugin.getErrorMessage()
public void setMMFF94(boolean mmff)
mmff
- if true, sets MMFF94public void setLowestEnergyConformerCalculation(boolean le)
le
- switchs the lowest energy conformer calculation on/offpublic void setMaxNumberOfConformers(int n)
getConformerCount()
.n
- is the max number of conformers to be calculatedgetConformerCount()
public void setTimelimit(int sec)
sec
- is the timelimit for the calculationpublic void setDiversity(double limit)
limit
- is the diversity limit for the calculationpublic void setOptimization(int optimization) throws PluginException
optimization
- is the optimization method for the calculationPluginException
public void setPrehydrogenize(boolean preH)
preH
- turns the prehydrogenization on/offpublic void setHyperfine(boolean hyp)
hyp
- sets/unsets the hyperfine option for calculationpublic boolean hasValidConformer() throws PluginException
PluginException
public Molecule getLowestEnergyConformer()
public double getEnergy()
setLowestEnergyConformerCalculation(boolean)
public double getEnergy(int i)
getConformerCount()
public chemaxon.marvin.plugin.PluginMDocSource getResultSource() throws PluginException
getResultSource
in class CalculatorPlugin
PluginException
- on errorpublic int getConformerCount()
public Molecule getConformer(int index)
index
- is the conformer indexpublic Molecule[] getConformers()
public java.lang.Object[] getResultTypes()
getResultTypes
in class CalculatorPlugin
public java.lang.String getTypeString(java.lang.Object type)
getTypeString
in class CalculatorPlugin
type
- is the type objectpublic 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 getWarningMessage()
null
otherwise.getWarningMessage
in class CalculatorPlugin
public void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- is the molecule to be standardized