[ Lib_General64 | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
public: | ||
class | ParticleMatch ; | |
// Contructors | ||
FMatch(); | ||
FMatch(const RigidTrans3& rt); | ||
FMatch(const FMatch& m); | ||
// Match construction and refinement methods. | ||
// 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; | |
void | calculateBestFit(const FMolecule< Atom>& model, const FMolecule< Atom>& scene); | |
protected: |
Copyright: SAMBA group, Tel-Aviv Univ. Israel, 1997.
Special attention should be given to the add method. This method lets the user add a pair to the match. Besides specifying the indices of the Particles within the Molcules the add method recieves a score parameter and a priority parameter. The score parameter specifies how much the Particle pair contributes to the score. The priority tells the add method how "important" the pair is. If a different pair is added, one that clashes with the first pair (i.e. the particles overlap) add has to decide which pair to bump off). The descision is made using the highest priority. An example of a priority function would the inverse distance. In this case add will prefer the closer pair even if the pair with the longer distance scores better.
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.
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(); // score is pair distance inverse. float score = (1 / (1+(model[modelParticle] | scene[sceneParticle]))); // add pair according to score M.add(modelParticle, sceneParticle, score ,score); } // 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.
class ParticleMatch ;
ParticleMatch is used by the class implementation to store matching
pairs within an STL vector.
class ParticleMatch { public: ParticleMatch(); //ParticleMatch(unsigned int model, unsigned int scene, // float sc, float pri); ParticleMatch(unsigned int model, unsigned int scene); friend ostream& operator<<(ostream& s, const ParticleMatch& pm); unsigned int model; unsigned int scene; //float score; //float priority; };
Function is currently defined inline.
FMatch();
Construct a new match.
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);
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);
Add a match pair. The pair is defined using two integers (possibly
indices into some array of objects), a match score and a priority. The
match score defines how much matching the model particle to the scene
particle contributes to the total match score. This score should
reflect "how well the pair of particles fit together". A second
parameter sent with the pair is their priority. Two particles may
have a high score but matching one of the particles with a different
particle might be "more correct". For example one might use inverse
distance as a priority - prefering particles that are closer and use
some bio-chemical properties for score (e.g. hydrophobicity, residue
match using PAM scores etc.).
The function returns true if the pair of particles was actually added.
/* bool add(const unsigned int modelParticle, const unsigned int sceneParticle, */ /* const float score, */ /* const float priority); */
This version of add does not use priority and does not check for double
references to the same particles in the match list. The user may prefer
to overlook doubly referenced particles in many cases. This method is
also faster because no search is performed on the existing pairs.
/* void add(const unsigned int modelParticle, const unsigned int sceneParticle, */ /* const float score = 1.0); */
short size() const;
Returns the match size.
short size() const;
float rmsd() const;
After calculating the best linear transformation using
calculateBestFit this method will return the RMSD of the match.
float rmsd() const;
const RigidTrans3& rigidTrans() const;
At any point, the rigid transformation currently used by the match will
be returned.
const RigidTrans3& rigidTrans() const;
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;
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;
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;
void calculateBestFit(const FMolecule< Atom>& model, const FMolecule< Atom>& scene);
Calculate the best rigid transformation to minimize the inter-point
RMSD using the pair scores as weights. The method accepts the two
Molecules from which the particles are taken from and from which it
will get the particles positions. See the MoleculeBase class
and the Molcule class documentation documentation.
void calculateBestFit(const MoleculeBase& model, const MoleculeBase& scene);
void calculateBestFit(const FMolecule< Atom>& model, const FMolecule< Atom>& scene);
public: | ||
---|---|---|
class | ParticleMatch ; | |
// 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; | |
void | calculateBestFit(const FMolecule< Atom>& model, const FMolecule< Atom>& scene); | |
protected: |
Report problems to jkotula@unimax.com