IMP logo
IMP Reference Guide  2.18.0
The Integrative Modeling Platform
ContactMapMetric.h
Go to the documentation of this file.
1 /**
2  * \file IMP/spb/ContactMapMetric.h
3  * \brief Contact Map Metric
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPSPB_CONTACT_MAP_METRIC_H
9 #define IMPSPB_CONTACT_MAP_METRIC_H
10 
11 #include <IMP/algebra.h>
12 #include <IMP/statistics.h>
13 #include <IMP/spb/spb_config.h>
14 
15 IMPSPB_BEGIN_NAMESPACE
16 
17 /** Compute the RMSD between two sets of particles in two configurations.
18  */
19 class IMPSPBEXPORT ContactMapMetric : public statistics::Metric {
20  Particles ps_;
21  double r0_;
22  int nn_;
23  int mm_;
24  Floats weight_;
25  std::vector<Floats> matrices_;
26 
27  double get_rmsd(Floats m0, Floats m1) const;
28  Floats get_contact_map(algebra::Vector3Ds coords) const;
29 
30  public:
31  ContactMapMetric(Particles ps, double r0, int nn, int mm);
32 
33  void add_configuration(double weight = 1.0);
34  void add_map(Floats matrix, double weight = 1.0);
35 
36  Float get_weight(unsigned i) const;
37  Floats get_item(unsigned i) const;
38 
39  // IMP_METRIC(ContactMapMetric);
40  double get_distance(unsigned int i, unsigned int j) const override;
41  unsigned int get_number_of_items() const override;
43 };
44 
45 IMPSPB_END_NAMESPACE
46 
47 #endif /* IMPSPB_CONTACT_MAP_METRIC_H */
#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
double get_rmsd(const Vector3DsOrXYZs0 &m1, const Vector3DsOrXYZs1 &m2)
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
Store data to be clustered for distance metric based algorithms.
Definition: Metric.h:25