IMP  2.1.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/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 {
34 public:
35  //! Constructor
36  /**
37  \param[in] ps The particles participating in the fitting score
38  \param[in] em_map The density map used in the fitting score
39  \param[in] threahold consider all voxels above this value for
40  PCA calculation
41  \param[in] weight_key the name of the weight attribute of the particles
42  \param[in] max_pca_size_diff
43  \param[in] max_angle_diff
44  \param[in] max_centroid_diff
45  */
47  DensityMap *em_map, float threahold,
48  float max_pca_size_diff,float max_angle_diff,float max_centroid_diff,
49  FloatKey weight_key= atom::Mass::get_mass_key());
50 
51  virtual double
52  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
53  const IMP_OVERRIDE;
54  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
56 
57 #ifndef SWIG
58  IMP_LIST(private, Particle, particle, kernel::Particle*, kernel::Particles);
59 #endif
60 private:
61  //! Store particles
62  void store_particles(kernel::ParticlesTemp ps);
63 
64  IMP::base::PointerMember<DensityMap> target_dens_map_;
65  float threshold_;
66  algebra::BoundingBoxD<3> target_bounding_box_;
67  // reference to the IMP environment
68  core::XYZs xyz_;
69  FloatKey weight_key_;
70  kernel::Particles all_ps_;
71  KernelType kt_;
72  algebra::PrincipalComponentAnalysis dens_pca_;
73  float max_angle_diff_,max_pca_size_diff_;
74  float max_centroid_diff_;
75 };
76 
77 IMPEM_END_NAMESPACE
78 
79 #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 memeber.
Definition: base/Pointer.h:147
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:98
Abstract base class for all restraints.
Import IMP/kernel/Refiner.h in the namespace.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
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.