IMP  2.0.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-2013 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/Model.h>
22 #include <IMP/Restraint.h>
23 #include <IMP/VersionInfo.h>
24 #include <IMP/Refiner.h>
26 
27 IMPEM_BEGIN_NAMESPACE
28 
29 //! Calculate score based on fit to EM map
30 /** \ingroup exp_restraint
31 
32  */
33 class IMPEMEXPORT PCAFitRestraint : public Restraint
34 {
35 public:
36  //! Constructor
37  /**
38  \param[in] ps The particles participating in the fitting score
39  \param[in] em_map The density map used in the fitting score
40  \param[in] threahold consider all voxels above this value for
41  PCA calculation
42  \param[in] weight_key the name of the weight attribute of the particles
43  */
44  PCAFitRestraint(ParticlesTemp ps,
45  DensityMap *em_map, float threahold,
46  float max_pca_size_diff,float max_angle_diff,float max_centroid_diff,
47  FloatKey weight_key= atom::Mass::get_mass_key());
48 
50 
51 #ifndef SWIG
52  IMP_LIST(private, Particle, particle, Particle*, Particles);
53 #endif
54 private:
55  //! Store particles
56  void store_particles(ParticlesTemp ps);
57 
58  IMP::OwnerPointer<DensityMap> target_dens_map_;
59  float threshold_;
60  algebra::BoundingBoxD<3> target_bounding_box_;
61  // reference to the IMP environment
62  core::XYZs xyz_;
63  FloatKey weight_key_;
64  Particles all_ps_;
65  KernelType kt_;
66  algebra::PrincipalComponentAnalysis dens_pca_;
67  float max_angle_diff_,max_pca_size_diff_;
68  float max_centroid_diff_;
69 };
70 
71 IMPEM_END_NAMESPACE
72 
73 #endif /* IMPEM_PCA_FIT_RESTRAINT_H */