Package chemaxon.marvin.calculations
Class MolecularDynamicsPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.MolecularDynamicsPlugin
- All Implemented Interfaces:
TaggedCalculator,chemaxon.license.Licensable
Molecular Dynamics plugin.
API usage example:
// create plugin
MolecularDynamicsPlugin plugin = new MolecularDynamicsPlugin();
// set parameters
plugin.setStepNumber(10000);
plugin.setStepTime(1);
plugin.setSamplingInterval(10);
try (MolImporter mi = new MolImporter("mol.sdf")) {
// read the input molecule
Molecule mol = mi.read();
// set the input molecule
plugin.setMolecule(mol);
// run the calculation
plugin.run();
// get the results
int structureCount = plugin.getStructureCount();
for (int i = 0; i < structureCount; i++) {
Molecule mdMol = plugin.getStructure(i);
// do something with results
}
}
For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.
- Since:
- Marvin 4.1, 05/11/2006
-
Nested Class Summary
Nested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData -
Field Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMolecule(Molecule mol) Checks the input molecule.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.getStructure(int index) Returns a structure.intReturns the number of different structures.Molecule[]Returns all structures.booleanReturnstrueif the plugin handles multifragment molecules,falseotherwise.booleanrun()Runs the tool.voidsetCenterMolecule(boolean centerMolecule) Center the molecule before MD calculation (It is not set by default.)voidsetForceField(String forcefield) Sets the force field type.voidsetInitialTemperature(double temperature) Sets the initial temperature.protected voidsetInputMolecule(Molecule mol) Sets the input molecule.voidsetIntegrator(String integrator) Sets the integrator used for calculations.voidsetParameters(Properties params) Sets the input parameters for the plugin.voidSets a progress observer to be used inrun()to display progress status.voidsetSamplingInterval(double sampinterval) Number of trajectory frames to be stored from the sampling start time to the end of calculation.voidsetSamplingStart(double sampstart) Sets the beginning of trajectory sampling.voidsetStepNumber(int stepno) Sets the number of simulation steps.voidsetStepTime(double timestep) Sets the simulation timestep.voidstandardize(Molecule mol) Expands sgroups.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, getTypeString, getWarningMessage, 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, standardizeIonicGroupsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.calculator.TaggedCalculator
tags
-
Constructor Details
-
MolecularDynamicsPlugin
public MolecularDynamicsPlugin()Creates a new instance of MolecularDynamicsPlugin
-
-
Method Details
-
setForceField
Sets the force field type.- Parameters:
forcefield- force field type possible values: "dreiding", (default: "dreiding")
-
setIntegrator
Sets the integrator used for calculations.- Parameters:
integrator- integrator type possible values: "positionverlet","velocityverlet","leapfrog","projectedvelocityverlet" (default: "velocityverlet")
-
setStepNumber
public void setStepNumber(int stepno) Sets the number of simulation steps.- Parameters:
stepno- number of simulation steps (default: 1000)
-
setStepTime
public void setStepTime(double timestep) Sets the simulation timestep.- Parameters:
timestep- duration of one simulation step in femtoseconds (default: 0.1fs)
-
setInitialTemperature
public void setInitialTemperature(double temperature) Sets the initial temperature. (default: 300K)- Parameters:
temperature- temperature in Kelvins
-
setSamplingStart
public void setSamplingStart(double sampstart) Sets the beginning of trajectory sampling. (default: 0)- Parameters:
sampstart- number of first trajectory frame to be saved
-
setSamplingInterval
public void setSamplingInterval(double sampinterval) Number of trajectory frames to be stored from the sampling start time to the end of calculation. (default: 10)- Parameters:
sampinterval- trajectory sampling interval in femtoseconds
-
setCenterMolecule
public void setCenterMolecule(boolean centerMolecule) Center the molecule before MD calculation (It is not set by default.)- Parameters:
centerMolecule- is the molecule will be centered
-
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 monitor, may benull
-
getProductName
Returns the product identifier of the plugin as given byLicenseManager.- Specified by:
getProductNamein classCalculatorPlugin- Returns:
- The identifier
LicenseManager.CONFORMATION_PLUGIN_GROUP
-
setParameters
Sets the input parameters for the plugin. Parameters:- forcefield: forcefield used for calculation (default: "Dreiding")
- "dreiding"
- "newdreiding"
- integrator: integrator type, possible values:
- "positionverlet"
- "velocityverlet"
- "leapfrog"
- "projectedvelocityverlet"
- stepno: step number to be calculated (default: 1000)
- steptime: step time in femtoseconds (default: 0.1fs)
- temperature: initial temperature of the system in Kelvin(default: 300K)
- trajectorytype: type of trajectory output
- mol - multiple "mol" frames
- xtc - Gromacs XTC compressed frames
- trajectoryfile: file, where trajectory is stored (default:-)
- xtcprecision: number of decimal digits (default:4)
- debuglevel: (default: 0)
- debugfile: (default: stderr)
- Overrides:
setParametersin classCalculatorPlugin- Parameters:
params- is the parameter table- Throws:
PluginException- on error
- forcefield: forcefield used for calculation (default: "Dreiding")
-
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. Returnstrueif parameter "single" is set to "false",falseotherwise (default:false).- Overrides:
handlesMultiFragmentMoleculesin classCalculatorPlugin- Returns:
- true if the plugin handles multifragment molecules, false otherwise
-
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 tool.- Specified by:
runin classCalculatorPlugin- Returns:
- true if the calculation was successful, false on calculation problems
- Throws:
PluginException- on error- 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
-
getStructureCount
public int getStructureCount()Returns the number of different structures.- Returns:
- the number of different structures
-
getStructure
Returns a structure.- Parameters:
index- is the structure index- Returns:
- the structure
- Throws:
PluginException
-
getStructures
Returns all structures.- Returns:
- all structures
- Throws:
PluginException
-
getResultTypes
Returns the result types.- Overrides:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
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
-
standardize
Expands sgroups.- Overrides:
standardizein classCalculatorPlugin- Parameters:
mol- is the molecule to be standardized
-