IMP logo
IMP Reference Guide  2.20.2
The Integrative Modeling Platform
IMP::npctransport::SimulationData Class Reference

Store all parameters for a simulation. More...

#include <IMP/npctransport/SimulationData.h>

+ Inheritance diagram for IMP::npctransport::SimulationData:

Detailed Description

Store all parameters for a simulation.

Definition at line 47 of file SimulationData.h.

Public Member Functions

 SimulationData (std::string prev_output_file, bool quick, std::string rmf_file_name=std::string(), std::string new_output_file="")
 
void activate_statistics ()
 by adding all appropriate optimizer states, if they weren't already More...
 
void add_interaction (const ::npctransport_proto::Assignment_InteractionAssignment &idata)
 
void dump_geometry ()
 
double get_angular_d_factor () const
 
bool get_are_floaters_on_one_slab_side () const
 
double get_backbone_tau_ns () const
 
atom::BrownianDynamicsget_bd (bool recreate=false)
 
ParticlesTemp get_beads ()
 
Particlesget_beads_byref ()
 
algebra::BoundingBox3D get_bounding_box () const
 
double get_bounding_box_size () const
 
algebra::Sphere3D get_bounding_sphere () const
 
double get_bounding_sphere_radius () const
 
double get_bounding_volume () const
 
algebra::Cylinder3D get_cylinder () const
 
ParticleTypeSet const & get_fg_bead_types () const
 
atom::Hierarchies get_fg_chain_roots () const
 
ParticleTypeSet const & get_fg_chain_types () const
 
atom::Hierarchies get_fg_chains () const
 
ParticleTypeSet const & get_floater_types () const
 
int get_full_output_statistics_interval_factor () const
 
bool get_has_bounding_box () const
 returns true if simulation has a bounding simulation box More...
 
bool get_has_bounding_sphere () const
 returns true if simulation has a bounding simulation sphere ('cell-like') More...
 
bool get_has_bounding_volume () const
 returns true if simulation has any bounding volume (box or sphere are supported) More...
 
bool get_has_slab () const
 
double get_initial_simulation_time_ns () const
 
bool get_is_backbone_harmonic () const
 
bool get_is_exclude_floaters_from_slab_initially () const
 
bool get_is_fg_bead (ParticleIndex pi) const
 
bool get_is_fg_bead (core::ParticleType pt) const
 
bool get_is_fg_chain (ParticleIndex pi) const
 
bool get_is_fg_chain (core::ParticleType pt) const
 
bool get_is_multiple_hdf5s ()
 
bool get_is_pore_radius_dynamic () const
 returns true if pore radius can change dynamically More...
 
bool get_is_slab_with_cylindrical_pore () const
 
bool get_is_slab_with_toroidal_pore () const
 
bool get_is_xyz_hist_stats () const
 whether xyz histogram statistics are on (into HDF5 file) More...
 
double get_maximum_number_of_minutes () const
 Return the maximum number of minutes the simulation can run. More...
 
Modelget_model ()
 
Modelget_model () const
 
ParticlesTemp get_non_optimizable_beads ()
 
unsigned int get_number_of_frames () const
 
unsigned int get_number_of_trials () const
 
ParticlesTemp get_obstacle_particles () const
 
ParticleTypeSet const & get_obstacle_types () const
 
ParticlesTemp get_optimizable_beads ()
 
double get_output_npctransport_version () const
 
int get_output_statistics_interval_frames () const
 
double get_pore_anchored_beads_k () const
 
double get_pore_radius () const
 alias to get_tunnel_radius More...
 
double get_pore_radius_k () const
 alias to get_tunnel_radius_k More...
 
double get_range () const
 
int get_rmf_dump_interval_frames () const
 
std::string get_rmf_file_name () const
 
rmf::SaveOptimizerStateget_rmf_sos_writer ()
 
atom::Hierarchy get_root () const
 
atom::Hierarchy get_root_of_type (core::ParticleType type) const
 
Scoringget_scoring ()
 
Scoring const * get_scoring () const
 
algebra::Vector3Ds get_site_centers (core::ParticleType t0) const
 
