IMP logo
IMP Reference Guide  develop.a3ebfe92e8,2023/01/27
The Integrative Modeling Platform
IMP.isd.Statistics.Statistics Class Reference

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

Detailed Description

Statistics gathering and printing class for ISD gibbs sampling.

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.

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 More...
 
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...
 

Member Function Documentation

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

creates a logging entry for a simulation substep of the gibbs sampler.

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_coordinates (   self,
  key,
  name,
  format = 'raw',
  append = True,
  extension = 'pdb',
  hierarchies = None,
  restraints = None 
)

adds a placeholder for coordinates

  • 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 151 of file Statistics.py.

def IMP.isd.Statistics.Statistics.add_entry (   self,
  key,
  name = None,
  entry = None 
)

add an entry for the statistics file

  • 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 
)

increments the counter of category 'key' by 'value' steps.

Definition at line 188 of file Statistics.py.

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

updates an entry and change its value to value

Definition at line 136 of file Statistics.py.

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

updates the coordinates of key:name entry.

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 176 of file Statistics.py.

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

Writes statistics to the stats file and writes/appends trajectories.

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 254 of file Statistics.py.


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