IMP logo
IMP Reference Guide  2.5.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-2015 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/Model.h>
20 #include <IMP/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 Restraint {
31  public:
32  //! Constructor
33  /**
34  \param[in] rbs Excluded volume will be calculated between these Rigid bodies
35  \param[in] refiner rigid body refiner
36  \param[in] weight_key the name of the weight attribute of the particles
37  \note Particles that are rigid-bodies are interpolated and
38  not resampled. This significantly reduces the running time but is less
39  accurate.
40  */
42  FloatKey weight_key =
44 
45  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
46  const IMP_OVERRIDE;
49 
50 #ifndef SWIG
51  IMP_LIST(private, Particle, particle, Particle *, Particles);
52 #endif
53 
54  private:
55  //! Create density maps: one for each rigid body
56  /**
57  \todo the user should pass a refiner for each rigid body. For now we
58  assume that each rigid body is a molecular hierarchy
59  */
60  void initialize_model_density_map(FloatKey weight_key);
61  core::RigidBodies rbs_;
62  // one surface map for each rigid body
63  mutable em::SurfaceShellDensityMaps rbs_surface_maps_;
64  // reference to the IMP environment
65  // derivatives
66  std::vector<std::vector<float> > rb_refined_dx_, rb_refined_dy_,
67  rb_refined_dz_;
68  // bool special_treatment_of_particles_outside_of_density_;
69  // rigid bodies handling
70  std::vector<IMP::algebra::Transformation3D> rbs_orig_trans_;
71  IMP::PointerMember<Refiner> rb_refiner_; // refiner for rigid bodies
72 };
73 
74 IMPMULTIFIT_END_NAMESPACE
75 
76 #endif /* IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H */
static FloatKey get_mass_key()
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
Storage of a model, its restraints, constraints and particles.
Represent a molecule as shells of distance from the surface.
#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.
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
Abstract class to implement hierarchical methods.
Definition: Refiner.h:34
Class to handle individual model particles.
Definition: Particle.h:37
Abstract base class for all restraints.
Decorator for a sphere-like particle.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:52