IMP  2.1.0
The Integrative Modeling Platform
EnvelopeFitRestraint.h
Go to the documentation of this file.
1 /**
2  * \file em/EnvelopeFitRestraint.h
3  * \brief score envelope fit based on map distance transform
4  *
5  * \authors Dina Schneidman
6  * Copyright 2007-2013 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPEM_ENVELOPE_FIT_RESTRAINT_H
11 #define IMPEM_ENVELOPE_FIT_RESTRAINT_H
12 
13 #include <IMP/em/em_config.h>
14 #include <IMP/em/PCAAligner.h>
16 #include <IMP/em/EnvelopeScore.h>
17 #include <IMP/base/object_macros.h>
18 
19 #include <IMP/kernel/Restraint.h>
20 
21 IMPEM_BEGIN_NAMESPACE
22 
23 //! A restraint for envelope-based scoring of particles in the density map
24 /**
25  The restraint fits the particles into the density map by alignment
26  of principal components of the particles with principal components
27  of the map. Therefore, the particle set should comprise all
28  subunits that fill the map. The aligned particles are scored using
29  EnvelopeScore. This is a fast alignment and scoring that works well
30  for low resolution density maps.
31  */
32 class IMPEMEXPORT EnvelopeFitRestraint : public IMP::Restraint {
33 public:
34  //! Constructor
35  /**
36  \param[in] particles The particles participating in the score
37  \param[in] em_map The density map used in the fitting score
38  \param[in] density_threshold Density map threshold
39  \param[in] penetration_threshold A distance for which penetration
40  of particles out of the map envelope (as defined by density_threshold)
41  is allowed. Recommended value is approximately map resolution
42  */
44  DensityMap *em_map,
45  double density_threshold,
46  double penetration_threshold);
47 
48  double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const;
49 
50  // compute and return best scoring transofrmation
51  algebra::Transformation3D get_transformation() const {
52  unprotected_evaluate(nullptr);
53  return transformation_;
54  }
55 
56  // compute best scoring transformation and apply it on the particles
57  void apply_transformation();
58 
61 
62  private:
65  double penetration_threshold_;
68 
69  // best scoring trans from last evaluate
70  IMP::algebra::Transformation3D transformation_;
71 };
72 
73 IMPEM_END_NAMESPACE
74 
75 #endif /* IMPEM_ENVELOPE_FIT_RESTRAINT_H */
Simple 3D transformation class.
Class for adding derivatives from restraints to the model.
Copyright 2007-2013 IMP Inventors. All rights reserved.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
A restraint for envelope-based scoring of particles in the density map.
IMP::kernel::ModelObjectsTemp do_get_inputs() const
Class for handling density maps.
Definition: DensityMap.h:98
Abstract base class for all restraints.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Various general useful macros for IMP.
class for envelope based scoring using MapDistanceTransform
class for computing a distance transform of the density map