IMP logo
IMP Reference Guide  2.11.0
The Integrative Modeling Platform
Scoring.h
Go to the documentation of this file.
1 /**
2  * \file npctransport/Scoring.h
3  * \brief scoring associated with a SimulationData object
4  *
5  * Copyright 2007-2019 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPNPCTRANSPORT_SCORING_H
9 #define IMPNPCTRANSPORT_SCORING_H
10 
11 #include "npctransport_config.h"
12 
13 #include "FGChain.h"
14 #include "npctransport_proto.fwd.h"
15 #include "Parameter.h"
16 // #include "SimulationData.h"
17 
18 #include <IMP/Model.h>
19 #include <IMP/PairContainer.h>
20 #include <IMP/ScoringFunction.h>
21 #include <IMP/atom/Hierarchy.h>
22 #include <IMP/Pointer.h>
23 #include <IMP/WeakPointer.h>
24 #include <boost/unordered_map.hpp>
31 #include <IMP/core/Typed.h>
33 #include "boost/tuple/tuple.hpp"
34 
35 #include <boost/timer.hpp>
36 #include <string>
37 
38 
39 IMPNPCTRANSPORT_BEGIN_NAMESPACE
40 
41 class SimulationData;
42 class LinearWellPairScore;
43 class HarmonicSpringSingletonScore;
44 //class FGChain;
45 
46 //! Scoring associated with a SimulationData object
47 class IMPNPCTRANSPORTEXPORT Scoring: public Object
48 {
49  private:
50  Parameter<int> box_is_on_;
51  Parameter<double> interaction_k_;
52  Parameter<double> interaction_range_;
53  Parameter<double> backbone_k_;
54  Parameter<bool> is_backbone_harmonic_;
55  Parameter<double> slack_;
56  Parameter<double> nonspecific_k_;
57  Parameter<double> nonspecific_range_;
58  Parameter<double> excluded_volume_k_;
59  Parameter<double> range_;
60  // Per type scaling factors for the interaction parameters
61  boost::unordered_map<core::ParticleType, double> interaction_range_factors_;
62  boost::unordered_map<core::ParticleType, double> interaction_k_factors_;
63 
64  private:
65 
66  // the sim-data that uses this scoring object
68 
69  /***************** Cache only variables ************/
70 
71  // see get_close_beads_container()
73  <IMP::PairContainer> close_beads_container_;
74 
75  // generates hash values ('predicates') for ordered types pairs
76  // (e.g., pairs of ParticleTypes)
79 
81  <IMP::core::RestraintsScoringFunction> scoring_function_;
82  IMP::Restraints scoring_function_rs_; // the restraints associated with the last created scoring_function_, valid only when it is not null
83 
84  // contains all restraints between pairs of particle types
87 
88  typedef boost::unordered_map< int, PointerMember<IMP::PairScore > >
89  t_map_pair_type_to_pair_score;
90  // scores between particle, mapped by their interaction id,
91  // where interaction id is from OrderedTypePairPredicate otpp_
92  // applied on each interacting particle type
93  t_map_pair_type_to_pair_score
94  interaction_pair_scores_;
95 
97  <IMP::Restraint> box_restraint_;
98 
100  <IMP::Restraint> slab_restraint_;
101 
102  // scores on anchor particles
103  IMP::Restraints anchor_restraints_;
104 
105  // pore radius restraint
107  <IMP::Restraint> pore_radius_restraint_;
108 
109  // a map from particle indexes of chain identifiers to corresponding
110  // chain backbone restraints (see chain_ids_map)
111  typedef boost::unordered_set
112  < PointerMember<FGChain> > FGChainsSet;
113  FGChainsSet chains_set_;
114  // a map from particle indexes of chain beads to the chain objects that they
115  // represent (TODO: probably can be obliterated by adding appropriate
116  // decorators)
117  typedef boost::unordered_map
119  t_particle_index_to_fg_chain_map;
120  t_particle_index_to_fg_chain_map bead_to_chain_map_;
121 
122  // particles to be z-biased on call to get_z_bias_restraints()
123  // with key being the k value of each particle subset
124  typedef boost::unordered_map<double, ParticlesTemp> t_z_bias_particles_map;
125  t_z_bias_particles_map z_bias_particles_map_;
126 
127  // restraints for z-biasing particles (plural for different k force constants)
128  IMP::Restraints z_bias_restraints_;
129 
130  // custom restraints that are added to the scoring function
131  IMP::Restraints custom_restraints_;
132 
133 
134  public:
135  /**
136  @param[in] owner_sd npc simulation data object that owns this scoring
137  object
138  @param[out] data protobuf data with parameters for
139  this assignment, used to parameterize
140  the scoring function
141  */
142  Scoring(SimulationData* owner_sd,
143  const ::npctransport_proto::Assignment &data);
144 
145 
146  /**
147  returns a scoring function for the NPC simulation, based on:
148  1) the chain restraints added by add_chain_restraints()
149  2) default repulsive interactions on particles in get_beads()
150  3) attractive interactions that depend on pair types, as added by
151  add_interaction()
152  4) the slab or bounding box restraints if relevant on all particles
153  in get_beads()
154  5) z-biasing potential if add_z_bias_restraint() was called for any
155  particles
156 
157  @param if force_update is true, forces recreation of the scoring function,
158  o/w cached version may be retrieved if available, which may not
159  be completely up to date.
160 
161  @note if force_udpate=false, might fail to include e.g., new particles
162  or new interactions that were added after the last call
163  */
164  IMP::ScoringFunction* get_scoring_function(bool force_update=false);
165 
166  /**
167  returns the restrains associated with the scoring function return by
168  get_scoring_function(force_update)
169  */
171  get_scoring_function_restraints(bool force_update=false);
172 
173 
174  /**
175  returns a custom scoring function for the NPC simulation, based on:
176  1) the chain restraints added by add_chain_restraints()
177  that overlap with 'particles'
178  2) default repulsive interactions between particles in particles
179  and optimizable particles
180  3) attractive interactions that depend on pair types, as added by
181  add_interaction()
182  4) the slab or bounding box restraints if relevant on all particles
183  in 'particles'
184 
185  @param extra_restraints ad-hoc restraints to be added to scoring function
186  @param non_optimizable_beads particles container on which to apply bounding volume
187  and pair constraints only if they also involve optimizable beads
188  @param optimizable_beads particles container on which to apply bounding volume
189  and pair contstraints, either with other optimizable beads or with
190  non-optimizable ones.
191  @param is_attr_interactions_on if false, only repulsive interactions will be
192  computed between pairs of particles
193  @note it is assumed the two sets of beads are disjoint
194  */
196  get_custom_scoring_function
197  ( const RestraintsTemp& extra_restraints,
198  SingletonContainerAdaptor non_optimizable_beads,
199  SingletonContainerAdaptor optimizable_beads,
200  bool is_attr_interactions_on = true ) const;
201 
202  //! same as other get_custom_scoring_function variant but
203  //! based on a list of particle indexes and allowing an empty vector
204  //! of non-optimizable beads as input
205  //! @note The optimizable beads are still
206  //! treated dynamically (e.g. if they're associated with a dynamic container)
208  get_custom_scoring_function
209  ( const RestraintsTemp& extra_restraints,
210  ParticleIndexes non_optimizable_beads,
211  SingletonContainerAdaptor optimizable_beads,
212  bool is_attr_interactions_on = true ) const
213  {
215  nob_lsc,
216  (get_model(), non_optimizable_beads));
217  return get_custom_scoring_function(extra_restraints,
218  nob_lsc,
219  optimizable_beads,
220  is_attr_interactions_on);
221  }
222 
223 
224  /**
225  a pair container that was used to define interaction particles
226  that will be used in the next call to get_scoring_function(false)
227  (so manipulating it might affect the scoring function)
228 
229  @param update if true, forces recreation of the cached container,
230  o/w cached version that was used in last call to
231  get_scoring_function() or to this function will
232  be used
233 
234  @return a container with all pairs of particles (a,b) such that:
235  1) a is an optimizable bead particle and b is any bead
236  particle (static or not).
237  2) a and b are close (sphere surfaces within range get_range()+some slack)
238  3) a and b do not appear consecutively within the model (e.g., bonded fg motifs)
239  4) a and b are not the same particles
240  5) b and a do not appear on the list (= unordered list)
241 
242  @note if udpate=false, might fail to include e.g., new particles
243  or new interactions that were added after the last call
244  @note TODO: right now will not return any consecutive particles - that's
245  erroneous (e.g., last particle of one chain and first particle
246  of next chain) though may be negligible in practice
247  @note supposed to be robust to dynamic changes to the beads list,
248  though need to double check (TODO)
249  */
250  IMP::PairContainer *get_close_beads_container(bool update=false);
251 
252  /**
253  Returns the restraints over pairs of particles based on their type,
254  which will be used in the next call to get_scoring_function(false)
255  (so manipulating it might affect the scoring function). Also, if update
256  is false, then it is guaranteed that these are the same restraints
257  used by the last call to get_scoring_function()
258 
259  Different scores are used for particles of different (ordered)
260  particle types. When called for the first time, returns a new
261  PredicatePairsRestraints over all diffusing particles and sets a
262  default linear repulsion restraint between all pairs returned by
263  get_close_beads_container()
264 
265  @param update if true, forces recreation of the cached container,
266  o/w cached version that was used in last call to
267  get_scoring_function(), if applicable
268 
269  @note if udpate=false, might fail to include e.g., new particles
270  or new interactions that were added to the simulation
271  after the last call
272  */
273  container::PredicatePairsRestraint *get_predicates_pair_restraint
274  (bool update=false);
275 
276 
277  /** returns the box/sphere restraint on >get_sd()->get_beads()
278  which will be used in the next call to get_scoring_function(false)
279  (so manipulating it might affect the scoring function). If update
280  is false, then it is guaranteed that these are the same restraints
281  used by the last call to get_scoring_function.
282 
283  @param update if true, forces recreation of the cached container,
284  o/w cached version that was used in last call to
285  get_scoring_function(), if applicable
286 
287  @note if udpate=false, might fail to include e.g., new particles
288  that were added after the last call
289 
290  @see get_has_bounding_box(), get_has_bounding_sphere(),
291  get_has_bounding_volume()
292  */
293  Restraint *get_bounding_volume_restraint(bool update=false);
294 
295 
296  /** returns the slab restraint on >get_sd()->get_beads()
297  which will be used in the next call to get_scoring_function(false)
298  (so manipulating it might affect the scoring function). Also, if update
299  is false, then it is guaranteed that these are the same restraints
300  used by the last call to get_scoring_function()
301 
302  @param update if true, forces recreation of the cached container,
303  o/w cached version that was used in last call to
304  get_scoring_function(), if applicable
305 
306  @note if udpate=false, might fail to include e.g., new particles
307  that were added after the last call
308  */
309  Restraint *get_slab_restraint(bool update=false);
310 
311 
312  // swig doesn't equate the two protobuf types
313  /**
314  add a SitesPairScore restraint that applies to particles of
315  types t0 and t1 (specified in idata) to the PredicatePairsRestraint
316  object that is returned by get_predr().
317  The restraint is symmetric, and applies to both (t0,t1) and (t1,t0).
318 
319  A SitesPairScore restraint means site-specific
320  attractive forces between surface binding sites on each particle +
321  non-specific attraction and soft repulsion between the entire particles.
322 
323  @param idata the protobuf data about the interaction (particle types,
324  interaction coefficients, etc.)
325 
326  \see SitesPairScore
327  */
328  void add_interaction
329  ( const ::npctransport_proto::Assignment_InteractionAssignment &idata);
330 
331 
332 
333 
334 
335  /***************************************************************/
336  /***************************** Creators ************************/
337  /***************************************************************/
338 
339  /**
340  creates a new pair container that returns all pairs of particles (a,b) such that:
341  1) a is any particle from 'non_optimizable_beads' or 'optimizable beads',
342  and b is any particle in 'optimizable_beads'
343  2) a and b are close (sphere surfaces within range get_range())
344  3) a and b do not appear consecutively within the model (e.g., fg repeats)
345  4) a is not b
346  5) b and a do not appear in the list (effectively, a list of unordered pairs)
347 
348  @param non_optimizable_beads a container for particles that are assumed to be non-optimizable
349  and therefore are not paired among themselves
350  @param optimizable_beads A container for particles that are assumed to be optimizable, and may
351  be paired among themselves or with non_optimizable_beads
352  @note it is assumed the two sets of beads are disjoint
353  */
354  IMP::PairContainer *create_close_beads_container
355  ( SingletonContainerAdaptor non_optimiziable_beads,
356  SingletonContainerAdaptor optimizable_beads)
357  const;
358 
359  //! same as other create_close_beads_container variant but
360  //! based on a list of particle indexes and allowing an empty vector
361  //! of non-optimizable beads as input. The optimizable beads are still
362  //! treated dynamically (e.g. if they're associated with a dynamic container)
363  IMP::PairContainer *create_close_beads_container
364  ( ParticleIndexes non_optimizable_beads,
365  SingletonContainerAdaptor optimizable_beads)
366  const
367  {
369  nob_lsc,
370  (get_model(), non_optimizable_beads));
371  return create_close_beads_container(nob_lsc,
372  optimizable_beads);
373  }
374 
375 
376  /**
377  Creates a new container for restraints over pairs of beads. Different
378  scores are used for beads of different (ordered) particle types
379  based on interaction_pair_scores, or just a default linear repulsive
380  with k=get_excluded_volume_k() force on all other pairs in bead_pairs.
381 
382  @param bead_pairs a container for the pairs of beads to be restrained
383  @param is_attr_interactions_on whether to include attractive interactions
384  that were added by add_interaction()
385  */
386  container::PredicatePairsRestraint *create_predicates_pair_restraint
387  ( PairContainer* bead_pairs,
388  bool is_attr_interactions_on = true) const;
389 
390  /**
391  Creates bounding volume (box or sphere) restraint based on the
392  box_size_ class variable and get_has_bounding_sphere() and
393  get_has_bounding_box() variables (typically based on box_is_on_),
394  , and apply it to all beads returned by get_sd()->get_beads()
395 
396  @param beads beads on which to apply the constraint
397 
398  @note this restraint is (supposed to) guarantee to be always
399  updated with the list inside the container
400 
401  @return a newly created box restraint
402  */
403  Restraint* create_bounding_volume_restraint
404  ( SingletonContainerAdaptor beads ) const;
405 
406  /**
407  Creates slab bounding volume restraint, based on the slab_thickness_
408  and tunnel_radius_ class variables, and apply it to all beads
409  returned by get_sd()->get_beads()
410 
411  @param beads beads on which to apply the constraint
412 
413  @note this restraint is (supposed to) guarantee to be always
414  updated with the list inside the container
415 
416  @return a newly created slab restraint
417  */
418  Restraint* create_slab_restraint
419  ( SingletonContainerAdaptor beads ) const;
420 
421 
422  /************************************************************/
423  /************* various simple getters and setters *******************/
424  /************************************************************/
425 
426  /** returns the model associated with the owned SimulationData */
427  Model* get_model();
428 
429 #ifndef SWIG
430  /** returns the model associated with the owned SimulationData */
431  Model* get_model() const;
432 #endif
433 
434 
435  /** return the SimulationData object that owns this ScoringFunction */
437  return owner_sd_;
438  }
439 
440 #ifndef SWIG
441  /** return the SimulationData object that owns this ScoringFunction */
442  SimulationData const* get_sd() const{
443  return owner_sd_;
444  }
445 #endif
446 
447  //! returns true if simulation has a bounding simulation box
448  bool get_has_bounding_box() const {
449  return box_is_on_==1;
450  }
451 
452  //! returns true if simulation has a bounding simulation sphere ('cell-like')
453  bool get_has_bounding_sphere() const {
454  return box_is_on_==2;
455  }
456 
457  //! returns true if simulation has any bounding volume (box or sphere are supported)
458  bool get_has_bounding_volume() const {
459  return get_has_bounding_box() || get_has_bounding_sphere();
460  }
461 
462  /** returns the default spring constant between consecutive beads
463  in a chain of beads - this is used for chains whose k
464  is non-positive
465  */
466  double get_default_backbone_k() const { return backbone_k_; }
467 
468  bool get_is_backbone_harmonic() const { return is_backbone_harmonic_; }
469 
470 #ifndef SWIG
471  //! Create a backbone bond restraint over beads according to class flags
472  /** create a backbone bond restraint with specified rest_length_factor
473  (relative to sum of spheres radii) and backbone k over beads. The restraint score
474  type is according to the class flags - either a linear or
475  harmonic potential, with k in units of kcal/mol/A or kcal/mol/A^2,
476  respectively, with the harmonic potential corresponding to a relaxing
477  spring.
478 
479  returns both the restraint and the linear well pair score or harmonic
480  singleton score that is used in it (which one depends on the IMP version,
481  assigns nullptr to the other), as a pointer to a generic object (= common
482  ancestor class)
483  */
484  boost::tuple< Restraint*, Object*>
485  create_backbone_restraint
486  ( double rest_length_factor,
487  double backbone_k,
488  ParticlesTemp beads,
489  std::string name) const;
490 #endif
491 
492  /** returns the constant force applied by overlapping spheres on each
493  other
494  */
495  double get_excluded_volume_k() const { return excluded_volume_k_; }
496 
497  /** returns the default interaction constant, which is used
498  only if interaction_k is not specified for a certain interaction */
499  double get_interaction_k() const { return interaction_k_; }
500 
501  //! returns the pair score for particles of types t1 and t2 */
502  IMP::PairScore const* get_predicate_pair_score
503  ( core::ParticleType t1, core::ParticleType t2) const;
504 
505  //! returns the pair score for particles of types t1 and t2 */
506  IMP::PairScore* get_predicate_pair_score
508 
509 
510  /** @return maximal actual interaction range (normalized by
511  range factors) for a given interaction type, as set by
512  add_interaction(), over site-site and/or non-specific
513  interactions if applicable. If not applicable, returns -1.0
514 
515  @param t1,t2 the types of beads in this interaction
516  @param site_specific include site-site ranges
517  @param non_specific include non-specific sphere interaction ranges
518  @note if both site_specific and non_specific are true, takes a
519  maximum over both.
520  */
521  double get_interaction_range_for
523  bool site_specific = true,
524  bool non_specific = false) const;
525 
526 #ifndef SWIG
527  //! return various statistics about site-site interactions
528  //! between pi1 and pi2
529  /**
530  return a tuple with:
531  a - number of site-site interaction that contribute
532  to the score between pi1 and pi2 in the model, based on their
533  current coordinates and their particle types
534  b - vector of occupied pi1 sites counts (count number of interactions per site)
535  c - vector of occupied pi2 sites counts (count number of interactions per site)
536  d - true if particles are interacting non-specifically (a non-zero contribution of non-specific terms)
537  */
538  boost::tuple< unsigned int,
539  std::vector<unsigned int>,
540  std::vector<unsigned int>,
541  bool >
542  get_site_interactions_statistics
543  ( ParticleIndex pi1, ParticleIndex pi2) const;
544 
545  //! return various statistics about site-site interactions
546  //! between p1 and p2
547  /**
548  return a tuple with:
549  a) number of site-site interaction that contribute
550  to the score between p1 and p2 in the model, based on their
551  current coordinates and their particle types
552  b) vector of occupied pi1 sites counts (count number of interactions per site)
553  c) vector of occupied pi2 sites counts (count number of interactions per site)
554  */
555  boost::tuple< unsigned int, std::vector<unsigned int>, std::vector<unsigned int>, bool >
556  get_site_interactions_statistics
557  ( Particle const* p1, Particle const* p2) const
558  {
559  return
560  get_site_interactions_statistics
561  (p1->get_index(), p2->get_index());
562  }
563 #endif
564 
565 
566  core::OrderedTypePairPredicate* get_ordered_type_pair_predicate()
567  { return otpp_; }
568 
569 #ifndef SWIG
570  core::OrderedTypePairPredicate const* get_ordered_type_pair_predicate() const
571  { return otpp_; }
572 #endif
573 
574  /** add FG chain to this scoring object, using the
575  chain->get_chain_restraints() method to retrieve the restraints
576  upon a call to get_scoring_function() or create_scoring_function(),
577  etc.
578 
579  @param chain an FG chain associated with internal scoring
580 
581  @return pointer to the newly created restraint
582 
583  @note if the chain->get_backbone_k() is non-positive, it is reset to
584  this->get_default_backbone_k()
585 
586  @note this method assumes that all such chains will be disjoint
587  and so it is later possible to use
588  container::ExclusiveConsecutivePairFilter to filter out all
589  pairs of particles connected by such chain restraints.
590  */
591  void add_chain_restraints(FGChain* chain);
592 
593 
594  /**
595  returns restraints on all fg nup chains that were added by
596  add_chain_restraints() so far and contain any bead in 'beads'.
597  The restraints are updated directly from the original chain objects
598  chain->get_chain_restraints() object.
599 
600  @param beads a least of chain fine beads over which restraints are
601  collected
602 
603  @return a list of all chain restraints that have been added so far
604  and contain beads in 'beads'
605  */
606  Restraints get_chain_restraints_on
607  ( SingletonContainerAdaptor beads ) const;
608 
609  /**
610  @return all restraints of fg nup chains that were added by
611  add_chain_restraints() so far
612  */
613  Restraints get_all_chain_restraints() const;
614 
615  //! remove all scoring function elements related to particle type pt
616  //! NOTE: a few aspects of the scoring function do not support this function
617  //! as of 2018-06-19 - namely anchor restraints and z coordinate bias
618  void remove_particle_type(core::ParticleType pt);
619 
620  /**
621  adds a biasing potential for particles ps towards z, to the restraints
622  returned by get_z_bias_restraints(), and for the scoring function
623  generated by get_scoring_function()
624 
625  @param ps container for the particles to be biased
626  @param k force constant
627 
628  \see get_z_bias_restraints()
629  \see get_scoring_function()
630  */
631  void add_z_bias_restraint(SingletonContainerAdaptor ps, double k);
632 
633  /**
634  adds a biasing potential for particle p towards z, to the restraints
635  returned by get_z_bias_restraints(), and for the scoring function
636  generated by get_scoring_function()
637 
638 
639  @param p the particle to be biased
640  @param k force constant
641  */
642  void add_z_bias_restraint(Particle* p, double k);
643 
644  /**
645  return z_bias restraints for all particles that were added using
646  add_z_bias_restraint()
647  */
648  IMP::Restraints get_z_bias_restraints();
649 
650  /**
651  create a z bias restraint pulling along z-axis for the particles
652  in ps. If a slab is present, the force acts only within tunnel radius
653  distance from its central axis.
654 
655  @param ps the particles container
656  @param k force constant for biasing ps
657  */
658  IMP::Restraint* create_z_bias_restraint(SingletonContainerAdaptor ps,
659  double k) const;
660 
661  void add_custom_restraint(IMP::Restraint* r)
662  { custom_restraints_.push_back(r); }
663 
664  void add_custom_restraints(IMP::Restraints R)
665  { custom_restraints_ += R; }
666 
667  void clear_custom_restraints()
668  { custom_restraints_.clear(); }
669 
670  IMP::Restraints get_custom_restraints() const
671  { return custom_restraints_; }
672 
673  /**
674  add anchor bead to scoring function, using current position of p
675  as equilibrium position relative to pore
676 
677  @param p anchored particle
678 
679  @note currently only cylindrical pore case is supported
680  */
681  void add_restrained_anchor_bead(IMP::Particle* p);
682 
683  Restraint* get_pore_radius_restraint() const;
684 
685 #ifndef SWIG
686  /**
687  returns pointers to the collection of the FG Chains stored in
688  this scoring object (can be used to e.g. scale scoring
689  information up or down during optimization)
690  */
692  return FGChains(chains_set_.begin(), chains_set_.end());
693  }
694 #endif
695 
696  double get_range() const { return range_; }
697 
698  /**
699  sets the multiplicative scaling of the interaction range for
700  pair interactions involving a particle of this type, for all
701  future calls to add_interaction()
702  */
703  void set_interaction_range_factor
704  ( IMP::core::ParticleType type, double value )
705  {
706  IMP_ALWAYS_CHECK(value>0, "interaction_range_factor must be positive",
708  interaction_range_factors_[type] = value;
709  }
710 
711  /**
712  sets the multiplicative scaling of the interaction k constants for
713  pair interactions involving a particle of this type, for all future
714  calls to add_interaction()
715  */
716  void set_interaction_k_factor
717  ( IMP::core::ParticleType type, double value )
718  {
719  IMP_ALWAYS_CHECK(value>0, "interaction_k_factor must be positive",
721  interaction_k_factors_[type] = value;
722  }
723 
724  private:
725 
726  public:
728 };
729 
730 
731 
732 
733 IMPNPCTRANSPORT_END_NAMESPACE
734 
735 #endif /* IMPNPCTRANSPORT_SCORING_H */
Abstract class for scoring object(s) of type ParticleIndexPair.
Definition: PairScore.h:37
A shared container for Pairs.
Definition: PairContainer.h:37
Apply a PairScore to each Pair in a list.
SimulationData const * get_sd() const
Definition: Scoring.h:442
IMP::Vector< IMP::Pointer< Restraint > > Restraints
Definition: base_types.h:79
Store a list of ParticleIndexes.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Store a set of PairContainers.
Storage of a model, its restraints, constraints and particles.
Applies a PairScore to each Pair in a list based on a predicate.
Index< ParticleIndexTag > ParticleIndex
Definition: base_types.h:154
bool get_has_bounding_sphere() const
returns true if simulation has a bounding simulation sphere ('cell-like')
Definition: Scoring.h:453
Score particles based on a bounding box.
Key< 34897493 > ParticleType
An IMP::Key object for identifying types of particles by strings.
Definition: Typed.h:28
creating TAMD chains
A weak pointer to an Object or RefCountedObject.
Definition: WeakPointer.h:32
description
A particle with a user-defined type.
double get_excluded_volume_k() const
Definition: Scoring.h:495
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Definition: object_macros.h:64
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Decorator for helping deal with a hierarchy of molecules.
bool get_has_bounding_box() const
returns true if simulation has a bounding simulation box
Definition: Scoring.h:448
A container for Pairs.
Scoring associated with a SimulationData object.
Definition: Scoring.h:47
Common base class for heavy weight IMP objects.
Definition: Object.h:106
Store a list of ParticleIndexes.
Return all pairs from a SingletonContainer.
SimulationData * get_sd()
Definition: Scoring.h:436
IMP::Vector< IMP::Pointer< FGChain > > FGChains
Definition: FGChain.h:190
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
double get_default_backbone_k() const
Definition: Scoring.h:466
A nullptr-initialized pointer to an Object.
Store all parameters for a simulation.
A nullptr-initialized pointer to an IMP Object.
Represents a scoring function on the model.
double get_interaction_k() const
Definition: Scoring.h:499
Represents a scoring function on the model.
Define some predicates.
Class to handle individual particles of a Model object.
Definition: Particle.h:41
bool get_has_bounding_volume() const
returns true if simulation has any bounding volume (box or sphere are supported)
Definition: Scoring.h:458
ParticleIndex get_index() const
returns the particle index of this particle in its model
FGChains get_fg_chains()
Definition: Scoring.h:691
Storage of a model, its restraints, constraints and particles.
#define IMP_ALWAYS_CHECK(condition, message, exception_name)
Throw an exception if a check fails.
Definition: check_macros.h:61
An exception for an invalid value being passed to IMP.
Definition: exception.h:137
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:54
forward declaration of incomplete protobuf files for the main data structures used ...