double get_site_display_radius (core::ParticleType) const
 
algebra::Sphere3Ds get_sites (core::ParticleType t0) const
 
Particleget_slab_particle () const
 
double get_slab_thickness () const
 
display::Geometryget_static_geometry ()
 
Statisticsget_statistics ()
 
Statistics const * get_statistics () const
 
double get_statistics_fraction () const
 
double get_temperature_k () const
 
double get_tunnel_radius () const
 returns the current tunnel radius More...
 
double get_tunnel_radius_k () const
 
virtual std::string get_type_name () const override
 
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object. More...
 
double get_xyz_stats_crop_factor () const
 
double get_xyz_stats_max_box_size_A () const
 
double get_xyz_stats_voxel_size_A () const
 return the voxel size in angstroms for the XYZ histogram More...
 
void initialize_positions_from_rmf (RMF::FileConstHandle fh, int frame_number=-1)
 
void link_rmf_file_handle (RMF::FileHandle fh, bool is_restraints=true)
 
void remove_fgs_with_prefix (std::string s_fg_type)
 remove all FGs of specified type. More...
 
void remove_particle_type (core::ParticleType pt)
 
void reset_rmf ()
 
void set_bounding_box_size (double box_size)
 
void set_bounding_sphere_radius (double sphere_radius)
 
void set_bounding_volume (double volume_A3)
 
void set_rmf_file (const std::string &new_name, bool is_save_restraints_to_rmf=true, bool is_force_restart=false)
 
void set_sites (core::ParticleType t0, int n, double r, double sr)
 
void set_sites (core::ParticleType t0, const algebra::Sphere3Ds &sites)
 
void switch_suspend_rmf (bool suspend)
 
void write_geometry (std::string out)
 
- Public Member Functions inherited from IMP::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
void set_check_level (CheckLevel l)
 
void set_log_level (LogLevel l)
 Set the logging level used in this object. More...
 
void set_was_used (bool tf) const
 
void show (std::ostream &out=std::cout) const
 
const std::string & get_name () const
 
void set_name (std::string name)
 

Additional Inherited Members

- Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Constructor & Destructor Documentation

IMP::npctransport::SimulationData::SimulationData ( std::string  prev_output_file,
bool  quick,
std::string  rmf_file_name = std::string(),
std::string  new_output_file = "" 
)
Parameters
[in]prev_output_filename of protobuf file that encapsulates the assignment data for initializing the simulation params and the output statistics file. The output file is assumed to already exist at this point and contain the assignment. If it contains an rmf_conformation or conformation field, it will be used to initialize particle positions, in that priority.
[in]quickif true, perform a very short simulation, typically for calibration or for initial testing
[out]rmf_file_nameRMF file to which simulation trajectory is recorded (if empty, no RMF file is created upon construction)
See Also
set_rmf_file()
Parameters
[in]new_output_filenew protobuf file for subsequent output and statistics If it is "", then prev_output_file is being rewritten (= default).

Member Function Documentation

void IMP::npctransport::SimulationData::activate_statistics ( )

by adding all appropriate optimizer states, if they weren't already

activates Brownian Dynamics statistics tracking

void IMP::npctransport::SimulationData::add_interaction ( const ::npctransport_proto::Assignment_InteractionAssignment &  idata)

add the specified interaction to the scoring. In additions, adds statistics optimizer state about pairs of this type.

Parameters
idatathe protobuf data about the interaction (particle types, interaction coefficients, etc.)
double IMP::npctransport::SimulationData::get_angular_d_factor ( ) const

returns the simulation angular d factor

Definition at line 132 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_are_floaters_on_one_slab_side ( ) const

returns whether should exclude floaters from one slab side, if excluded at all

Definition at line 110 of file SimulationData.h.

atom::BrownianDynamics* IMP::npctransport::SimulationData::get_bd ( bool  recreate = false)

gets the Brownian Dynamics object that is capable of simulating this data. Statistics are not yet active for the simulation.

Parameters
recreateif true, forces recreation of the bd object
ParticlesTemp IMP::npctransport::SimulationData::get_beads ( )

returns all diffusing fine-level beads in this simulation data object (or an empty list if none exists)

