PROFASI  Version 1.5
Public Member Functions | List of all members
prf::ContactMap Class Reference

Utility to help keep track of a set of contacts. More...

#include <ContactMap.hh>

Inheritance diagram for prf::ContactMap:
Inheritance graph

Public Member Functions

double evaluate ()
 Actual calculation of the value of the observable.
int init_obs ()
 All observables must implement one initialize routine.
void rangeEstimate (double &x0, double &x1)
 Estimate a range in which values of this observable are expected.
- Public Member Functions inherited from prf::Observable
void set (std::string cmd)
 Give the object an instruction to process during initialization.
virtual void refresh ()
 Necessary before an observable value is used.
virtual double delta (Update *u)
 Quick estimate of the change in an Observable due to an update.
double operator() ()
 Retrieve the value of the observable.
double Value ()
 Retrieve the value of the observable.
void disable_stats ()
 Stop collecting statistical data like averages and histograms.
void enable_stats ()
 Start collecting statistical data like averages and histograms.
- Public Member Functions inherited from prf::Named
 Named ()
 Create an object with name "unnamed".
 Named (const char *st)
 Create an object with name st given as a C string.
 Named (std::string st)
 Create an object with a name given as a string.
std::string Name () const
 Retrive the name of an object.
void Name (std::string gnm)
 Assign a new name to an object.

Detailed Description

Contact map is an abstract class to keep track of a set of "Contacts". A contact might be a hydrogen bond, or hydrophobic contact, or mere proximity ... Typically we will have a function bool inContact(int,int), taking two integer arguments representing objects and telling us if they are in contact, like two amino acids. The function may or may not be symmetric.

What we want to do is to read in contact information from a file, and make a set of Contacts we want to monitor. At any given point of time, one might want to scan over the set of specified contacts to see which ones are on, which ones are off. This information can then be conveniently output as one or more integers, whose bits would represent individual contacts. It should also be possible to invert this set of integers to recreate the contacts they represent.

The origin of this class was a project in which such an enermous amount of contact information had to be saved that size of the files on disk became an issue. A contact, on the other hand, is either present or absent. So, it can be stored in a bit. This allows one to store the state of 32 different contacts in one single 32-bit integer.

As an Observable, its value is the number of intact contacts. The function refresh is left as virtual so that it can be over-ridden again in subsequent inheritted classes.

Member Function Documentation

int ContactMap::init_obs ( )

Even if it seems that one particular observable might need additional arguments during initialization, it is advantageous to have a uniform syntax for all of them. So, when additional arguments are needed, one should provide them in a separate function called before initialization, and then call init_obs without arguments. The name init_obs instead of a more natural "init" or "initialize" is because an Observable often inherits from other classes which represent its character more fundamentally. So, the names such as "init" are kept free for such base classes.

Reimplemented from prf::Observable.

void ContactMap::rangeEstimate ( double &  x1,
double &  x2 

The default is between 0 and 1. So, for observables with values always between 0 and 1, you need not over-write this virtual function. Sometimes the observable will have a different fixed range, determined by its definition. Sometimes the range can not be determined perfectly. In such a case, let this function just return something reasonable.

Reimplemented from prf::Observable.

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

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2