IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
EnvelopeFitRestraint.h
Go to the documentation of this file.
1/**
2 * \file IMP/em/EnvelopeFitRestraint.h
3 * \brief score envelope fit based on map distance transform
4 *
5 * \authors Dina Schneidman
6 * Copyright 2007-2022 IMP Inventors. All rights reserved.
7 *
8 */
9
10#ifndef IMPEM_ENVELOPE_FIT_RESTRAINT_H
11#define IMPEM_ENVELOPE_FIT_RESTRAINT_H
12
13#include <IMP/em/em_config.h>
14#include <IMP/em/PCAAligner.h>
17#include <IMP/object_macros.h>
18
19#include <IMP/Restraint.h>
20
21IMPEM_BEGIN_NAMESPACE
22
23//! A restraint for envelope-based scoring of particles in the density map
24/**
25 The restraint fits the particles into the density map by alignment
26 of principal components of the particles with principal components
27 of the map. Therefore, the particle set should comprise all
28 subunits that fill the map. The aligned particles are scored using
29 EnvelopeScore. This is a fast alignment and scoring that can work well
30 for low resolution density maps.
31
32 \note In most cases it is more appropriate to use isd::GaussianEMRestraint.
33 */
34class IMPEMEXPORT EnvelopeFitRestraint : public IMP::Restraint {
35 public:
36 //! Constructor
37 /**
38 \param[in] particles The particles participating in the score
39 \param[in] em_map The density map used in the fitting score
40 \param[in] density_threshold Density map threshold
41 \param[in] penetration_threshold A distance for which penetration
42 of particles out of the map envelope (as defined by density_threshold)
43 is allowed. Recommended value is approximately map resolution
44 */
46 double density_threshold, double penetration_threshold);
47
49 IMP::DerivativeAccumulator *accum) const override;
50
51 // compute and return best scoring transformation
52 algebra::Transformation3D get_transformation() const {
53 unprotected_evaluate(nullptr);
54 return transformation_;
55 }
56
57 // compute best scoring transformation and apply it on the particles
58 void apply_transformation();
59
60 IMP::ModelObjectsTemp do_get_inputs() const override { return ps_; }
62
63 private:
64 Particles ps_;
66 double penetration_threshold_;
69
70 // best scoring trans from last evaluate
71 IMP::algebra::Transformation3D transformation_;
72};
73
74IMPEM_END_NAMESPACE
75
76#endif /* IMPEM_ENVELOPE_FIT_RESTRAINT_H */
class for envelope based scoring using MapDistanceTransform
class for computing a distance transform of the density map
Fast alignment of points to a density map using principal components.
Abstract base class for all restraints.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition Restraint.h:56
Simple 3D transformation class.
Class for handling density maps.
Definition DensityMap.h:95
EnvelopeFitRestraint(Particles particles, DensityMap *em_map, double density_threshold, double penetration_threshold)
Constructor.
double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
IMP::ModelObjectsTemp do_get_inputs() const override
Vector< Pointer< Particle > > Particles
A list of reference-counted Particle objects.
Definition base_types.h:138
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
Helper macros for implementing IMP Objects.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144