Definition at line 394 of file SimulationData.h.

Particles& IMP::npctransport::SimulationData::get_beads_byref ( )

returns all diffusing fine-level beads in this simulation data object (or an empty list if none exists)

Note
efficient - returns an existing container by ref

Definition at line 387 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_bounding_box_size ( ) const

returns the length in A of one side of the box (valid only if get_has_bounding_box() is true)

double IMP::npctransport::SimulationData::get_bounding_sphere_radius ( ) const

get the radius of the bounding sphere (valid only if get_has_bounding_sphere() is true)

ParticleTypeSet const& IMP::npctransport::SimulationData::get_fg_bead_types ( ) const

return all the types of fg beads that were added via create_fgs() including the suffix appended to their chain type name

Definition at line 339 of file SimulationData.h.

atom::Hierarchies IMP::npctransport::SimulationData::get_fg_chain_roots ( ) const

retrieve fg chain hierarchies

Returns
all the fg hierarchies in the simulation data object that stand for individual FG chains
ParticleTypeSet const& IMP::npctransport::SimulationData::get_fg_chain_types ( ) const

return all the types of fg chains that were added via create_fgs(), i.e. the types of chain roots

Definition at line 345 of file SimulationData.h.

atom::Hierarchies IMP::npctransport::SimulationData::get_fg_chains ( ) const
Deprecated:
As of IMP release 2.2. See the IMP Deprecation Policy for more information about deprecation in IMP., use get_fg_chain_roots() instead

Definition at line 372 of file SimulationData.h.

ParticleTypeSet const& IMP::npctransport::SimulationData::get_floater_types ( ) const

return all the types of floaters that were added via create_floaters()

Definition at line 352 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_has_bounding_box ( ) const

returns true if simulation has a bounding simulation box

Definition at line 580 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_has_bounding_sphere ( ) const

returns true if simulation has a bounding simulation sphere ('cell-like')

Definition at line 585 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_has_bounding_volume ( ) const

returns true if simulation has any bounding volume (box or sphere are supported)

Definition at line 590 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_initial_simulation_time_ns ( ) const

get time from which simulation begins

Definition at line 422 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_exclude_floaters_from_slab_initially ( ) const

returns whether should exclude floaters from slab during initialization

Definition at line 104 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_fg_bead ( ParticleIndex  pi) const

returns true if bead has an fg type that is, particle was added within create_fgs()

bool IMP::npctransport::SimulationData::get_is_fg_bead ( core::ParticleType  pt) const

returns true if particle type is of fg type (that is, it is one of the types added via create_fgs())

Definition at line 316 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_fg_chain ( ParticleIndex  pi) const

returns true if particle has an fg chain type that is, particle has the same type as the root of an fg chain that was added via create_fgs()

bool IMP::npctransport::SimulationData::get_is_fg_chain ( core::ParticleType  pt) const

returns true if particle type is an fg chain type (that is, it is one of the types of a chain added via create_fgs())

Definition at line 331 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_pore_radius_dynamic ( ) const

returns true if pore radius can change dynamically

Definition at line 709 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_slab_with_cylindrical_pore ( ) const

returns true if a slab is defined and has a cylindrical pore

Definition at line 557 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_slab_with_toroidal_pore ( ) const

returns true if a slab is defined and has a toroidal pore

Definition at line 561 of file SimulationData.h.

bool IMP::npctransport::SimulationData::get_is_xyz_hist_stats ( ) const

whether xyz histogram statistics are on (into HDF5 file)

Definition at line 114 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_maximum_number_of_minutes ( ) const

Return the maximum number of minutes the simulation can run.

Or 0 for no limit.

Definition at line 487 of file SimulationData.h.

ParticlesTemp IMP::npctransport::SimulationData::get_non_optimizable_beads ( )

returns all fine-level beads that currently exist in this simulation data object get_sd(), which are also non-optimizable (or an empty list if no such bead exists)

ParticlesTemp IMP::npctransport::SimulationData::get_obstacle_particles ( ) const

return all the obstacle particles

ParticleTypeSet const& IMP::npctransport::SimulationData::get_obstacle_types ( ) const

