IMP  2.1.1
The Integrative Modeling Platform
IMP.isd.Statistics.Statistics Class Reference

Statistics gathering and printing class for ISD gibbs sampling. More...

Public Member Functions

def add_category
 creates a logging entry for a simulation substep of the gibbs sampler. More...
 
def add_coordinates
 adds a placeholder for coordinates
 
def add_entry
 add an entry for the statistics file More...
 
def increment_counter
 increments the counter of category 'key' by 'value' steps. More...
 
def update
 updates an entry and change its value to value
 
def update_coordinates
 updates the coordinates of key:name entry. More...
 
def write_stats
 Writes statistics to the stats file and writes/appends trajectories. More...
 

Detailed Description

Also manages the restart file (TODO).

  • prefix: all outputted files will have this prefix
  • rate: print statistics every so many gibbs sampling steps
  • trajrate: print trajectories (pdb) every multiple of rate (default 1).
  • statfile: suffix of the statistics file
  • append: whether to append to a trajectory or to write multiple files. For the statistics class, a trajectory is just a string, you can stuff whatever you want in it. If append is False, files will be numbered according to the counter of their category.
  • num_entries_per_line: number of entries per line in the output. -1 to disable wrapping.
  • repeat_title: if 0 (default) only print it in the beginning. Else repeat it every 'repeat_title' outputted lines in the statistics file.
  • separate_lines: If False the entries are not separated (default). If True, the lines are separated with stars.
  • compress: If set to a positive number of steps, compress trajectories each time so many steps have elapsed, appending the current frame number to the filename. Only works in append mode, and when it is set to a multiple of rate.

TODO: check if everything was updated nicely

Note
This class is only available in Python.

Definition at line 25 of file Statistics.py.

Member Function Documentation

def IMP.isd.Statistics.Statistics.add_category (   self,
  name = None 
)

Each category has its own counter, initialized to zero. The global category does not need to be created, it's already created by the init method, and its key is 'global'.

  • name: an optional name, must be string. Returns: a unique key to refer to this category, which will start with the optional name.

Definition at line 88 of file Statistics.py.

def IMP.isd.Statistics.Statistics.add_entry (   self,
  key,
  name = None,
  entry = None 
)
  • key: which category it belongs to (key returned by add_category) You must specify at least one of the two following:
  • name: a name for this entry
  • entry: an instance of the Entry class. Arguments: - name only: must already have an entry by that name.
    • entry only: name is set to the entry title and added. If it didn't exist before it is stored as well.
    • name and entry: name is used instead of the title.
    • nothing: raises an error. Currently, not providing entry only makes sense for the counter since there is no method to create an entry without adding it to the statistics file.

Definition at line 109 of file Statistics.py.

def IMP.isd.Statistics.Statistics.increment_counter (   self,
  key,
  value 
)

Definition at line 161 of file Statistics.py.

def IMP.isd.Statistics.Statistics.update_coordinates (   self,
  key,
  name,
  value 
)

Format should match with the format specified at init time (pdb or cdf)

Definition at line 151 of file Statistics.py.

def IMP.isd.Statistics.Statistics.write_stats (   self)

Only does that if the global step matches the output rate. Trajectories are written more sparsely, see trajrate. Returns: True if data was written, False if not.

Definition at line 224 of file Statistics.py.

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: