Tutorial 1 — Single-chain quickstart¶
Goal: run your first COSMO simulation end-to-end and understand the inputs and
outputs. We simulate a single intrinsically disordered protein —
α-synuclein (asyn, 140 residues) — with the simplest possible configuration.
Time: a few seconds on a CPU.
Files in this folder¶
File |
Role |
|---|---|
|
Input structure (all-atom PDB; COSMO keeps one bead per residue). |
|
Simulation configuration (steps, temperature, I/O, hardware). |
|
Thin runner wrapper (reads |
Background concepts¶
Coarse-graining. COSMO reads your all-atom PDB but keeps one bead per residue — the alpha-carbon (Cα) for proteins, the phosphate (P) for nucleic acids. A 140-residue protein → 140 particles.
Hydropathy-scale model. The default
hps_urryis a hydropathy scale (HPS) model: each residue carries a size (σ) and a “stickiness” (λ) from the Urry hydrophobicity scale. Non-bonded interactions use an Ashbaugh–Hatch potential plus Debye–Hückel electrostatics between charged residues. Unlike a structure-based model, the input conformation does not define the energy minimum — the chain is free to sample whatever ensemble the force field favors, which is exactly what you want for a disordered protein.No periodic box. A single isolated chain is run with
pbc = no: there is no box and no solvent, so the chain explores its conformational ensemble in open space.
Want the full theory? Every energy term (bonds, Ashbaugh–Hatch / Wang–Frenkel non-bonded, Debye–Hückel electrostatics, and the optional bonded angle/torsion terms), with constants and parameter sources, is documented in the model reference. The four force fields are compared hands-on in Tutorial 2.
Step-by-step¶
1. Check your environment¶
From this folder:
python -c "import cosmo, openmm; print('OK', openmm.__version__)"
This must succeed (see the tutorials overview for setup).
2. Look at md.ini¶
Open md.ini. The important lines:
md_steps = 5000 # how long to run (short, for a demo)
model = hps_urry # the force field (Tutorial 2 compares the four)
ref_t = 300 # temperature in Kelvin
pbc = no # no periodic box (single chain, no solvent)
pdb_file = asyn.pdb
output_dir = traj # all outputs go to this folder ...
outname = asyn # ... named asyn.* (so: traj/asyn.dcd, traj/asyn.log, ...)
device = CPU # runs anywhere; switch to GPU if you have CUDA
minimize = yes # relax the input coordinates before stepping
3. Run it¶
python run_simulation.py -f md.ini
(equivalently python -m cosmo.mdrun -f md.ini, or cosmo-mdrun -f md.ini after
pip install -e .). COSMO echoes every parsed setting, builds the model (number
of chains, each force term added in order, force-field dump), minimizes, then
steps the dynamics. It ends with Finished in … seconds.
4. Inspect the outputs¶
All generated files land in one run folder, output_dir (here traj/, created
automatically), named <outname>.* (here asyn.*):
File |
What it is |
|---|---|
|
Fixed-width, space-aligned energy/temperature log (one line every |
|
Trajectory (coordinates every |
|
Binary checkpoint (positions + velocities) for restarting (Tutorial 4). |
|
Topology of the coarse-grained model (load alongside the DCD in analysis tools). |
|
The coarse-grained starting structure (one bead per residue). |
|
Last conformation; reuse it to seed a follow-up run. |
|
Per-residue σ/ε/charge force-field table (HPS models only). |
|
Run provenance: software versions, hardware, GPU, timing. |
Peek at the log:
head traj/asyn.log
The columns are step, time (ps), potential / kinetic / total energy (kJ/mol), temperature (K), speed, and remaining time. A stable temperature near 300 K and a non-exploding potential energy mean the run is healthy.
Try next¶
Open the trajectory in VMD:
vmd traj/asyn.psf traj/asyn.dcd. Watch the disordered chain expand and collapse — there is no single folded state.Bump
md_stepsto100000for a longer ensemble, and compute the radius of gyration (R_g) over the trajectory with MDAnalysis.Move on to Tutorial 2 to see how the four force fields differ on this same chain.
Tip: a re-run overwrites the
traj/asyn.*files. To keep a run, copy the folder aside or changeoutname/output_dir(e.g.outname = asyn_T300, oroutput_dir = runs/T300).