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:`ProteinOnly            [#OB]_  remove all atoms except the Protein 
 61                                            (and optionally fit to reference) 
 62   
 63     :class:`Ls`                    [#OB]_  simple :program:`ls` (for testing) 
 64     ==========================  =========  ======================================== 
 65   
 66   
 67  .. rubric:: Footnotes 
 68  .. [#OB] Oliver Beckstein <oliver.beckstein@bioch.ox.ac.uk> 
 69   
 70   
 71  Plugin classes 
 72  -------------- 
 73   
 74  .. autoclass:: CysAccessibility 
 75     :members: 
 76  .. autoclass:: HelixBundle 
 77     :members: 
 78  .. autoclass:: Distances 
 79     :members: 
 80  .. autoclass:: MinDistances 
 81     :members: 
 82  .. autoclass:: COM 
 83     :members: 
 84  .. autoclass:: Dihedrals 
 85     :members: 
 86  .. autoclass:: RMSF 
 87     :members: 
 88  .. autoclass:: RMSD 
 89     :members: 
 90  .. autoclass:: Energy 
 91     :members: 
 92  .. autoclass:: Trajectories 
 93     :members: 
 94  .. autoclass:: StripWater 
 95     :members: 
 96  .. autoclass:: ProteinOnly 
 97     :members: 
 98  .. autoclass:: Ls 
 99     :members: 
100   
101   
102  Developer notes 
103  --------------- 
104   
105  In principle all that needs to be done to automatically load plugins 
106  is to add their name to :data:`__plugins__`. See the source code for 
107  further comments and how the auto loading of plugins is done. 
108   
109  .. autodata:: __plugins__ 
110  .. autodata:: __plugin_classes__ 
111   
112  """ 
113  __docformat__ = "restructuredtext en" 
114   
115  #: All available plugin names are listed here. Because this is used to 
116  #: automatically set up imports a module file *must* be named like the 
117  #: plugin class it contains but in all lower case. For example, the 
118  #: *Distances* plugin class is contained in the module *distances* (the 
119  #: file ``plugins/distances.py``). 
120  __plugins__ = ['CysAccessibility', 'Distances', 'MinDistances', 'Dihedrals', 
121                 'COM', 'RMSF', 'RMSD', 'Energy', 'HelixBundle', 
122                 'Trajectories', 'StripWater', 'ProteinOnly', 'Ls', 
123                 ] 
124  __all__ = [] 
125  __all__.extend(__plugins__) 
126   
127   
128  # 1. Load all modules 
129  #    (module is plugin name in lower case) 
130  #    ('__import__(m.lower(), fromlist=[m])' does not work like 'from m.lower() import m' 
131  _modules = dict([(p, __import__(p.lower(), globals(), locals())) for p in __plugins__]) 
132  # 2. Get the classes 
133  #: Gives access to all available plugin classes (or use the module __dict__) 
134  __plugin_classes__ = dict([(p, M.__dict__[p]) for p,M in _modules.items()]) 
135  # 3. add to the name space (bind classes to names) 
136  globals().update(__plugin_classes__) 
137   
138  del p, M 
139  del _modules 
140