IMP  2.2.0
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 More...
 
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). implies that update_coordinates() has been called by that time otherwise writing will not occur.
  • statfile: suffix of the statistics file
  • 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 23 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 87 of file Statistics.py.

def IMP.isd.Statistics.Statistics.add_coordinates (   self,
  key,
  name,
  format = 'raw',
  append = True,
  extension = 'pdb',
  hierarchies = None,
  restraints = None 
)
  • format = rmf3: will write the whole system as provided, in rmf3 format
    • hierarchies must contain protein hierarchies
    • restraints is a list of restraints
  • format = raw: will write provided data as-is
    • append: whether to append to a trajectory or to write multiple files. With this format, 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.
    • extension: the file extension to use

Definition at line 150 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 108 of file Statistics.py.

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

Definition at line 187 of file Statistics.py.

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

Format should match with the format specified at init time (raw or rmf3) note that setting value to None is equivalent to not calling this function

Definition at line 175 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 253 of file Statistics.py.


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