topo.mdrun package¶
Submodules¶
topo.mdrun.mdrun module¶
Run a TOPO coarse-grained simulation from a control file (md.ini).
This is the canonical runner for the package. Use it as a CLI:
python -m topo.mdrun -f md.ini
or call mdrun() from your own script. Control-file parsing lives in
topo.read_simulation_config. After building the single-chain model, if
md.ini sets n_copies > 1 the model is replicated into that many
non-interacting copies with topo.make_noninteracting_copies (default
n_copies = 1 = single chain).
The temperature protocol is selected by the control file:
anneal = no(default) – constant-temperature equilibrium atref_t, written to<outname>.dcd/.log.
anneal = yes– two phases. A quench phase holds att_high(and, for a linear ramp, cools toref_t) and is written to<outname>_quench.dcd/.log; a production phase then runsmd_stepsatref_tand is written to the usual<outname>.dcd/.log.anneal_stepsis separate frommd_steps(grand total =quench_steps + md_steps);ref_tis the low / refold temperature.
Both share the same build / setup / finalize machinery (topo.engine);
only the temperature schedule and output files differ (topo.mdrun.protocol).
topo.mdrun.protocol module¶
Temperature protocol for the runner: equilibrium and annealing/quenching.
A protocol is a list of (temperature, n_steps) stages. The runner builds up
to two of them and runs each into its own output files:
quench_schedule()– the quench phase (only whenanneal = yes): hold att_highand, for a linear ramp, cool down toref_t. Written to<outname>_quench.dcd/.log. Sums tocfg.quench_steps().production_schedule()– the production phase:md_stepsatref_t. Written to the usual<outname>.dcd/.log. This is also the whole schedule for a plain equilibrium run.
anneal_steps is therefore separate from md_steps (the grand total is
quench_steps() + md_steps), and ref_t is always the low / refold
temperature – there is no separate t_low key.
run_protocol() drives an existing Simulation through one schedule,
setting the integrator temperature per stage, and can resume a restart partway
through a stage.
- topo.mdrun.protocol.describe_schedule(schedule)[source]¶
One-line human summary, e.g.
600 K x 100000 -> 300 K x 900000.
- topo.mdrun.protocol.production_schedule(cfg)[source]¶
The production phase: a single constant-
ref_tstage ofmd_steps.
- topo.mdrun.protocol.quench_schedule(cfg)[source]¶
Stages for the quench phase, summing to
cfg.quench_steps().Returns
[]when annealing is off. Otherwise:anneal_ramp = jump->[(t_high, anneal_steps)]. The actual quench toref_thappens at the phase boundary, when production starts, so the delta T-jump lands exactly between the_quenchand production files.anneal_ramp = linear-> the hold att_highfollowed byanneal_ramp_incrementsdiscrete cooling stages spanninganneal_ramp_steps(T decreasingt_high -> ref_t).
- topo.mdrun.protocol.run_protocol(simulation, schedule, done_steps=0)[source]¶
Step
simulationthroughschedule, one stage at a time.done_stepsis measured relative to the start of this schedule. It lets a restart resume mid-schedule: stages already completed are skipped, and a stage that was partially done runs only its remaining steps. For a single stage this reduces tosimulation.step(n - done_steps).
Module contents¶
TOPO simulation runner.
Exposes mdrun(), the canonical runner, available from the shell as
topo-mdrun -f md.ini or python -m topo.mdrun -f md.ini.