All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Types | Private Attributes | List of all members
PLMD::RMSD Class Reference

A class that implements RMSD calculations This is a class that implements the various infrastructure to calculate the RMSD or MSD respect a given frame. More...

#include <RMSD.h>

Public Member Functions

 RMSD (Log &log)
 Constructor. More...
 
 RMSD (const RMSD &)
 a copy constructor More...
 
RMSDoperator= (const RMSD &)
 assignment More...
 
 ~RMSD ()
 the destructor needs to delete the myalignment object eventually More...
 
void clear ()
 clear the structure More...
 
void set (const PDB &, std::string mytype)
 set reference, align and displace from input pdb structure More...
 
void setType (std::string mytype)
 set the type of alignment we are doing More...
 
void setReference (const std::vector< Vector > &reference)
 set reference coordinates More...
 
void setAlign (const std::vector< double > &align)
 set weights More...
 
void setDisplace (const std::vector< double > &displace)
 set align More...
 
std::string getMethod ()
 
double simpleAlignment (const std::vector< double > &align, const std::vector< double > &displace, const std::vector< Vector > &positions, const std::vector< Vector > &reference, Log *&log, std::vector< Vector > &derivatives, bool squared=false)
 
template<bool safe>
double optimalAlignment (const std::vector< double > &align, const std::vector< double > &displace, const std::vector< Vector > &positions, const std::vector< Vector > &reference, std::vector< Vector > &derivatives, bool squared=false)
 
double calculate (const std::vector< Vector > &positions, std::vector< Vector > &derivatives, bool squared=false)
 Compute rmsd. More...
 

Private Types

enum  AlignmentMethod { SIMPLE, OPTIMAL, OPTIMAL_FAST }
 

Private Attributes

AlignmentMethod alignmentMethod
 
std::vector< Vectorreference
 
std::vector< double > align
 
std::vector< double > displace
 
OptimalAlignmentmyoptimalalignment
 
Loglog
 

Detailed Description

A class that implements RMSD calculations This is a class that implements the various infrastructure to calculate the RMSD or MSD respect a given frame.

It can be done through an optimal alignment scheme as Kearsley or, more simply, by resetting the center of mass. This is the class that decides this. A very simple use is

#include "tools/PDB.h"
#include "tools/RMSD.h"
#include "tools/Vector.h"
using namespace PLMD;
RMSD rmsd;
PDB pdb;
// get the pdb (see PDB documentation)
pdb.read("file.pdb",true,1.0);
string type;
type.assign("OPTIMAL");
// set the reference and the type 
rmsd.set(pdb,type);
// this calculates the rmsd and the derivatives
vector<Vector> derivs;
double val; 
val=rmsd.calculate(getPositions(),derivs,true);

Definition at line 62 of file RMSD.h.

Constructor & Destructor Documentation

PLMD::RMSD::RMSD ( Log log)

Constructor.

Definition at line 35 of file RMSD.cpp.

PLMD::RMSD::RMSD ( const RMSD oldrmsd)

a copy constructor

Definition at line 54 of file RMSD.cpp.

PLMD::RMSD::~RMSD ( )

the destructor needs to delete the myalignment object eventually

Definition at line 98 of file RMSD.cpp.

Member Function Documentation

double PLMD::RMSD::calculate ( const std::vector< Vector > &  positions,
std::vector< Vector > &  derivatives,
bool  squared = false 
)

Compute rmsd.

Definition at line 131 of file RMSD.cpp.

void PLMD::RMSD::clear ( )

clear the structure

Definition at line 93 of file RMSD.cpp.

string PLMD::RMSD::getMethod ( )

Definition at line 102 of file RMSD.cpp.

RMSD & PLMD::RMSD::operator= ( const RMSD v)

assignment

Definition at line 40 of file RMSD.cpp.

template<bool safe>
double PLMD::RMSD::optimalAlignment ( const std::vector< double > &  align,
const std::vector< double > &  displace,
const std::vector< Vector > &  positions,
const std::vector< Vector > &  reference,
std::vector< Vector > &  derivatives,
bool  squared = false 
)

Definition at line 225 of file RMSD.cpp.

void PLMD::RMSD::set ( const PDB pdb,
std::string  mytype 
)

set reference, align and displace from input pdb structure

Definition at line 65 of file RMSD.cpp.

void PLMD::RMSD::setAlign ( const std::vector< double > &  align)

set weights

Definition at line 121 of file RMSD.cpp.

void PLMD::RMSD::setDisplace ( const std::vector< double > &  displace)

set align

Definition at line 126 of file RMSD.cpp.

void PLMD::RMSD::setReference ( const std::vector< Vector > &  reference)

set reference coordinates

Definition at line 112 of file RMSD.cpp.

void PLMD::RMSD::setType ( std::string  mytype)

set the type of alignment we are doing

Definition at line 73 of file RMSD.cpp.

double PLMD::RMSD::simpleAlignment ( const std::vector< double > &  align,
const std::vector< double > &  displace,
const std::vector< Vector > &  positions,
const std::vector< Vector > &  reference,
Log *&  log,
std::vector< Vector > &  derivatives,
bool  squared = false 
)

Definition at line 172 of file RMSD.cpp.

Member Data Documentation

std::vector<double> PLMD::RMSD::align
private

Definition at line 67 of file RMSD.h.

AlignmentMethod PLMD::RMSD::alignmentMethod
private

Definition at line 65 of file RMSD.h.

std::vector<double> PLMD::RMSD::displace
private

Definition at line 68 of file RMSD.h.

Log* PLMD::RMSD::log
private

Definition at line 70 of file RMSD.h.

OptimalAlignment* PLMD::RMSD::myoptimalalignment
private

Definition at line 69 of file RMSD.h.

std::vector<Vector> PLMD::RMSD::reference
private

Definition at line 66 of file RMSD.h.


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