topo package¶
Subpackages¶
- topo.analysis package
- topo.core package
- topo.csp package
- Submodules
- topo.csp.core module
NascentDCDReporterRunParamsRunParams.constraintsRunParams.deviceRunParams.dissociation_stepsRunParams.dt_psRunParams.ejection_stepsRunParams.initiation_rateRunParams.max_steps_per_stageRunParams.min_steps_per_stageRunParams.minimizeRunParams.n_stepsRunParams.nascent_ev_radiiRunParams.nstoutRunParams.ppnRunParams.random_seedRunParams.ref_tRunParams.restraint_kRunParams.ribosome_trafficRunParams.scale_factorRunParams.tau_tRunParams.time_stage_1RunParams.time_stage_2RunParams.trna_tetherRunParams.tunnel_wallRunParams.tunnel_wall_kRunParams.tunnel_wall_x0_nmRunParams.uniform_codon_time
_dump_topology_psf()_finalize_nascent()_make_cfg()_ptc_bead_index()_vprint()_write_pdb()add_cterm_restraint()build_length_model()cold_start_positions()optimal_ptc_targets()precompute_contacts()read_anchor()run_length()seed_positions()write_subset_structure()
- topo.csp.cylinder module
- topo.csp.kinetics module
- topo.csp.movie module
- topo.csp.protocol module
- topo.csp.ribosome module
- Module contents
- topo.mdrun package
- topo.optimize package
- topo.utils package
- Submodules
- topo.utils.config module
SimulationConfigSimulationConfig.annealSimulationConfig.anneal_rampSimulationConfig.anneal_ramp_incrementsSimulationConfig.anneal_ramp_stepsSimulationConfig.anneal_stepsSimulationConfig.box_dimensionSimulationConfig.build_kwargs()SimulationConfig.checkpointSimulationConfig.checkpoint_path()SimulationConfig.config_fileSimulationConfig.constraint_toleranceSimulationConfig.constraintsSimulationConfig.copy_shiftSimulationConfig.deviceSimulationConfig.domain_defSimulationConfig.dtSimulationConfig.frequency_pSimulationConfig.init_positionSimulationConfig.log_precisionSimulationConfig.log_widthSimulationConfig.make_platform()SimulationConfig.md_stepsSimulationConfig.minimizeSimulationConfig.modelSimulationConfig.n_copiesSimulationConfig.nstchkSimulationConfig.nstcommSimulationConfig.nstlogSimulationConfig.nstxoutSimulationConfig.outnameSimulationConfig.output_dirSimulationConfig.output_path()SimulationConfig.pbcSimulationConfig.pcouplSimulationConfig.pdb_fileSimulationConfig.ppnSimulationConfig.prepare_output_dir()SimulationConfig.quench_steps()SimulationConfig.quietSimulationConfig.ref_pSimulationConfig.ref_tSimulationConfig.restartSimulationConfig.stride_output_fileSimulationConfig.t_highSimulationConfig.tau_tSimulationConfig.tcouplSimulationConfig.total_steps()
read_simulation_config()strtobool()
- topo.utils.multichain module
- topo.utils.nonbonded module
- Main workflow
- Typical use
_norm_chain()_residue_chain()build_hb_contact_matrix()build_nonbonded_interaction()calculate_rmin_2_values()get_bs_contact_matrix()get_hb_contact_matrix()get_residue_mapping()get_scaling_ss_matrix()get_ss_contact_matrix()get_ss_interaction_energy()load_bt_potential()parse_hydrogen_bonds()parse_residue_list()print_pairs_with_multiple_hb()read_yaml_config()
- topo.utils.read_parms module
- topo.utils.runinfo module
- Module contents
Note
topo.parameters and topo.reporter have dedicated, curated API pages
(Parameters, topo.reporter package) and are intentionally
omitted here to avoid duplicate object descriptions.
Submodules¶
topo.engine module¶
Shared simulation engine: build the system and set up an OpenMM Simulation.
This is the layer common to every run mode. It does the parts that do not depend on the temperature protocol:
build_system()– coarse-grain model, multi-copy replication,topology (PSF) dump, COM-motion removal.
setup_simulation()– integrator, platform, restart/checkpoint,starting coordinates/velocities, reporters, run-metadata header.
finalize_simulation()– save checkpoint, write final structure,close out run metadata, print wall time.
The temperature protocol (constant-temperature equilibrium vs. annealing /
quenching) lives with each runner – see topo.mdrun.protocol. Equilibrium
is just the degenerate one-stage schedule, so both protocols share everything in
this module. A future nascent-chain (translation) runner can reuse the same
build/setup/finalize helpers and supply its own driver loop.
- class topo.engine.BuiltSystem(cgModel: Any, system: Any, topology: Any, positions: Any)[source]¶
Bases:
objectOutputs of
build_system().- cgModel: Any¶
- positions: Any¶
- system: Any¶
- topology: Any¶
- class topo.engine.RunContext(simulation: Any, checkpoint: str, restart_active: bool, done_steps: int, runinfo_path: str)[source]¶
Bases:
objectOutputs of
setup_simulation()needed to run and finalize.- checkpoint: str¶
- done_steps: int¶
- restart_active: bool¶
- runinfo_path: str¶
- simulation: Any¶
- topo.engine.attach_reporters(cfg, simulation, suffix='', append=False, total_steps=None, checkpoint=True)[source]¶
(Re)attach the checkpoint / trajectory / log reporters for one phase.
Replaces
simulation.reportersso the runner can switch output file sets between the quench phase (suffix='_quench') and production (suffix='').- Parameters:
suffix (str) – Inserted before the extension:
''-><outname>.dcd/.log;'_quench'-><outname>_quench.dcd/.log.append (bool) – Append to (rather than truncate) the DCD/log – used when a restart resumes this phase, so the log header is not re-written.
total_steps (int, optional) – Value reported as the run length for the log’s remaining-time/speed columns; defaults to
cfg.md_steps. Each phase keeps its own step clock (the quench clock is reset before production), so this is the phase length, not a grand total.checkpoint (bool) – Whether to write the
<outname>.chkcheckpoint. The quench phase sets thisFalse– it is short and never restarted, so the checkpoint only ever holds production state and a restart resumes production cleanly.
- topo.engine.build_system(cfg) BuiltSystem[source]¶
Build the coarse-grain model and (optionally) replicate it into copies.
Mirrors the original
mdrunbuild block: build the single-chain model, replicate inton_copiesnon-interacting copies when requested, dump the PSF topology (and a_multi.psffor multi-copy runs), and add aCMMotionRemoveronly whennstcommis set.
- topo.engine.finalize_simulation(cfg, ctx: RunContext, topology, start_epoch: float) None[source]¶
Save the final checkpoint, write the last conformation, close metadata.
- topo.engine.setup_simulation(cfg, built: BuiltSystem, control_file: str | None = None) RunContext[source]¶
Create the OpenMM
Simulationand bring it to a ready-to-step state.Handles platform selection, the Langevin integrator (created at
ref_t; the protocol driver sets the per-stage temperature), restart/checkpoint loading, starting coordinates/velocities for a fresh run, output reporters, and the run-metadata header. The integrator’s initial temperature is irrelevant to the run because the protocol callssetTemperaturebefore the first step, butref_tkeeps equilibrium runs byte-for-byte identical.