FMatch

Defines a match object used to build and refine matches between Molecule type objects. Matches are build by matching pairs of Particles from each Molecule.

[ ligand_pharma | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

AUTHORS
CHANGES LOG
GOALS
USAGE

Class Summary

class FMatch

{
public:
class ParticleMatch ;
// Contructors
FMatch();
FMatch(const RigidTrans3& rt);
FMatch(const FMatch& m);
// Destructor
~FMatch();
// Match construction and refinement methods.
bool add(const unsigned int modelParticle, const unsigned int sceneParticle, bool test );
// Inspection methods.
short size() const;
float rmsd() const;
const RigidTrans3& rigidTrans() const;
int sceneParticle(const unsigned int model) const;
int modelParticle(const unsigned int scene) const;
const ParticleMatch& operator[](const unsigned int index) const;
template < class ParticleT> void calculateBestFit(const Molecule< ParticleT>& model, const Molecule< ParticleT>& scene);
void clear() ;
friend ostream& operator<<(ostream& s, const FMatch& m);
typedef vector< ParticleMatch> MatchList;
protected:
MatchList pairs;
float rms;
RigidTrans3 trans;
}; // FMatch

Back to the top of FMatch


AUTHORS

Meir Fuchs. (meirfux@math.tau.ac.il)

Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997.

Back to the top of FMatch


CHANGES LOG

Back to the top of FMatch


GOALS

The Match class was designed for match building, handling and reefinement. A match assumes two Molecule objects. Using specified pairs of Particles taken from the two Molecules the match is built. A Match has an RMS score and a rigid transformation used by the match. This rigid transformation may be refined and changed by finding the best rigid transformation to match the given pairs of particles stored in the Match.

Special attention should be given to the add method. This method lets the user add a pair to the match. If a different pair is added, one that clashes with the first pair no checks are done.

Becasue of the difficulty in determinig how a match should be constucted and built the non-public members of this class were left protected. This allows a user to write Match descendants that best fit his needs.

Back to the top of FMatch


USAGE

The following program is a demo utilizing most of the methods supported by the Match object. Given two Molecule objects, model and scene this program will randomly match pairs of particles from the molecules. Every 200 attempts to add random pairs to the match the program recalculates the best linear transformation. This process is repeated 1000 times for a total of 200,000 attempted pair additions.

    Match M;
    for (int i=0; i<1000; i++) {
      for (int j=0; j<200; j++) {
        // randomly pick pair
        unsigned int modelParticle = model.size()*drand48();
	unsigned int sceneParticle = scene.size()*drand48();
	// add pair
	M.add(modelParticle, sceneParticle);
      } // j
      M.calculateBestFit(model, scene);  // every 200 random pairs recalc
      cout << M.rigidTrans() << '\n';    // rig. trans. and print it.
    } // i

    int matchingParticle;
    for(int i=0; i<model.size(); i++)
      if ((matchingParticle = M.sceneParticle(i)) >= 0)
        cout << i << '\t' << matchingParticle << '\n';

Comment: Generally, it is expected (By me at least) that if a very large linear match infact exists between model and scene (e.g. try model=scene) the calculated rigid transformation will probablistically tend to such a match.

Back to the top of FMatch


class ParticleMatch ;

ParticleMatch is used by the class implementation to store matching pairs within an STL vector.

  class ParticleMatch
  {
  public:
    ParticleMatch();

Back to the top of FMatch


FMatch();

Construct a new match.

  FMatch();

Back to the top of FMatch


FMatch(const RigidTrans3& rt);

Contruct a new Match object using the candidate rigid transformation used to match the two sets of points. This rigid transformation may be further enhanced after a set of matching pairs is added using the calculateBestFit method.

  FMatch(const RigidTrans3& rt);

Back to the top of FMatch


FMatch(const FMatch& m);

Match copy contructor. Implicitely declared to make sure that all data referred to by the Match object is actually copied.

  FMatch(const FMatch& m);

Back to the top of FMatch


~FMatch();

  ~FMatch();

Back to the top of FMatch


bool add(const unsigned int modelParticle, const unsigned int sceneParticle, bool test );

  bool add(const unsigned int modelParticle, const unsigned int sceneParticle, bool test=false);

Back to the top of FMatch


short size() const;

Returns the match size.

  short size() const;

Back to the top of FMatch


float rmsd() const;

After calculating the best linear transformation using calculateBestFit this method will return the RMSD of the match.

  float rmsd() const;

Back to the top of FMatch


const RigidTrans3& rigidTrans() const;

At any point, the rigid transformation currently used by the match will be returned.

  const RigidTrans3& rigidTrans() const;

Back to the top of FMatch


int sceneParticle(const unsigned int model) const;

Given a model particle returns the matching scene particle. If no such particle is found the method will return a negative value.

  int sceneParticle(const unsigned int model) const;

Back to the top of FMatch


int modelParticle(const unsigned int scene) const;

Given a scene particle returns the matching model particle. If no such particle is found the method will return a negative value.

  int modelParticle(const unsigned int scene) const;

Back to the top of FMatch


const ParticleMatch& operator[](const unsigned int index) const;

Return information about the pair indexed by index in the match in the form of a ParticleMatch object reference.

  const ParticleMatch& operator[](const unsigned int index) const;

Back to the top of FMatch


template < class ParticleT> void calculateBestFit(const Molecule< ParticleT>& model, const Molecule< ParticleT>& scene);

Calculate the best rigid transformation to minimize the inter-point RMSD. The method accepts the two molecules from which the particles are taken from and from which it will get the particles positions. See the Molecule class documentation documentation.

  template < class ParticleT>
  void calculateBestFit(const Molecule< ParticleT>&  model, const Molecule< ParticleT>&  scene);

Back to the top of FMatch


void clear() ;

  void clear()                   
;

Function is currently defined inline.


Back to the top of FMatch


friend ostream& operator<<(ostream& s, const FMatch& m);

  friend ostream& operator<<(ostream& s, const FMatch& m);

Back to the top of FMatch


typedef vector< ParticleMatch> MatchList;

A vector of ParticleMatch is used to store the matching pairs of particles

  typedef vector< ParticleMatch> MatchList; //!!!

Back to the top of FMatch


MatchList pairs;

  MatchList     pairs;

Back to the top of FMatch


float rms;

  float         rms;

Back to the top of FMatch


RigidTrans3 trans;

  RigidTrans3   trans;

Back to the top of FMatch


All Members

public:
class ParticleMatch ;
// Match construction and refinement methods.
bool add(const unsigned int modelParticle, const unsigned int sceneParticle, bool test );
// Inspection methods.
short size() const;
float rmsd() const;
const RigidTrans3& rigidTrans() const;
int sceneParticle(const unsigned int model) const;
int modelParticle(const unsigned int scene) const;
const ParticleMatch& operator[](const unsigned int index) const;
template < class ParticleT> void calculateBestFit(const Molecule< ParticleT>& model, const Molecule< ParticleT>& scene);
void clear() ;
friend ostream& operator<<(ostream& s, const FMatch& m);
typedef vector< ParticleMatch> MatchList;
protected:
MatchList pairs;
float rms;
RigidTrans3 trans;

Back to the top of FMatch


Ancestors

Class does not inherit from any other class.

Back to the top of FMatch


Descendants

Class is not inherited by any others.

Back to the top of FMatch


Generated from source by the Cocoon utilities on Mon Dec 21 11:44:46 2009 .

Report problems to jkotula@unimax.com