return all the types of obstacles that were added via create_obstacles()

Definition at line 358 of file SimulationData.h.

ParticlesTemp IMP::npctransport::SimulationData::get_optimizable_beads ( )

returns all fine-level beads that currently exist in this simulation data object get_sd(), which are also optimizable (or an empty list if no such bead exists)

double IMP::npctransport::SimulationData::get_pore_radius ( ) const

alias to get_tunnel_radius

Definition at line 693 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_pore_radius_k ( ) const

alias to get_tunnel_radius_k

Definition at line 704 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_range ( ) const

returns the maximal interaction range between particles

Definition at line 89 of file SimulationData.h.

rmf::SaveOptimizerState* IMP::npctransport::SimulationData::get_rmf_sos_writer ( )

Returns the internal periodic SaveOptimizerState writer that periodically outputs the particles hierarchy and restraints, using the file name returned by SimulationData::get_rmf_file_name(), which is assumed to be non empty. If the writer does not exist, then it is constructed first.

Exceptions
RMF::IOExceptioncouldn't create RMF file
atom::Hierarchy IMP::npctransport::SimulationData::get_root_of_type ( core::ParticleType  type) const

Returns the root of all chains of type 'type'

Scoring* IMP::npctransport::SimulationData::get_scoring ( )

returns a scoring object that is updated with the current particles hierarch and associated with this sd

Scoring const* IMP::npctransport::SimulationData::get_scoring ( ) const

returns a scoring object that is updated with the current particles hierarchy and associated with this sd

algebra::Vector3Ds IMP::npctransport::SimulationData::get_site_centers ( core::ParticleType  t0) const

returns a list of 3D coordinates for the interaction sites associated with particles of type t0. The site coordinates are in the particles local reference frame

Definition at line 444 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_site_display_radius ( core::ParticleType  ) const

Returns the effective interaction range radius of a site on a floater

Definition at line 483 of file SimulationData.h.

algebra::Sphere3Ds IMP::npctransport::SimulationData::get_sites ( core::ParticleType  t0) const

returns a list of Spheres3D for the interaction sites associated with particles of type t0. The site coordinates are in the particles local reference frame.

Definition at line 462 of file SimulationData.h.

Particle* IMP::npctransport::SimulationData::get_slab_particle ( ) const

returns the slab particle, initializing it based on current parameters if needed

Definition at line 567 of file SimulationData.h.

Statistics* IMP::npctransport::SimulationData::get_statistics ( )

returns a Statistics object that is updated by this simulation data

Statistics const* IMP::npctransport::SimulationData::get_statistics ( ) const

returns a Statistics object that is updated by this simulation data

double IMP::npctransport::SimulationData::get_statistics_fraction ( ) const

returns the requested fraction of time for taking statistics

Definition at line 305 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_tunnel_radius ( ) const

returns the current tunnel radius

double IMP::npctransport::SimulationData::get_tunnel_radius_k ( ) const

returns the force coefficient for keeping the tunnel radius in equilibrium (radius is dynamic only if this coefficient is positive)

Definition at line 699 of file SimulationData.h.

virtual ::IMP::VersionInfo IMP::npctransport::SimulationData::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 744 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_xyz_stats_crop_factor ( ) const

return the factor by which the XYZ histogram is cropped on each axis (symmetrically), up to the maximal size

Definition at line 119 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_xyz_stats_max_box_size_A ( ) const

returns the maximal box size in angstroms for the XYZ histogram i.e. crop at most this many angstroms from each dimension

Definition at line 128 of file SimulationData.h.

double IMP::npctransport::SimulationData::get_xyz_stats_voxel_size_A ( ) const

return the voxel size in angstroms for the XYZ histogram

Definition at line 123 of file SimulationData.h.

void IMP::npctransport::SimulationData::initialize_positions_from_rmf ( RMF::FileConstHandle  fh,
int  frame_number = -1 
)

Open the specified RMF file, links it to the hierarchies of this object, and copy the XYZ coordinates from its last frame into the particles of this object.

