IMP  2.1.0
The Integrative Modeling Platform
WeightedExcludedVolumeRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/WeightedExcludedVolumeRestraint.h
3  * \brief Calculate weighted excluded volume between rigid bodies
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H
10 #define IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H
11 
12 #include <IMP/multifit/multifit_config.h>
13 #include <IMP/em/DensityMap.h>
14 #include <IMP/em/CoarseCC.h>
16 
17 #include <IMP/atom/Hierarchy.h>
18 #include <IMP/core/XYZR.h>
19 #include <IMP/kernel/Model.h>
20 #include <IMP/kernel/Restraint.h>
21 #include <IMP/Refiner.h>
22 
23 IMPMULTIFIT_BEGIN_NAMESPACE
24 
25 //! Calculate score based on fit to EM map
26 /** \ingroup exp_restraint
27 
28  */
29 class IMPMULTIFITEXPORT WeightedExcludedVolumeRestraint
30  : public kernel::Restraint
31 {
32 public:
33  //! Constructor
34  /**
35  \param[in] rbs Excluded volume will be calculated between these Rigid bodies
36  \param[in] refiner rigid body refiner
37  \param[in] weight_key the name of the weight attribute of the particles
38  \note kernel::Particles that are rigid-bodies are interpolated and
39  not resampled. This significantly reduces the running time but is less
40  accurate.
41  */
44  Refiner *refiner,
46 
47  virtual double
48  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
49  const IMP_OVERRIDE;
50  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
52 
53 #ifndef SWIG
54  IMP_LIST(private, Particle, particle, kernel::Particle*, kernel::Particles);
55 #endif
56 
57 private:
58  //! Create density maps: one for each rigid body
59  /**
60  \todo the user should pass a refiner for each rigid body. For now we
61  assume that each rigid body is a molecular hierarchy
62  */
63  void initialize_model_density_map(FloatKey weight_key);
64  core::RigidBodies rbs_;
65  //one surface map for each rigid body
66  mutable em::SurfaceShellDensityMaps rbs_surface_maps_;
67  // reference to the IMP environment
68  // derivatives
69  std::vector<std::vector<float> >rb_refined_dx_,
70  rb_refined_dy_ , rb_refined_dz_;
71  // bool special_treatment_of_particles_outside_of_density_;
72  //rigid bodies handling
73  std::vector<IMP::algebra::Transformation3D> rbs_orig_trans_;
74  IMP::base::PointerMember<Refiner> rb_refiner_;//refiner for rigid bodies
75 };
76 
77 IMPMULTIFIT_END_NAMESPACE
78 
79 #endif /* IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H */
static FloatKey get_mass_key()
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:146
Represent a molecule as shells of distance from the surface.
Class for handling density maps.
Decorator for helping deal with a hierarchy of molecules.
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.
Abstract class to implement hierarchical methods.
Decorator for a sphere-like particle.