8 #ifndef IMPNPCTRANSPORT_SIMULATION_DATA_H
9 #define IMPNPCTRANSPORT_SIMULATION_DATA_H
12 #include "npctransport_config.h"
30 #include <boost/unordered_map.hpp>
31 #include <boost/unordered_set.hpp>
39 IMPNPCTRANSPORT_BEGIN_NAMESPACE
44 #define IMPNPCTRANSPORT_VERSION 4.0
50 Parameter<double> output_npctransport_version_;
51 Parameter<double> box_side_;
52 Parameter<double> tunnel_radius_;
53 Parameter<double> tunnel_radius_k_;
54 Parameter<double> pore_anchored_beads_k_;
55 Parameter<double> slab_thickness_;
56 Parameter<int> box_is_on_;
57 Parameter<int> slab_is_on_;
58 Parameter<int> number_of_trials_;
59 Parameter<int> number_of_frames_;
60 Parameter<int> dump_interval_frames_;
61 Parameter<bool> is_backbone_harmonic_;
62 Parameter<double> backbone_tau_ns_;
63 Parameter<double> angular_d_factor_;
64 Parameter<double> range_;
65 Parameter<double> statistics_fraction_;
66 Parameter<int> statistics_interval_frames_;
67 Parameter<int> output_statistics_interval_frames_;
68 Parameter<int> full_output_statistics_interval_factor_;
69 Parameter<int> is_multiple_hdf5s_;
70 Parameter<double> time_step_;
71 Parameter<double> time_step_wave_factor_;
72 Parameter<double> maximum_number_of_minutes_;
73 Parameter<double> fg_anchor_inflate_factor_;
75 Parameter<int> is_exclude_floaters_from_slab_initially_;
76 Parameter<double> are_floaters_on_one_slab_side_;
77 Parameter<int> is_xyz_hist_stats_;
78 Parameter<double> xyz_stats_crop_factor_;
79 Parameter<double> xyz_stats_voxel_size_a_;
80 Parameter<double> xyz_stats_max_box_size_a_;
82 Parameter<double> initial_simulation_time_ns_;
83 Parameter<double> temperature_k_;
86 double get_output_npctransport_version()
const {
return output_npctransport_version_; }
91 int get_output_statistics_interval_frames()
const
92 {
return output_statistics_interval_frames_; }
94 int get_full_output_statistics_interval_factor()
const
95 {
return full_output_statistics_interval_factor_; }
98 bool get_is_multiple_hdf5s()
100 return is_multiple_hdf5s_;
105 {
return is_exclude_floaters_from_slab_initially_; }
111 {
return are_floaters_on_one_slab_side_;}
115 {
return is_xyz_hist_stats_; }
120 {
return xyz_stats_crop_factor_; }
124 {
return xyz_stats_voxel_size_a_; }
129 {
return xyz_stats_max_box_size_a_; }
133 {
return angular_d_factor_; }
166 ParticleTypeSet fg_bead_types_;
169 ParticleTypeSet fg_chain_types_;
170 ParticleTypeSet floater_types_;
171 ParticleTypeSet obstacle_types_;
175 boost::unordered_map<core::ParticleType, algebra::Sphere3Ds> sites_;
177 boost::unordered_map<core::ParticleType, double> ranges_;
180 std::string rmf_file_name_;
184 bool is_save_restraints_to_rmf_;
189 void create_slab_particle();
199 ( const ::npctransport_proto::Assignment_FGAssignment &fg_data );
209 void create_floaters(
210 const ::npctransport_proto::Assignment_FloaterAssignment &f_data,
220 void create_obstacles
221 ( const ::npctransport_proto::Assignment_ObstacleAssignment &o_data);
234 void initialize(std::string prev_output_file,
235 std::string new_output_file,
261 std::string rmf_file_name = std::string(),
262 std::string new_output_file =
"");
266 Model * get_model()
const {
275 Scoring * get_scoring();
279 Statistics* get_statistics();
285 Scoring
const* get_scoring()
const;
289 Statistics
const* get_statistics()
const;
302 void activate_statistics();
317 return fg_bead_types_.find(pt) != fg_bead_types_.end();
332 return fg_chain_types_.find(pt) != fg_chain_types_.end();
340 return fg_bead_types_;
346 return fg_chain_types_;
353 return floater_types_;
359 return obstacle_types_;
371 IMPCORE_DEPRECATED_METHOD_DECL(2.2)
372 atom::Hierarchies get_fg_chains()
const
373 {
return get_fg_chain_roots(); }
411 bool get_is_backbone_harmonic()
const
412 {
return is_backbone_harmonic_; }
414 double get_backbone_tau_ns()
const {
415 return backbone_tau_ns_;
418 double get_temperature_k()
const
419 {
return temperature_k_; }
423 {
return initial_simulation_time_ns_; }
446 if (sites_.find(t0) != sites_.end()) {
448 for(
unsigned int i = 0; i < sites.size(); i++){
449 ret.push_back(sites[i].get_center());
463 if (sites_.find(t0) != sites_.end()) {
464 return sites_.find(t0)->second;
472 IMP_USAGE_CHECK(sites.size()>0,
"trying to set zero sites for particle type"
488 return maximum_number_of_minutes_;
510 void remove_fgs_with_prefix(std::string s_fg_type);
521 void add_interaction(
522 const ::npctransport_proto::Assignment_InteractionAssignment &idata);
533 double get_bounding_box_size()
const;
537 void set_bounding_box_size(
double box_size);
541 double get_bounding_sphere_radius()
const;
545 void set_bounding_sphere_radius(
double sphere_radius);
547 double get_bounding_volume()
const;
551 void set_bounding_volume(
double volume_A3);
554 bool get_has_slab()
const {
return slab_is_on_!=0; }
558 {
return slab_is_on_==1; }
562 {
return slab_is_on_==2; }
568 if(!slab_particle_ && get_has_slab()){
573 return slab_particle_.get();
581 return box_is_on_==1;
586 return box_is_on_==2;
591 bool has_bounding_volume= (box_is_on_ != 0);
593 if(has_bounding_volume){
595 "Invalid box_is_on value (typically defined in protobuf)");
597 return has_bounding_volume;
623 void initialize_positions_from_rmf(RMF::FileConstHandle fh,
624 int frame_number = -1);
636 void link_rmf_file_handle(RMF::FileHandle fh,
bool is_restraints =
true);
667 void switch_suspend_rmf(
bool suspend);
672 void write_geometry(std::string out);
674 void dump_geometry();
683 unsigned int get_number_of_trials()
const {
return number_of_trials_; }
685 atom::Hierarchy
get_root()
const {
return atom::Hierarchy(root_); }
687 double get_slab_thickness()
const;
690 double get_tunnel_radius()
const;
694 return get_tunnel_radius();
700 return tunnel_radius_k_;
705 return get_tunnel_radius_k();
710 return get_has_slab() && get_tunnel_radius_k()>0.0;
713 double get_pore_anchored_beads_k()
const {
714 return pore_anchored_beads_k_;
719 int get_rmf_dump_interval_frames()
const {
return dump_interval_frames_; }
721 std::string get_rmf_file_name()
const {
return rmf_file_name_; }
740 void set_rmf_file(
const std::string &new_name,
741 bool is_save_restraints_to_rmf =
true,
742 bool is_force_restart=
false);
754 IMPNPCTRANSPORT_END_NAMESPACE
Apply a PairScore to each Pair in a list.
Particle * get_slab_particle() const
Simple Brownian dynamics optimizer.
#define IMP_IF_CHECK(level)
Execute the code block if a certain level checks are on.
double get_xyz_stats_max_box_size_A() const
void set_sites(core::ParticleType t0, const algebra::Sphere3Ds &sites)
algebra::Vector3Ds get_site_centers(core::ParticleType t0) const
scoring associated with a SimulationData object
A container for Singletons.
double get_xyz_stats_crop_factor() const
Particles & get_beads_byref()
Vector< VectorD< 3 > > Vector3Ds
The base class for geometry.
bool get_is_slab_with_toroidal_pore() const
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
double get_xyz_stats_voxel_size_A() const
return the voxel size in angstroms for the XYZ histogram
Store a set of PairContainers.
Storage of a model, its restraints, constraints and particles.
bool get_has_bounding_sphere() const
returns true if simulation has a bounding simulation sphere ('cell-like')
double get_maximum_number_of_minutes() const
Return the maximum number of minutes the simulation can run.
statistics and order parameters about the simulations that is associated with a SimulationData object...
Represent a cylinder in 3D.
bool get_is_pore_radius_dynamic() const
returns true if pore radius can change dynamically
Score particles based on a bounding box.
Dump the state of all associated objects into the RMF file.
double get_tunnel_radius_k() const
ParticleTypeSet const & get_fg_bead_types() const
ParticlesTemp get_beads()
Implement geometry for the basic shapes from IMP.algebra.
A particle with a user-defined type.
const std::string get_string() const
Turn a key into a pretty string.
double get_angular_d_factor() const
double get_site_display_radius(core::ParticleType) const
double get_initial_simulation_time_ns() const
Class for storing model, its restraints, constraints, and particles.
Decorator for helping deal with a hierarchy of molecules.
bool get_are_floaters_on_one_slab_side() const
Simple Brownian dynamics simulator.
bool get_is_slab_with_cylindrical_pore() const
bool get_has_bounding_volume() const
returns true if simulation has any bounding volume (box or sphere are supported)
The standard decorator for manipulating molecular structures.
Common base class for heavy weight IMP objects.
int get_number_of_frames(const ::npctransport_proto::Assignment &config, double time_step)
Return all pairs from a SingletonContainer.
bool get_is_exclude_floaters_from_slab_initially() const
A smart pointer to a ref-counted Object that is a class member.
algebra::Sphere3Ds get_sites(core::ParticleType t0) const
IMP::Vector< Sphere3D > Sphere3Ds
ParticleTypeSet const & get_floater_types() const
Store all parameters for a simulation.
ParticleTypeSet const & get_obstacle_types() const
double get_pore_radius() const
alias to get_tunnel_radius
bool get_is_fg_chain(core::ParticleType pt) const
double get_pore_radius_k() const
alias to get_tunnel_radius_k
A nullptr-initialized pointer to an IMP Object.
Periodically dump the state of all associated objects into the RMF file.
bool get_is_xyz_hist_stats() const
whether xyz histogram statistics are on (into HDF5 file)
double get_statistics_fraction() const
Hierarchy get_root(Hierarchy h)
Return the root of the hierarchy.
Class to handle individual particles of a Model object.
ParticleTypeSet const & get_fg_chain_types() const
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
bool get_has_bounding_box() const
returns true if simulation has a bounding simulation box
bool get_is_fg_bead(core::ParticleType pt) const
forward declaration of incomplete protobuf files for the main data structures used ...