CoWERA is a binless weighted-ensemble (WE) resampling algorithm for efficient estimation of rare-event kinetics (e.g., protein folding/unfolding) using OpenMM and Wepy.
It is designed for GPU-accelerated molecular simulations and rare-event rate calculations.
This guide walks through:
- Cloning the repository
- Creating the environment
- Preparing a system
- Configuring the simulation
- Running CoWERA
- GPU setup (CUDA + MPS)
- Analysing results
git clone https://github.com/Shaheerah3007/CoWERA.git
cd CoWERAAn environment file is provided in:
env/environment.yml
Create the environment:
conda env create -f env/environment.yml -n coweraActivate it:
conda activate coweraCoWERA/
│
├── Scripts/ # CoWERA + Wepy workflow scripts
│ ├── run_cowera.py # Main execution script
│ ├── config_template.yml # Config template
│ └── (other wepy/cowera utilities)
│
├── env/
│ └── environment.yml
│
├── Analysis/ # Post-processing notebooks
│
└── Systems/
└── system_name/
├── system.py
├── config.yml
├── folded.gro
├── unfolded.gro
├── topol.top
├── *.itp
└── forcefield files (if required)
Inside Systems/, create a folder for your system:
Systems/system_name/
system.pyconfig.ymlfolded.grounfolded.grotopol.top- Any
.itpor forcefield files referenced in the topology
Each system must define:
def make_system(top, temp):
"""
Parameters:
top : OpenMM topology object
temp : temperature in Kelvin
Returns:
system, integrator
"""
...
return system, integratorThis function must construct:
- The OpenMM
System - The
Integrator(e.g., Langevin, NPT, implicit solvent, etc.)
A fully commented template is provided:
Scripts/config_template.yml
Copy it:
cp Scripts/config_template.yml Systems/system_name/config.ymlEdit it according to your system.
system: "Trp-cage"
dir: "./Systems/TC10b Trp-cage"
num_walkers: 16
pmax: 0.20
run: "test_0"
n_steps: 50000
n_cycles: 10000
start: "unfolded.gro"
topol: "topol.top"
target: "folded.gro"
native: "folded.gro"
sel_feat: "best_hummer_q"
mode: "probabilistic"
distance_criterion: "pairwise_rmsd"
d_merge: 0.6
d_warped: 0.3
temp: 290.0
gpu_ids: [0] # if CUDA MPS enabled add 0 based on percentage
save_freq: 5000
n_bins: 122
max_bins: 122
increment: 1
output_folder: "folding_runs"| Parameter | Description |
|---|---|
num_walkers |
Number of WE trajectories |
n_steps |
MD steps between resampling |
n_cycles |
Total WE cycles |
sel_feat |
"best_hummer_q" or "rmsd_backbone" |
mode |
"greedy" or "probabilistic" |
distance_criterion |
"pairwise_rmsd" or "euclidean" |
d_merge |
Merge cutoff distance |
d_warped |
Warping boundary cutoff |
increment |
+1 or −1 (direction of progress) |
gpu_ids |
CUDA device IDs |
From the repository root:
python ./Scripts/run_cowera.py --config ./Systems/system_name/config.ymlReplace system_name accordingly.
CoWERA is designed for GPU execution.
To efficiently run multiple walkers on a single GPU, enable CUDA MPS:
nvidia-cuda-mps-control -d
export CUDA_MPS_ACTIVE_THREAD_PERCENTAGE=20Adjust the percentage depending on:
- GPU memory
- Number of walkers
- System size
Then run normally:
python ./Scripts/run_cowera.py --config ./Systems/system_name/config.ymlResults are stored in:
Systems/system_name/output_folder/
simdata_runtest_{run}_steps{n_steps}_cycs{n_cycles}/
This directory contains:
pkls/
trajectories/
dashboard.log
Info_test_{run}.txt
wepy.dash.org
wepy.results.h5
The trajectories/ folder contains:
- Current walker trajectories
- Productive trajectories
These are saved in DCD format and can be analysed using:
- MDAnalysis
- MDTraj
- Any compatible molecular analysis toolkit
All analysis notebooks are provided in:
Analysis/
You can analyse:
- MFPT (mean first-passage time)
- Rate constants
- Convergence behaviour
- Warping statistics
The main results file is:
wepy.results.h5
This file contains:
- Warping events
- Walker weights
- Resampling history
- Full WE trajectory data
CoWERA provides:
- Binless WE resampling
- GPU-accelerated execution
- Native OpenMM integration
- Full WE trajectory bookkeeping
- Built-in rare-event kinetics analysis