Class MolecularDynamicsPlugin

  • All Implemented Interfaces:
    chemaxon.license.Licensable

    @PublicAPI
    public class MolecularDynamicsPlugin
    extends CalculatorPlugin
    Molecular Dynamics plugin.

    API usage example:

        // create plugin
        MolecularDynamicsPlugin plugin = new MolecularDynamicsPlugin();
        
        // set parameters
        plugin.setStepNumber(10000);
        plugin.setStepTime(1);
        plugin.setSamplingInterval(10);
    
        // read the input molecule
        MolImporter mi = new MolImporter("mol.sdf");
        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
        }
        
        mi.close();
     

    For concurrent plugin example applications using ChemAxon's concurrent framework, refer to the Concurrent plugin examples.

    Since:
    Marvin 4.1, 05/11/2006
    • Constructor Detail

      • MolecularDynamicsPlugin

        public MolecularDynamicsPlugin()
        Creates a new instance of MolecularDynamicsPlugin
    • Method Detail

      • setForceField

        public void setForceField​(String forcefield)
        Sets the force field type.
        Parameters:
        forcefield - force field type possible values: "dreiding", (default: "dreiding")
      • setIntegrator

        public void setIntegrator​(String integrator)
        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

        public void setProgressMonitor​(MProgressMonitor pmon)
        Sets a progress observer to be used in run() to display progress status. Short calculations may ignore the observer object. The default implementation does nothing.
        Overrides:
        setProgressMonitor in class CalculatorPlugin
        Parameters:
        pmon - is the progress monitor, may be null
      • setParameters

        public void setParameters​(Properties params)
                           throws PluginException
        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"
          (default: velocityverlet)
        • 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:
        setParameters in class CalculatorPlugin
        Parameters:
        params - is the parameter table
        Throws:
        PluginException - on error
      • handlesMultiFragmentMolecules

        public boolean handlesMultiFragmentMolecules()
        Returns 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).
        Overrides:
        handlesMultiFragmentMolecules in class CalculatorPlugin
        Returns:
        true if the plugin handles multifragment molecules, false otherwise
      • 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 class CalculatorPlugin
        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

        public Molecule getStructure​(int index)
                              throws PluginException
        Returns a structure.
        Parameters:
        index - is the structure index
        Returns:
        the structure
        Throws:
        PluginException
      • getResultCount

        public int getResultCount​(Object type)
        Returns the number of result items for the given result key.
        Overrides:
        getResultCount in class CalculatorPlugin
        Parameters:
        type - is the result type
        Returns:
        the number of result items
        See Also:
        getResultTypes()
      • getResultAsString

        public String getResultAsString​(Object type,
                                        int index,
                                        Object result)
                                 throws PluginException
        Returns the specified result in String format.
        Overrides:
        getResultAsString in class CalculatorPlugin
        Parameters:
        type - is the result type
        index - is the result index
        result - is the result item
        Returns:
        the specified result in String format
        Throws:
        PluginException - if an invalid result item is given
      • standardize

        public void standardize​(Molecule mol)
        Expands sgroups.
        Overrides:
        standardize in class CalculatorPlugin
        Parameters:
        mol - is the molecule to be standardized