IMP logo
IMP Reference Guide  develop.27926d84dc,2024/04/18
The Integrative Modeling Platform
DistanceRMSDMetric.h
Go to the documentation of this file.
1 /**
2  * \file IMP/spb/DistanceRMSDMetric.h
3  * \brief Distance RMSD Metric
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPSPB_DISTANCE_RMSD_METRIC_H
9 #define IMPSPB_DISTANCE_RMSD_METRIC_H
10 
11 #include <IMP/algebra.h>
13 #include <IMP/algebra/Vector3D.h>
14 #include <IMP/statistics.h>
15 #include <IMP/spb/spb_config.h>
16 
17 IMPSPB_BEGIN_NAMESPACE
18 
19 /** Compute the RMSD between two sets of particles in two configurations.
20  */
21 class IMPSPBEXPORT DistanceRMSDMetric : public statistics::Metric {
22  Particles ps_;
27  Floats weight_;
28  std::vector<Floats> matrices_;
29  std::vector<std::vector<unsigned> > matrixmap_;
30 
31  void initialize(Ints align);
32  Floats get_distance_matrix(algebra::Vector3Ds coords) const;
34  double get_drmsd(const Floats &m0, const Floats &m1) const;
35  algebra::Vector3D get_vector(algebra::Vector3D center) const;
36  algebra::Transformation3D get_transformation(
37  algebra::Transformation3D trans) const;
38 
39  public:
41  Particle *px, Particle *py, Particle *pz);
42  void add_configuration(double weight = 1.0);
43  Float get_weight(unsigned i);
44 
45  // IMP_METRIC(DistanceRMSDMetric);
46  double get_distance(unsigned int i, unsigned int j) const override;
47  unsigned int get_number_of_items() const override;
49 };
50 
51 IMPSPBEXPORT statistics::PartitionalClustering *create_gromos_clustering(
52  statistics::Metric *d, double cutoff);
53 
54 IMPSPB_END_NAMESPACE
55 
56 #endif /* IMPSPB_DISTANCE_RMSD_METRIC_H */
Simple 3D transformation class.
double get_drmsd(const Vector3DsOrXYZs0 &m0, const Vector3DsOrXYZs1 &m1)
Calculate distance the root mean square deviation between two sets of 3D points.
Definition: atom/distance.h:49
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Include all non-deprecated headers in IMP.statistics.
Include all non-deprecated headers in IMP.algebra.
double get_weight(unsigned int i) const
Return a weight for the point.
Definition: Metric.h:37
Simple 3D transformation class.
VectorD< 3 > Vector3D
Definition: VectorD.h:408
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Simple 3D vector class.
Class to handle individual particles of a Model object.
Definition: Particle.h:43
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
A base class for clustering results where each item is in one cluster.
Store data to be clustered for distance metric based algorithms.
Definition: Metric.h:25