IMP logo
IMP Reference Guide  2.18.0
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-2022 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/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 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] threshold 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(ParticlesTemp ps, DensityMap *em_map, float threshold,
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 
51  const override;
52  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
54 
55 #ifndef SWIG
56  IMP_LIST(private, Particle, particle, Particle *, Particles);
57 #endif
58  private:
59  //! Store particles
60  void store_particles(ParticlesTemp ps);
61 
62  IMP::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  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.
Perform coarse fitting between two density objects.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Simple atom decorator.
Storage of a model, its restraints, constraints and particles.
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
A macro to provide a uniform interface for storing lists of objects.
Class for handling density maps.
Decorator for helping deal with a hierarchy of molecules.
Class for handling density maps.
Definition: DensityMap.h:93
Refine a particle into a list of particles.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
Class to handle individual particles of a Model object.
Definition: Particle.h:41
Abstract base class for all restraints.
Principal component analysis of a set of points.
Decorator for a sphere-like particle.
Sampled density map.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:53