Package gromacs :: Package analysis :: Package plugins :: Module distances :: Class Distances
[hide private]
[frames] | no frames]

Class Distances

source code

 object --+    
          |    
core.Plugin --+
              |
             Distances

*Distances* plugin.

The distance between the center of mass of two index groups are
calculated for each time step and written to files.

.. class:: Distances(groups, ndx, [cutoff, [, name[, simulation]]])

:Arguments:
    name : string
        plugin name (used to access it)
    simulation : instance
        The :class:`gromacs.analysis.Simulation` instance that owns the plugin.
    groups : list of index group names
        The first entry is the *primary group*, the second is the
        *secondary group.
    ndx : index filename or list
        All index files that contain the listed groups.
    cutoff : float
        A contact is recorded if the distance is <cutoff [0.6 nm]

Example:

Generate index files with the groups of interest, for instance
with :class:`gromacs.cbook.IndexBuilder`::

  from gromacs.cbook import IndexBuilder
  A_grp, A_ndx = IndexBuilder(tpr, ['@a 62549 & r NA'], names=['Na1_ion'], offset=-9, 
                              out_ndx='Na1.ndx', name_all="Na1").combine()
  B = IndexBuilder(tpr, ['S312:OG','T313:OG1','A38:O','I41:O','A309:O'], offset=-9, 
                        out_ndx='Na1_site.ndx', name_all="Na1_site")
  B_grp, B_ndx = B.combine()                            
  all_ndx_files = [A_ndx, B_ndx]

To calculate the distance between "Na1" and the "Na1_site", create an instance with
the appropriate parameters and add them to a :class:`gromacs.analysis.Simulation` instance::

  dist_Na1_site = Distances(name='Dsite', groups=['Na1', 'Na1_site'], ndx=all_ndx_files)
  S.add_plugin(dist_Na1_site)

Nested Classes [hide private]
  worker_class
actual plugin :class:`gromacs.analysis.core.Worker` class (name with leading underscore)
Instance Methods [hide private]

Inherited from core.Plugin: __init__, register

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]

Inherited from core.Plugin: plugin_name, simulation, worker

Properties [hide private]

Inherited from object: __class__