8#ifndef IMPNPCTRANSPORT_SCORING_H
9#define IMPNPCTRANSPORT_SCORING_H
11#include "npctransport_config.h"
24#include <boost/unordered_map.hpp>
33#include <IMP/internal/SimpleTimer.h>
34#include "boost/tuple/tuple.hpp"
39IMPNPCTRANSPORT_BEGIN_NAMESPACE
42class LinearWellPairScore;
43class HarmonicSpringSingletonScore;
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_;
61 boost::unordered_map<core::ParticleType, double> interaction_range_factors_;
62 boost::unordered_map<core::ParticleType, double> interaction_k_factors_;
88 typedef boost::unordered_map< int, PointerMember<IMP::PairScore > >
89 t_map_pair_type_to_pair_score;
93 t_map_pair_type_to_pair_score
94 interaction_pair_scores_;
111 typedef boost::unordered_set
113 FGChainsSet chains_set_;
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_;
124 typedef boost::unordered_map<double, ParticlesTemp> t_z_bias_particles_map;
125 t_z_bias_particles_map z_bias_particles_map_;
143 const ::npctransport_proto::Assignment &data);
200 bool is_attr_interactions_on =
true )
const;
212 bool is_attr_interactions_on =
true )
const
220 is_attr_interactions_on);
329 ( const ::npctransport_proto::Assignment_InteractionAssignment &idata);
388 bool is_attr_interactions_on =
true)
const;
449 return box_is_on_==1;
454 return box_is_on_==2;
468 bool get_is_backbone_harmonic()
const {
return is_backbone_harmonic_; }
484 boost::tuple< Restraint*, Object*>
486 (
double rest_length_factor,
489 std::string name)
const;
523 bool site_specific =
true,
524 bool non_specific =
false)
const;
538 boost::tuple<
unsigned int,
539 std::vector<unsigned int>,
540 std::vector<unsigned int>,
555 boost::tuple< unsigned int, std::vector<unsigned int>, std::vector<unsigned int>,
bool >
561 (p1->get_index(), p2->get_index());
666 { custom_restraints_.push_back(r); }
669 { custom_restraints_ += R; }
671 void clear_custom_restraints()
672 { custom_restraints_.clear(); }
675 {
return custom_restraints_; }
687 Restraint* get_pore_radius_restraint()
const;
696 return FGChains(chains_set_.begin(), chains_set_.end());
700 double get_range()
const {
return range_; }
712 interaction_range_factors_[type] = value;
725 interaction_k_factors_[type] = value;
737IMPNPCTRANSPORT_END_NAMESPACE
Score particles based on a bounding box.
Return all pairs from a SingletonContainer.
Store a list of ParticleIndexes.
Storage of a model, its restraints, constraints and particles.
Store a set of PairContainers.
A nullptr-initialized pointer to an IMP Object.
Apply a PairScore to each Pair in a list.
A scoring function on a list of restraints.
Represents a scoring function on the model.
A particle with a user-defined type.
A weak pointer to an Object or RefCountedObject.
Decorator for helping deal with a hierarchy of molecules.
#define IMP_ALWAYS_CHECK(condition, message, exception_name)
Throw an exception if a check fails.
Class for storing model, its restraints, constraints, and particles.
Object(std::string name)
Construct an object with the given name.
A shared container for Pairs.
Abstract class for scoring object(s) of type ParticleIndexPair.
Class to handle individual particles of a Model object.
A restraint is a term in an IMP ScoringFunction.
Represents a scoring function on the model.
An exception for an invalid value being passed to IMP.
Store a list of ParticleIndexes.
Applies a PairScore to each Pair in a list based on a predicate.
Return a unique predicate value for each ordered set of ParticleTypes.
Create a scoring function on a list of restraints.
IMP::PairContainer * create_close_beads_container(ParticleIndexes non_optimizable_beads, SingletonContainerAdaptor optimizable_beads) const
container::PredicatePairsRestraint * create_predicates_pair_restraint(PairContainer *bead_pairs, bool is_attr_interactions_on=true) const
Restraints get_chain_restraints_on(SingletonContainerAdaptor beads) const
IMP::Restraints get_scoring_function_restraints(bool force_update=false)
void add_chain_restraints(FGChain *chain)
IMP::ScoringFunction * get_custom_scoring_function(const RestraintsTemp &extra_restraints, SingletonContainerAdaptor non_optimizable_beads, SingletonContainerAdaptor optimizable_beads, bool is_attr_interactions_on=true) const
double get_excluded_volume_k() const
void add_z_bias_restraint(SingletonContainerAdaptor ps, double k, double z)
void remove_particle_type(core::ParticleType pt)
double get_interaction_k() const
bool get_has_bounding_box() const
returns true if simulation has a bounding simulation box
Restraint * get_bounding_volume_restraint(bool update=false)
void add_restrained_anchor_bead(IMP::Particle *p)
boost::tuple< unsigned int, std::vector< unsigned int >, std::vector< unsigned int >, bool > get_site_interactions_statistics(ParticleIndex pi1, ParticleIndex pi2) const
IMP::PairScore const * get_predicate_pair_score(core::ParticleType t1, core::ParticleType t2) const
returns the pair score for particles of types t1 and t2 */
IMP::ScoringFunction * get_custom_scoring_function(const RestraintsTemp &extra_restraints, ParticleIndexes non_optimizable_beads, SingletonContainerAdaptor optimizable_beads, bool is_attr_interactions_on=true) const
Model * get_model() const
Scoring(SimulationData *owner_sd, const ::npctransport_proto::Assignment &data)
SimulationData const * get_sd() const
IMP::PairContainer * create_close_beads_container(SingletonContainerAdaptor non_optimiziable_beads, SingletonContainerAdaptor optimizable_beads) const
Restraints get_all_chain_restraints() const
IMP::Restraints get_z_bias_restraints()
Restraint * create_bounding_volume_restraint(SingletonContainerAdaptor beads) const
IMP::PairScore * get_predicate_pair_score(core::ParticleType t1, core::ParticleType t2)
returns the pair score for particles of types t1 and t2 */
void set_interaction_range_factor(IMP::core::ParticleType type, double value)
double get_default_backbone_k() const
IMP::Restraint * create_z_bias_restraint(SingletonContainerAdaptor ps, double k, double z) const
boost::tuple< Restraint *, Object * > create_backbone_restraint(double rest_length_factor, double backbone_k, ParticlesTemp beads, std::string name) const
Create a backbone bond restraint over beads according to class flags.
bool get_has_bounding_sphere() const
returns true if simulation has a bounding simulation sphere ('cell-like')
IMP::PairContainer * get_close_beads_container(bool update=false)
bool get_has_bounding_volume() const
returns true if simulation has any bounding volume (box or sphere are supported)
IMP::ScoringFunction * get_scoring_function(bool force_update=false)
void set_interaction_k_factor(IMP::core::ParticleType type, double value)
Restraint * create_slab_restraint(SingletonContainerAdaptor beads) const
boost::tuple< unsigned int, std::vector< unsigned int >, std::vector< unsigned int >, bool > get_site_interactions_statistics(Particle const *p1, Particle const *p2) const
SimulationData * get_sd()
void add_interaction(const ::npctransport_proto::Assignment_InteractionAssignment &idata)
Restraint * get_slab_restraint(bool update=false)
double get_interaction_range_for(core::ParticleType t1, core::ParticleType t2, bool site_specific=true, bool non_specific=false) const
void add_z_bias_restraint(Particle *p, double k, double z)
container::PredicatePairsRestraint * get_predicates_pair_restraint(bool update=false)
Store all parameters for a simulation.
Key< 34897493 > ParticleType
An IMP::Key object for identifying types of particles by strings.
IMP::Vector< IMP::Pointer< FGChain > > FGChains
Index< ParticleIndexTag > ParticleIndex
IMP::Vector< IMP::Pointer< Restraint > > Restraints
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
IMP::Vector< IMP::WeakPointer< Restraint > > RestraintsTemp
forward declaration of incomplete protobuf files for the main data structures used
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
#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.
A weak pointer to an Object or RefCountedObject.