Note
this method assumes that the hierarchies that are stored in the RMF file was constructed in the same way as the hierarchies within this SimulationData object. The only major difference between the two is assumed to be the coordinates of the various particles. Otherwise, results might be unexpected, and it is not guaranteed that a mismatch would be detected at runtime.
See Also
IMP::rmf::link_hierarchies()
IMP::rmf::load_frame()

The frame number is the frame in the file to use, if, eg, there are several initial frames to use. If it is -1, the last frame is used.

Exceptions
RMF::IOExceptionif couldn't open RMF file, or unsupported file format
void IMP::npctransport::SimulationData::link_rmf_file_handle ( RMF::FileHandle  fh,
bool  is_restraints = true 
)

Links a handle to an open rmf file with the hierarchy and constraints of this simulation data, so that writing frames into this handle will write the updated state of the simulation

Parameters
fhthe handle to be linked
is_restraintsif true, save restraints to RMF
Exceptions
RMF::IOExceptionIO error with RMF file handle
void IMP::npctransport::SimulationData::remove_fgs_with_prefix ( std::string  s_fg_type)

remove all FGs of specified type.

Remove any FG chain if the prefix of its string representation matches s_fg_type (= begins with s_fg_type, followed by an empty string or a non-digit character) from the simulation, including model particles, statistics and associated interaction, as well as related assignment and statistics data from the output protobuf file

Parameters
s_fg_typeThe FG type prefix (chain name, to which a suffix could be added for children beads)
See Also
remove_particle_type
void IMP::npctransport::SimulationData::remove_particle_type ( core::ParticleType  pt)

remove particle of type pt from simulation, including all model particles, statistics and interactions associated with it

Note
this does not update the protobuf assignment or protobuf statistics
See Also
remove_fgs_with_prefix
void IMP::npctransport::SimulationData::reset_rmf ( )

Resets the RMF file to which the internal periodic SaveOptimizerState writer dumps the output. If it does not exist, create it.

Exceptions
RMF::IOExceptioncouldn't create RMF file or other IO related problems with RMF
void IMP::npctransport::SimulationData::set_bounding_box_size ( double  box_size)

sets the length in A of one side of the box (valid only if get_has_bounding_box() is true)

void IMP::npctransport::SimulationData::set_bounding_sphere_radius ( double  sphere_radius)

set radius of bounding sphere in angstrom (valid only if get_has_bounding_sphere() is true)

void IMP::npctransport::SimulationData::set_bounding_volume ( double  volume_A3)

sets the volume of the bounding box or sphere in A^3 (box side or sphere radius are adjusted accordingly)

void IMP::npctransport::SimulationData::set_rmf_file ( const std::string &  new_name,
bool  is_save_restraints_to_rmf = true,
bool  is_force_restart = false 
)

resets the name of the RMF file that records the simulation. If an old one exists from a previous call with a different name and different restraints settings, then the previous RMF writer is invalidated by this action (closed and flushed). If the Brownian Dynamics object has already been initialized, a new writer with the new name is added as an optimizer state to it instead of the existing one. TODO: make sure the old writer is indeed closed and flushed

Parameters
new_namethe new name of the rmf file
is_save_restraints_to_rmfwhether to save restraints to this rmf file
is_force_resetif true, force reset even if new_name and is_save_restraints_to_rmf are equal to their old values.
void IMP::npctransport::SimulationData::set_sites ( core::ParticleType  t0,
int  n,
double  r,
double  sr 
)

Create n interaction sites spread around the surface of a ball of radius r, and associate these sites with all particles of type t0

If n==-1, creates a single site, centered at the bead, and r is ignored

Parameters
t0type of particle to associate with sites
nnumber of sites
rradius at which to position sites relative to t0 origin
srradius from site center within which site has maximal interaction energy
void IMP::npctransport::SimulationData::set_sites ( core::ParticleType  t0,
const algebra::Sphere3Ds sites 
)

Set the sites explicitly.

Definition at line 471 of file SimulationData.h.

+ Here is the call graph for this function:

void IMP::npctransport::SimulationData::write_geometry ( std::string  out)

Write the geometry to the file path 'out'


The documentation for this class was generated from the following file: