Dynamics
- Dynamics class contains two main functions: read config file and run simulation.
User only need to provide config file, e.g md.ini and specify parameters control simulation there.
- class hps.dynamics.Dynamics(config_file)[source]
The Dynamics class is used to perform molecular dynamics simulations. It contains two main functions: reading a configuration file and running a simulation. To use the class, a user needs to provide a configuration file (e.g md.ini) and specify the parameters that control the simulation.
- Parameters:
config_file (str) – The path to the configuration file that contains the parameters for the simulation.
- md_steps
The number of steps to perform in the molecular dynamics simulation.
- Type:
int, optional (default: 1000)
- dt
The time step for integration in picoseconds.
- Type:
float, optional (default: 0.01) [ps]
- nstxout
The number of steps between writing coordinates to the output trajectory file. The last coordinates are always written.
- Type:
int, optional (default: 10)
- nstlog
The number of steps between writing energies to the log file. The last energies are always written.
- Type:
int, optional (default: 10)
- nstcomm
The frequency for center of mass motion removal.
- Type:
int, optional (default: 100)
- model
Hydropathy scale used in the simulation.
- Type:
str, optional (default: ‘hps_urry’)
- tcoupl
Indicates whether temperature coupling is used in the simulation.
- Type:
bool, optional (default: False)
- ref_t
The reference temperature for coupling in Kelvin.
- Type:
float, optional (default: 300.0) [K]
- tau_t
The time constant for temperature coupling in picoseconds.
- Type:
float, optional (default: 0.1) [ps]
- pcoupl
Indicates whether pressure coupling is used in the simulation.
- Type:
bool, optional (default: False)
- ref_p
The reference pressure for coupling in bar.
- Type:
float, optional (default: 1.0) [bar]
- frequency_p
The frequency for coupling the pressure.
- Type:
int, optional (default: 25)
- pbc
Indicates whether periodic boundary conditions are used in the simulation.
- Type:
bool, optional (default: True)
- box_dimension
The dimension of the box used in the simulation. It is better to use rectangular for simplicity.
- Type:
float or list of float, optional (default: None)
- protein_code
A prefix to write output files based on this parameter.
- Type:
str, optional (default: None)
- checkpoint
The name of the checkpoint file.
- Type:
str, optional (default: None)
- pdb_file
The input structure used to generate the model.
- Type:
str, optional (default: None)
- device
The device used to perform the simulation. Options are ‘GPU’ or ‘CPU’.
- Type:
str, optional (default: ‘GPU’)
- ppn
In case the simulation is run on a CPU, this parameter controls the number of threads used to run the simulation.
- Type:
int, optional (default: 1)
- restart
Indicates whether the simulation should be run from the beginning or restarted from a checkpoint.
- Type:
bool, optional (default: False)
- minimize
Indicates whether energy minimization should be performed at the start of the simulation
- Type:
bool, optional (default: True)
- read_config(config_file)[source]
Read simulation control parameters from config file *.ini into class attributes.
- Parameters:
config_file (string, default=None) – Control file store simulation parameters.
TODO (check parameters in control file more carefully.) – Raise error and exit immediately if something wrong.