Simulation control options¶
Simulation parameters are read from an .ini file (e.g. md.ini) by
cosmo.read_simulation_config(), which returns a
SimulationConfig. The section title [OPTIONS] is
required.
Comments: inline or on their own line, starting with
;or#.Keyword and value are separated by
=or:.Every option below has a default except the ones marked required; you only need to set the options you want to change.
Running a simulation¶
The runner lives in the package as cosmo.mdrun. Once COSMO is installed
(pip install -e . from the repo root) any of these are equivalent:
cosmo-mdrun -f md.ini # installed console command
python -m cosmo.mdrun -f md.ini # module form
python run_simulation.py -f md.ini # tutorial shim (calls cosmo.mdrun)
Example md.ini:
[OPTIONS]
md_steps = 500_000 ; number of steps (underscores allowed)
dt = 0.01 ; time step in ps
nstxout = 1000 ; steps between trajectory (DCD) frames
nstlog = 1000 ; steps between log writes
nstchk = 1000 ; steps between checkpoint writes (defaults to nstxout)
nstcomm = 100 ; center-of-mass motion removal; off by default, omit for multi-chain runs
log_precision = 4 ; decimal places for float columns in the .log
log_width = 14 ; min column width for aligned, fixed-width .log
; force-field model: hps_urry, hps_kr, hps_ss, or mpipi
model = hps_urry
; bond treatment: None (flexible harmonic bonds, default) or AllBonds (rigid)
; constraints = AllBonds
; constraint_tolerance = 1e-5 ; only used with constraints = AllBonds
; temperature coupling
tcoupl = yes
ref_t = 310 ; Kelvin
tau_t = 0.01 ; ps^-1
; pressure coupling (requires pbc = yes)
pcoupl = no
ref_p = 1
frequency_p = 25
; periodic boundary condition
pbc = yes
box_dimension = 30 ; cubic 30 nm; or [30, 30, 60] for a box
; input
pdb_file = asyn.pdb
; init_position = traj/asyn_final.pdb ; optional: start from these coords
; output (all files -> <output_dir>/<outname>.*, default traj/traj.*)
output_dir = traj
outname = asyn
; hardware
device = GPU
ppn = 4
; restart
restart = no
minimize = yes
Parameter summary¶
“Required = yes” means the run cannot proceed without it. Options with a default
may be omitted. — in the Default column means there is no default (the
option is either required, or only meaningful in a specific mode noted in the
description).
Option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
int |
no |
|
Total number of integration steps. Underscores are allowed ( |
|
float [ps] |
no |
|
Integration time step. |
|
int |
no |
|
Steps between writing the trajectory (DCD) frames. Also the default checkpoint write frequency (see |
|
int |
no |
|
Steps between writing the energy/temperature log. |
|
int |
no |
|
Steps between checkpoint ( |
|
int |
no |
|
Steps between center-of-mass motion removals; off by default (set |
|
int |
no |
|
Decimal places for floating-point columns (energies, time, temperature, …) in the |
|
int |
no |
|
Minimum width (characters) of each |
|
str |
no |
|
Force-field model: |
|
bool |
no |
|
Langevin thermostat on/off. (NVE is not used.) |
|
float [K] |
if |
|
Reference temperature. Read only when |
|
float [ps⁻¹] |
if |
|
Friction coefficient coupling the system to the heat bath. Read only when |
|
bool |
no |
|
Monte Carlo barostat on/off. Requires |
|
float [bar] |
if |
|
Reference pressure. Read only when |
|
int [steps] |
if |
|
Barostat move attempt frequency. Read only when |
|
bool |
no |
|
Periodic boundary conditions on/off. |
|
float or [x,y,z] [nm] |
if |
|
Box size: a scalar |
|
str |
yes |
|
Input structure ( |
|
str |
no |
|
Optional starting coordinates for a fresh run (e.g. a previous run’s |
|
str |
no |
|
Folder for all generated files; created if missing. One run = one self-contained folder. |
|
str |
no |
|
Basename for generated files: |
|
str |
no |
|
Legacy output prefix. When set and |
|
str |
no |
|
Explicit checkpoint path override. Normally leave unset so it lands in the run folder. |
|
str |
no |
|
Compute platform: |
|
int |
no |
|
Number of CPU threads. Read only when |
|
bool |
no |
|
Restart from |
|
bool |
no |
|
Energy-minimize the input structure before dynamics. Forced |
|
str |
no |
|
Bond treatment: |
|
float |
no |
|
Integrator relative constraint tolerance. Only meaningful when |
Note
Boolean options accept yes/no, true/false, 1/0
(parsed by cosmo.utils.config.strtobool()).
Notes on individual options¶
- Output layout (
output_dir/outname) Every generated file is written to
<output_dir>/<outname><suffix>, so a run is one self-contained folder (defaulttraj/):traj.dcd(trajectory),traj.log(state log),traj.psf(topology),traj.chk(checkpoint),traj_init.pdb(the built/minimized starting structure),traj_final.pdb(last conformation),traj_ff.dat(per-residue force-field dump, HPS models only), andtraj_runinfo.log(run provenance: software versions, hardware, GPU, timing).output_diris created automatically if missing. To keep several runs side by side, point each at its own folder (e.g.output_dir = runs/FUS_T300) or changeoutname.protein_codeis the legacy prefix: when set andoutnameis unset it becomes the basename.- Output frequency and log formatting (
nstxout/nstlog/nstchk/nstcomm/log_precision/log_width) nstxoutcontrols trajectory (DCD) frames;nstchkcontrols checkpoint (.chk) writes independently and defaults tonstxoutwhen omitted.nstlogcontrols how often a row is appended to the.log.nstcommis the center-of-mass motion removal interval — off by default (omit it, or setnone). Enable it for a single chain; leave it off for multi-chain / slab runs, where COM removal would couple the drift of independent chains. The log reporter iscosmo.cosmoReporter, which writes a fixed-width, aligned.log:log_precisionsets the decimals for float columns (default4;nonefor full precision) andlog_widthsets the minimum column width (default14;noneto disable padding). Columns are separated by two spaces and the header is a#comment, so the log stays both human-readable and machine-parsable (seecosmo.reporter.readOpenMMReporterFile()).- Force-field model (
model) Selects the coarse-grained potential:
hps_urry(default, Urry hydropathy scale),hps_kr(Kapcha–Rossky scale; broad residue coverage including RNA and phosphorylated residues, but less accurate),hps_ss(hps_urryplus bonded angle and torsion terms), ormpipi(Wang–Frenkel non-bonded potential). All models use flexible harmonic bonds by default (see theconstraintsoption to switch to rigid constraints). See Tutorial 2 — Models & force fields.- Bond treatment (
constraints/constraint_tolerance) By default (
constraintsunset orNone) the CA/P chain bonds are flexible harmonic springs — the physically appropriate choice for disordered chains. Settingconstraints = AllBondsinstead makes every bond a rigid distance constraint pinned at its equilibrium length: the harmonic bond force is not created, the fast bond-stretch mode is removed, and a largerdtcan be used. Constraints act only on the pseudo-bonds — the non-bonded potentials (Ashbaugh–Hatch / Wang–Frenkel and Debye–Hückel electrostatics) are untouched.constraint_tolerance(default1e-5) sets the integrator’s relative constraint tolerance and is read only in theAllBondscase. Unlike the siblingtopopackage (a Gō model that defaults toAllBonds), cosmo defaults to flexible bonds — a deliberate IDP-physics choice.- Temperature / pressure coupling
ref_tandtau_tare only consumed whentcoupl = yes(and are then required);ref_pandfrequency_ponly whenpcoupl = yes. Pressure coupling additionally requirespbc = yes(asserted at parse time).- Periodic boundary conditions
Turning
pbcon affects the non-bonded forces and how coordinates are written to the PDB/DCD (handled internally).box_dimensionmust be given whenpbc = yes: a scalarLgives a cubicL×L×Lbox and a list[x, y, z]a rectangular box (e.g. an elongated box for slab/LLPS runs).- Hardware (
device/ppn) device = GPUruns on CUDA (mixed precision, device 0).device = CPUusesppnthreads;ppnis ignored on GPU.restartandminimizerestart = yesloads positions and velocities fromcheckpointand continues; reporters append to the existing log/trajectory, andminimizeis forced off. Withrestart = noyou may chooseminimize; on a fresh start velocities are drawn from the Boltzmann distribution atref_t. The checkpoint path defaults to<output_dir>/<outname>.chkand can be overridden withcheckpoint(e.g. to restart from a differently named run).- Starting coordinates (
init_position) On a fresh run (
restart = no) the initial coordinates come frompdb_fileby default. Setinit_positionto start instead from another structure — typically a previous run’s<outname>_final.pdb— to chain runs together without restarting from a checkpoint. These coordinates are used as-is (no origin shift) and must have the same atom count as the built system. Ignored on a restart, where the checkpoint supplies positions and velocities.