IMP  2.0.1
The Integrative Modeling Platform
TransformationClustering.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/TransformationClustering.h
3  * \brief Clustering of transformation
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_TRANSFORMATION_CLUSTERING_H
10 #define IMPMULTIFIT_TRANSFORMATION_CLUSTERING_H
11 
12 #include <IMP/multifit/multifit_config.h>
13 #include <IMP/base_types.h>
14 #include <IMP/Particle.h>
16 #include <IMP/em/rigid_fitting.h>
18 IMPMULTIFIT_BEGIN_NAMESPACE
19 class IMPMULTIFITEXPORT TransformationClustering : public base::Object {
20  public:
21  //! Constructor
22  /**
23  \param[in] ps cluster transformations with respect to this particles
24  \param[in] max_rmsd
25  if the rmsd between two transformed set of particles
26  is smaller then max_angle_diff, then the two transformations
27  will be in the same cluster
28  */
29  TransformationClustering(Particles ps,
30  Float max_rmsd);
31  //! fast clustering: rotational parameters + RMSD
32  /**
33  \param[in] max_angle_diff
34  if the angle between two transformed set of particles
35  is smaller then max_angle_diff, then the two transformations
36  will be in the same cluster
37  \param[in] min_cluster_size
38  clusters of size smaller than min_rot_cluster_size are ignored
39  */
40  IntsList cluster_by_rotation(
41  const algebra::Transformation3Ds &trans,
42  float max_angle_diff_in_rad,int min_cluster_size);
43 
44  // fast clustering: rotational&translational parameters
45  IntsList cluster_by_transformation(
46  const algebra::Transformation3Ds &trans,
47  float max_angle_diff,float max_translation_diff,
48  int min_cluster_size);
49  // RMSD clustering only
50  /*
51 \param[in] trans the transformations to cluster
52 \param[in] max_rmsd_between_transformations maximum rmsd
53 between transformations to be considered in the same cluster
54 \param[in] min_cluster_size clusters of a smaller size will be ignored.
55 If the value is -1, the member variable min_cluster_size_ will be used
56  */
57  IntsList cluster_by_rmsd(
58  const algebra::Transformation3Ds &trans,
59  float max_rmsd_between_transformations,
60  int min_cluster_size);
61 
62  IMP_OBJECT_INLINE(TransformationClustering,
63  { out << "max RMSD: " << max_rmsd_; }, {});
64 
65 protected:
66  // parameters
67  Float max_rmsd_;
68  Particles ps_;
69  // multifit::RMSDClustering engine_;
70 };
71 IMP_OBJECTS(TransformationClustering, TransformationClusterings);
72 
73 //! Cluster transformations
74 /**
75 \param[in] ps Cluster transformation with respect to these particles
76 \param[in] trans The transformations to cluster
77 \param[in] max_rmsd Maximum RMSD between transformations within a cluster
78 \param[in] max_angle_diff_in_rad maximum angle between rotations
79 in a cluster
80 \param[in] max_displace maximum translation between transformations within
81 a cluster
82 \param[in] min_cluster_size prune out clusters of size smaller
83 \return representatives of the clustered transformations
84 \note This is one possible protocol for clustering.
85 For flexibility use internal clustering functions directly.
86  */
87 IMPMULTIFITEXPORT
88 IntsList get_clustered(Particles ps,
89  const algebra::Transformation3Ds &trans,
90  float max_rmsd,
91  float max_angle_diff_in_rad,
92  float max_displace,
93  int min_cluster_size);
94 
95 IMPMULTIFIT_END_NAMESPACE
96 
97 #endif /* IMPMULTIFIT_TRANSFORMATION_CLUSTERING_H */