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

Class _Distances

source code

         object --+        
                  |        
utilities.FileUtils --+    
                      |    
            core.Worker --+
                          |
                         _Distances

Analysis of distances.

See :class:`Distances` for usage.

Also used as a base class for :class:`mindistances._MinDistances`.

Instance Methods [hide private]
 
__init__(self, **kwargs)
Set up customized distance analysis.
source code
 
_register_hook(self, **kwargs)
Run when registering; requires simulation.
source code
 
run(self, **kwargs)
Run ``g_dist `` to compute distances between A and B groups.
source code
 
analyze(self, **kwargs)
Make data files available as numpy arrays.
source code
 
plot(self, names=None, **kwargs)
Plot the selected data.
source code

Inherited from core.Worker: figdir, plugindir, savefig, store_xvg, topdir

Inherited from utilities.FileUtils: __repr__, check_file_exists, filename, infix_filename

Inherited from utilities.FileUtils (private): _init_filename

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

Class Variables [hide private]
  names = ["distance"]
list of results (not used at the moment, see _register_hook())
  xlabels = {"distance": r"time $t/$ns", "contacts": r"time $t/$...
dict of labels for the plot x-axis; one for each result
  ylabels = {"distance": r"distance $d/$nm", "contacts": r"conta...
dict of labels for the plot y-axis; one for each result
  default_plot_columns = [0, 1]

Inherited from utilities.FileUtils: default_extension

Instance Variables [hide private]

Inherited from core.Worker: plugin, plugin_name

Inherited from utilities.FileUtils: real_filename

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 
Set up customized distance analysis.
Parameters:
  • groups (list of index group names) - The first entry is the primary group. All other entries are secondary groups and the plugin calculates the minimum distance between members of the primary group and the members of each 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]
Overrides: object.__init__

_register_hook(self, **kwargs)

source code 

Run when registering; requires simulation.

Defines output files (note that we overwrite the parameters.filenames and figname that super might have set).

Overrides: core.Worker._register_hook

run(self, **kwargs)

source code 

Run ``g_dist `` to compute distances between A and B groups.

Additional arguments can be provided (e.g. -b or -e) but an error will result if one tries to set parameters that are already being set by the method itself such as -s or -d; one must to provide the appropriate values to the class constructor.

If the primary output file already exists then no data are generated and the method returns immediately unless one sets force = True.

Overrides: core.Worker.run

analyze(self, **kwargs)

source code 
Make data files available as numpy arrays.
Overrides: core.Worker.analyze

plot(self, names=None, **kwargs)

source code 
Plot the selected data.
Parameters:
  • names (string or list) - Selects which results should be plotted. None plots all in separate graphs.
  • columns (list) - Which columns to plot; typically the default is ok.
  • figure -
    • True: save figures in the given formats
    • "name.ext": save figure under this filename (ext -> format)
    • False: only show on screen
  • formats (sequence) - sequence of all formats that should be saved [('png', 'pdf')]
  • callbacks (dict) - hack: provide a dictionary that contains callback functions to customize the plot. They will be called at the end of generating a subplot and must be indexed by name. They will be called with the keyword arguments name and axis (current subplot axis object):

    callback(name=name, axis=ax)
    
  • kwargs - All other keyword arguments are directly passed to meth:gromacs.formats.XVG.plot.
Overrides: core.Worker.plot

Class Variable Details [hide private]

xlabels

dict of labels for the plot x-axis; one for each result
Value:
{"distance": r"time $t/$ns", "contacts": r"time $t/$ns",}

ylabels

dict of labels for the plot y-axis; one for each result
Value:
{"distance": r"distance $d/$nm", "contacts": r"contacts $N$",}