Changes between Version 1 and Version 2 of Scripts/MMTK


Ignore:
Timestamp:
Jul 8, 2010, 3:34:50 PM (16 years ago)
Author:
Conrad Huang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/MMTK

    v1 v2  
    33[http://dirac.cnrs-orleans.fr/MMTK/ MMTK] is an open source program library for molecular simulation applications.  Chimera uses MMTK to implement its energy minimization functionality.  Using the code below, MMTK users can run their scripts and visualize their simulations as they execute.
    44
    5 The biggest hurdle in visualizing MMTK results in Chimera is the difference in data used by the graphics and the simulation library.  Chimera displays "molecules" while MMTK simulates a "universe".  Fortunately, they both use "atoms", so if we can find a correspondence between Chimera atoms and MMTK atoms, we can bridge the gap between the two worlds.  MMTK2Molecule.py implements a conversion routine from an MMTK universe to a Chimera molecule.  Typical usage looks something like:
     5The biggest hurdle in visualizing MMTK results in Chimera is the difference in data used by the graphics and the simulation library.  Chimera displays "molecules" while MMTK simulates a "universe".  Fortunately, they both use "atoms", so if we can find a correspondence between Chimera atoms and MMTK atoms, we can bridge the gap between the two worlds.  [attachment:MMTK2Molecule.py MMTK2Molecule.py] implements a conversion routine from an MMTK universe to a Chimera molecule.  Typical usage looks something like:
    66
    77{{{
     
    1212where ''molecule'' is a Chimera '''Molecule''' instance; ''atomMap'' is a dictionary whose keys are MMTK atoms and whose values are Chimera atoms; ''universe'' is a MMTK '''Universe''' instance; ''defaultCS'' is the default coordinate set index; and ''usePDBnames'' controls whether the conversion attempts to generate Protein Data Bank style atom names.  The default value for ''defaultCS'' is '''None''', which results in coordinate set numbering starting with zero.  The default value for ''usePDBnames'' is '''True'''.  The easiest way to see how '''MMTK2Molecule.convert''' may be used is through examples.  We We will describe two use cases: (a) visualizing normal modes results, and (b) monitoring energy minimization.
    1313
    14 For the first case, to visualize the results of the MMTK normal modes calculation example, we can create a Chimera trajectory of the molecule.  The trajectory represents a single normal mode and has four sequential steps (equilibrium position, positive extreme, equilibrium position, negative extreme).  When played, the trajectory will appear to oscillate between the two extremes.  For this example, we need two source files: showNormalModes.py and NormalModesTable.py.  showNormalModes.py consists of the MMTK sample normal mode code, followed by the lines:
     14For the first case, to visualize the results of the MMTK normal modes calculation example, we can create a Chimera trajectory of the molecule.  The trajectory represents a single normal mode and has four sequential steps (equilibrium position, positive extreme, equilibrium position, negative extreme).  When played, the trajectory will appear to oscillate between the two extremes.  For this example, we need two source files: [attachment:showNormalModes.py showNormalModes.py] and [attachment:NormalModesTable.py NormalModesTable.py].  [attachment:showNormalModes.py showNormalModes.py] consists of the MMTK sample normal mode code, followed by the lines:
    1515
    1616{{{
     
    1919}}}
    2020
    21 NormalModesTable.py does all the work of the conversion from MMTK to Chimera, displaying the user interface, and updating trajectory coordinates when the user selects a different normal mode to display.
     21[attachment:NormalModesTable.py NormalModesTable.py] does all the work of the conversion from MMTK to Chimera, displaying the user interface, and updating trajectory coordinates when the user selects a different normal mode to display.
    2222
    23 For the second case, to follow the progress of a minimization run, we can create a Chimera molecule from the MMTK universe and update its atomic coordinates as minimization progresses.  To keep Chimera interactive, we can run the minimization in the background, and poll for atom coordinates changes every few display frames.  The example code is in followMinimization.py, which contains a mix of MMTK and Chimera code.
     23For the second case, to follow the progress of a minimization run, we can create a Chimera molecule from the MMTK universe and update its atomic coordinates as minimization progresses.  To keep Chimera interactive, we can run the minimization in the background, and poll for atom coordinates changes every few display frames.  The example code is in [attachment:followMinimization.py followMinimization.py], which contains a mix of MMTK and Chimera code.
    2424
    2525There are a few caveats in using MMTK with Chimera: