IMP  2.3.1
The Integrative Modeling Platform
PCAFitRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/em/PCAFitRestraint.h
3  * \brief Calculate match between density map PCA and particles PCA.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPEM_PCA_FIT_RESTRAINT_H
10 #define IMPEM_PCA_FIT_RESTRAINT_H
11 
12 #include <IMP/em/em_config.h>
13 #include "DensityMap.h"
14 #include "CoarseCC.h"
15 #include "SampledDensityMap.h"
16 
17 #include <IMP/atom/Hierarchy.h>
18 #include <IMP/atom/Atom.h>
19 #include <IMP/atom/Mass.h>
20 #include <IMP/core/XYZR.h>
21 #include <IMP/kernel/Model.h>
22 #include <IMP/kernel/Restraint.h>
23 #include <IMP/Refiner.h>
25 
26 IMPEM_BEGIN_NAMESPACE
27 
28 //! Calculate score based on fit to EM map
29 /** \ingroup exp_restraint
30 
31  */
32 class IMPEMEXPORT PCAFitRestraint : public kernel::Restraint {
33  public:
34  //! Constructor
35  /**
36  \param[in] ps The particles participating in the fitting score
37  \param[in] em_map The density map used in the fitting score
38  \param[in] threahold consider all voxels above this value for
39  PCA calculation
40  \param[in] weight_key the name of the weight attribute of the particles
41  \param[in] max_pca_size_diff
42  \param[in] max_angle_diff
43  \param[in] max_centroid_diff
44  */
45  PCAFitRestraint(kernel::ParticlesTemp ps, DensityMap *em_map, float threahold,
46  float max_pca_size_diff, float max_angle_diff,
47  float max_centroid_diff,
48  FloatKey weight_key = atom::Mass::get_mass_key());
49 
50  virtual double unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
51  const IMP_OVERRIDE;
54 
55 #ifndef SWIG
56  IMP_LIST(private, Particle, particle, kernel::Particle *, kernel::Particles);
57 #endif
58  private:
59  //! Store particles
60  void store_particles(kernel::ParticlesTemp ps);
61 
62  IMP::base::PointerMember<DensityMap> target_dens_map_;
63  float threshold_;
64  algebra::BoundingBoxD<3> target_bounding_box_;
65  // reference to the IMP environment
66  core::XYZs xyz_;
67  FloatKey weight_key_;
68  kernel::Particles all_ps_;
69  KernelType kt_;
70  algebra::PrincipalComponentAnalysis dens_pca_;
71  float max_angle_diff_, max_pca_size_diff_;
72  float max_centroid_diff_;
73 };
74 
75 IMPEM_END_NAMESPACE
76 
77 #endif /* IMPEM_PCA_FIT_RESTRAINT_H */
Calculate score based on fit to EM map.
A decorator for particles with mass.
Class for adding derivatives from restraints to the model.
Perform coarse fitting between two density objects.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:147
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Simple atom decorator.
Class for handling density maps.
Decorator for helping deal with a hierarchy of molecules.
Class for handling density maps.
Definition: DensityMap.h:94
Abstract base class for all restraints.
Import IMP/kernel/Refiner.h in the namespace.
A restraint is a term in an IMP ScoringFunction.
Class to handle individual model particles.
Storage of a model, its restraints, constraints and particles.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
A macro to provide a uniform interface for storing lists of objects.
Principal component analysis of a set of points.
Decorator for a sphere-like particle.
Sampled density map.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.