diff --git a/modules/index.rst b/modules/index.rst index 5f043a23855946ee43aa3077d84288ef59d5bd44..e88395ef90b1d97867f7c3dbc769004302bdbebd 100644 --- a/modules/index.rst +++ b/modules/index.rst @@ -43,7 +43,7 @@ For Starters Molecules -------------------------------------------------------------------------------- -**Overview**: :doc:`molecules intro <intro-01>` | :doc:`mol overview <mol/base/mol>` | :doc:`graphical entity<gfx/entity>` | :doc:`entity <mol/base/entity>` | :doc:`queries <mol/base/query>` | :doc:`algorithms <mol/alg/molalg>` +**Overview**: :doc:`molecules intro <intro-01>` | :doc:`mol overview <mol/base/mol>` | :doc:`graphical entity<gfx/entity>` | :doc:`entity <mol/base/entity>` | :doc:`queries <mol/base/query>` | :doc:`algorithms <mol/alg/molalg>` | :doc:`mm <mol/mm/molmm>` **Trajectories**: :doc:`basics <mol/base/traj>` | :ref:`analysis <traj-analysis>` diff --git a/modules/mol/mm/doc/molmm.rst b/modules/mol/mm/doc/molmm.rst new file mode 100644 index 0000000000000000000000000000000000000000..91e08c6e4842a9b196f5fcb9b7d2ef705d7a270f --- /dev/null +++ b/modules/mol/mm/doc/molmm.rst @@ -0,0 +1,74 @@ +The mm Module +================================================================================ + +.. currentmodule:: ost.mol + +Introduction +-------------------------------------------------------------------------------- + +The mol.mm module provides a wrapper around the +`OpenMM <http://openmm.org>`_ molecular mechanics library to provide +basic md capabilities fully embedded into the OpenStructure universe. +The heart of every simulation is the :class:`Topology` describing how the +particles of an :class:`EntityHandle` interact. The :class:`Simulation` finally +connects the two and allows to perform energy minimizations or move the simulation +through time using an :class:`Integrator`. +A :class:`Topology` can either be built from scratch by adding +one interaction after the other or fully automatically using the +:class:`TopologyCreator`. The whole process of :class:`Topology` building +and setting up a :class:`Simulation` gets controlled with the :class:`Settings`. + + +Installation +-------------------------------------------------------------------------------- + +Openstructure does not come by default with +`OpenMM <http://openmm.org>`_ support. +You have to install it by yourself as an additional dependency and +recompile OpenStructure to dive into the amazing world of GPU accelerated +molecular mechanics. Once installed, you have to pass cmake additional +flags to allow compilation with OpenMM support. e.g.: + + .. code-block:: bash + + cmake . -DENABLE_MM=1 -DOPEN_MM_INCLUDE_DIR=/path/to/openmm/include + -DOPEN_MM_LIBRARY=/path/to/openmm/lib/libOpenMM.so + + +Setting up a simple simulation +-------------------------------------------------------------------------------- + + + .. code-block:: python + + from ost.mol import mm + + prot=io.LoadPDB('awesome_structure.pdb') + + #set up the simulation + settings = mm.Settings() + settings.integrator = mm.LangevinIntegrator(310,1,0.002) + settings.forcefield = mm.LoadCHARMMForcefield() + sim = mm.Simulation(prot,settings) + + #minimize it + sim.ApplySD(tolerance = 1.0, max_iterations = 200) + + #create a trajectory observer and register it to the simulation + observer = mm.TrajWriter(10,"example_traj.pdb","example_traj.dcd") + sim.Register(observer) + + #run the simulation + sim.Steps(10000) + + #Trajectory Observer needs to finalize, otherwise you might get a corrupt dcd file + observer.Finalize() + + +Doing more sophisticated stuff +-------------------------------------------------------------------------------- + +You want to create your own :class:`BuildingBlock` to parametrize custom +residues? Or even generate your custom :class:`Forcefield`? +Check out the mm section in the example script directory. +