Package gromacs :: Package analysis :: Package plugins
[hide private]
[frames] | no frames]

Source Code for Package gromacs.analysis.plugins

  1  # GromacsWrapper plugins 
  2  # Copyright (c) 2009-2010 Oliver Beckstein <orbeckst@gmail.com> 
  3  # Released under the GNU Public License 3 (or higher, your choice) 
  4  # See the file COPYING for details. 
  5  """ 
  6  :mod:`analysis.plugins` -- Plugin Modules 
  7  ========================================= 
  8   
  9  Classes for :class:`gromacs.analysis.core.Simulation` that provide 
 10  code to analyze trajectory data. 
 11   
 12  New analysis plugins should follow the API sketched out in 
 13  :mod:`gromacs.analysis.core`; see an example for use there. 
 14   
 15   
 16  List of plugins 
 17  --------------- 
 18   
 19  Right now the number of plugins is limited. Feel free to contribute your own by 
 20  sending it to the `package author`_. You will be acknowledged in the list below. 
 21   
 22  .. _`package author`: oliver.beckstein@bioch.ox.ac.uk 
 23   
 24  .. table:: Plugins for analysis. 
 25   
 26     ==========================  =========  ======================================== 
 27     plugin                      author     description 
 28     ==========================  =========  ======================================== 
 29     :class:`CysAccessibility`      [#OB]_  estimate accessibility of Cys 
 30                                            residues by water 
 31   
 32     :class:`HelixBundle`           [#OB]_  g_bundle analysis of helices 
 33   
 34     :class:`Distances`             [#OB]_  time series of distances 
 35   
 36     :class:`MinDistances`          [#OB]_  time series of shortest distances 
 37   
 38     :class:`COM`                   [#OB]_  time series of centres of mass 
 39   
 40     :class:`Dihedrals`             [#OB]_  analysis of dihedral angles 
 41   
 42     :class:`RMSF`                  [#OB]_  calculate root mean square fluctuations 
 43   
 44     :class:`RMSD`                  [#OB]_  calculate root mean square distance 
 45   
 46     :class:`Energy`                [#OB]_  terms from the energy file 
 47     ==========================  =========  ======================================== 
 48   
 49   
 50  .. table:: Plugins for trajectory manipulation and status queries. 
 51   
 52     ==========================  =========  ======================================== 
 53     plugin                      author     description 
 54     ==========================  =========  ======================================== 
 55     :class:`Trajectories`          [#OB]_  write xy-fitted trajectories 
 56   
 57     :class:`StripWater`            [#OB]_  remove solvent (and optionally fit to  
 58                                            reference) 
 59   
 60     :class:`Ls`                    [#OB]_  simple :program:`ls` (for testing) 
 61     ==========================  =========  ======================================== 
 62   
 63   
 64  .. rubric:: Footnotes 
 65  .. [#OB] Oliver Beckstein <oliver.beckstein@bioch.ox.ac.uk> 
 66   
 67   
 68  Plugin classes 
 69  -------------- 
 70   
 71  .. autoclass:: CysAccessibility 
 72     :members: 
 73  .. autoclass:: HelixBundle 
 74     :members: 
 75  .. autoclass:: Distances 
 76     :members: 
 77  .. autoclass:: MinDistances 
 78     :members: 
 79  .. autoclass:: COM 
 80     :members: 
 81  .. autoclass:: Dihedrals 
 82     :members: 
 83  .. autoclass:: RMSF 
 84     :members: 
 85  .. autoclass:: RMSD 
 86     :members: 
 87  .. autoclass:: Energy 
 88     :members: 
 89  .. autoclass:: Trajectories 
 90     :members: 
 91  .. autoclass:: StripWater 
 92     :members: 
 93  .. autoclass:: Ls 
 94     :members: 
 95   
 96   
 97  Developer notes 
 98  --------------- 
 99   
100  In principle all that needs to be done to automatically load plugins 
101  is to add their name to :data:`__plugins__`. See the source code for 
102  further comments and how the auto loading of plugins is done. 
103   
104  .. autodata:: __plugins__ 
105  .. autodata:: __plugin_classes__ 
106   
107  """ 
108  __docformat__ = "restructuredtext en" 
109   
110  #: All available plugin names are listed here. Because this is used to 
111  #: automatically set up imports a module file *must* be named like the 
112  #: plugin class it contains but in all lower case. For example, the 
113  #: *Distances* plugin class is contained in the module *distances* (the 
114  #: file ``plugins/distances.py``). 
115  __plugins__ = ['CysAccessibility', 'Distances', 'MinDistances', 'Dihedrals', 
116                 'COM', 'RMSF', 'RMSD', 'Energy', 'HelixBundle', 
117                 'Trajectories', 'StripWater', 'Ls', 
118                 ] 
119  __all__ = [] 
120  __all__.extend(__plugins__) 
121   
122   
123  # 1. Load all modules 
124  #    (module is plugin name in lower case) 
125  #    ('__import__(m.lower(), fromlist=[m])' does not work like 'from m.lower() import m' 
126  _modules = dict([(p, __import__(p.lower(), globals(), locals())) for p in __plugins__]) 
127  # 2. Get the classes 
128  #: Gives access to all available plugin classes (or use the module __dict__) 
129  __plugin_classes__ = dict([(p, M.__dict__[p]) for p,M in _modules.items()]) 
130  # 3. add to the name space (bind classes to names) 
131  globals().update(__plugin_classes__) 
132   
133  del p, M 
134  del _modules 
135