|
| 1 | +# CellSim FEP Handoff — Apple-silicon Mac runner |
| 2 | + |
| 3 | +You are running CellSim's Milestone A accuracy gate on behalf of |
| 4 | +a friend. This is one command, ~4–6 hours wall time on an M5 Max, |
| 5 | +and produces one tarball to send back. |
| 6 | + |
| 7 | +This README is written for you **and** your Claude Code. Either |
| 8 | +can follow it; Claude will probably run it end-to-end with minimal |
| 9 | +human intervention. |
| 10 | + |
| 11 | +## What you're running |
| 12 | + |
| 13 | +Absolute hydration free energy (ΔG_hyd) of 12 small molecules |
| 14 | +using alchemical free-energy perturbation (FEP). The 12 molecules |
| 15 | +span +2.0 kcal/mol (methane, hydrophobic) to −9.7 kcal/mol |
| 16 | +(acetamide, hydrophilic). |
| 17 | + |
| 18 | +**Target**: predicted ΔG_hyd within 1.5 kcal/mol MAE of the |
| 19 | +published FreeSolv experimental values. |
| 20 | + |
| 21 | +The pipeline is: |
| 22 | + `SMILES → OpenFF Sage 2.1.0 + AM1-BCC charges → OpenMM TIP3P |
| 23 | + solvated System → openmmtools alchemical decoupling → |
| 24 | + MCMC sampling with GHMC integrator + MBAR free-energy estimate` |
| 25 | + |
| 26 | +## Hardware requirements |
| 27 | + |
| 28 | +- **Apple silicon Mac** (M1/M2/M3/M4/M5, any Pro/Max/Ultra |
| 29 | + variant). Intel Mac also works but slower. |
| 30 | +- **32 GB RAM recommended**, 16 GB will work but may swap. |
| 31 | +- **~5 GB free disk** in the CellSim repo (data + output). |
| 32 | +- **Plugged in**, display-sleep OK but full-sleep NOT OK. |
| 33 | + Set before running: |
| 34 | + ```bash |
| 35 | + sudo pmset -c disablesleep 1 |
| 36 | + ``` |
| 37 | + Re-enable after: |
| 38 | + ```bash |
| 39 | + sudo pmset -c disablesleep 0 |
| 40 | + ``` |
| 41 | + |
| 42 | +## One-time setup (first run only) |
| 43 | + |
| 44 | +1. Install mamba/miniforge if you don't have it: |
| 45 | + ```bash |
| 46 | + brew install miniforge |
| 47 | + ``` |
| 48 | + |
| 49 | +2. Clone the release: |
| 50 | + ```bash |
| 51 | + git clone https://github.com/Rockman6/CellSim-3D-Multicellular-Biology-Drug-Testing-Simulator.git CellSim |
| 52 | + cd CellSim |
| 53 | + git checkout <release-tag> # Henry will tell you which tag |
| 54 | + ``` |
| 55 | + |
| 56 | +3. Create the conda environment: |
| 57 | + ```bash |
| 58 | + mamba env create -f environment.yml |
| 59 | + conda activate cellsim |
| 60 | + ``` |
| 61 | + This installs ~60 packages and takes 10–20 minutes. |
| 62 | + |
| 63 | +4. Install `terminal-notifier` so the script can ping you when |
| 64 | + it finishes: |
| 65 | + ```bash |
| 66 | + brew install terminal-notifier |
| 67 | + ``` |
| 68 | + |
| 69 | +5. Verify the install: |
| 70 | + ```bash |
| 71 | + ./scripts/cellsim doctor |
| 72 | + ``` |
| 73 | + You should see "**39/39 checks passed**". If fewer pass, send |
| 74 | + Henry the output — do **not** proceed. |
| 75 | + |
| 76 | +## The run |
| 77 | + |
| 78 | +One command: |
| 79 | + |
| 80 | +```bash |
| 81 | +./scripts/run_freesolv_m5max.sh |
| 82 | +``` |
| 83 | + |
| 84 | +The script will: |
| 85 | +1. Activate the `cellsim` conda env. |
| 86 | +2. Print the OpenMM platform list (Metal / OpenCL / CPU) so you |
| 87 | + can see which backend is used. |
| 88 | +3. Run `cellsim doctor` and abort if it fails. |
| 89 | +4. Execute the 12-compound FreeSolv gate at production parameters: |
| 90 | + - 11 alchemical windows per leg |
| 91 | + - 50 ps equilibration + 50 ps production per window |
| 92 | + - 100 samples per window (2 ps stride) |
| 93 | + - 2 legs per compound (vacuum + TIP3P-solvated) |
| 94 | + - = ~2.2 ns simulated MD per compound × 12 = 26 ns total |
| 95 | +5. Write everything to `run/fep/<timestamp>/` and bundle into |
| 96 | + `freesolv_m5max_<timestamp>.tar.gz`. |
| 97 | +6. Fire a macOS notification ("CellSim FreeSolv FEP: PASS/FAIL") |
| 98 | + when complete. |
| 99 | + |
| 100 | +Expected wall time: |
| 101 | +- **M5 Max (40-core GPU)**: 4–6 hours |
| 102 | +- **M2/M3 Max**: 6–9 hours |
| 103 | +- **M1 Pro/Max**: 8–12 hours |
| 104 | +- **Intel Mac (CPU only)**: 24–48 hours — not recommended |
| 105 | + |
| 106 | +You can close the Terminal window during the run — the process |
| 107 | +continues. Use `tail -f run/fep/*/run.log` in another Terminal to |
| 108 | +watch progress. |
| 109 | + |
| 110 | +## What to send back |
| 111 | + |
| 112 | +When the script finishes, send **one file**: |
| 113 | + |
| 114 | +``` |
| 115 | +freesolv_m5max_<timestamp>.tar.gz |
| 116 | +``` |
| 117 | + |
| 118 | +(in the CellSim repo root). Send via: |
| 119 | +- **WeChat file transfer** (works for files up to ~100 MB; tarball |
| 120 | + will be ~1–5 MB) |
| 121 | +- **AirDrop** (if you're close geographically) |
| 122 | +- **Email / Google Drive / Dropbox** |
| 123 | +- **GitHub Gist** (if public data is OK — it is; FreeSolv |
| 124 | + numbers are public benchmark data) |
| 125 | + |
| 126 | +The tarball contains: |
| 127 | + |
| 128 | +| File | What it is | Why Henry wants it | |
| 129 | +|---|---|---| |
| 130 | +| `env.log` | OpenMM/Python/platform versions | Reproducibility — must match exactly | |
| 131 | +| `doctor.log` | cellsim doctor output | Catches env drift between machines | |
| 132 | +| `run.log` | Full pipeline stdout | Contains per-compound ΔG, per-window GHMC acceptance, wall times, any NaN warnings | |
| 133 | +| `freesolv_results.csv` | 12-row CSV of predictions | The numbers Henry analyses | |
| 134 | + |
| 135 | +## What Henry specifically wants in the CSV |
| 136 | + |
| 137 | +Each row of `freesolv_results.csv` has: |
| 138 | + |
| 139 | +``` |
| 140 | +name, smiles, dG_expt_kcalmol, dG_pred_kcalmol, uncertainty_kcalmol, |
| 141 | +residual_kcalmol, wall_seconds, ok, reason |
| 142 | +``` |
| 143 | + |
| 144 | +Specifically he'll compute: |
| 145 | +- **MAE** = mean |residual| across all 12 → gate is ≤ 1.5 kcal/mol. |
| 146 | +- **Per-compound sign correctness** — methane should give ≈ +2 kcal/mol |
| 147 | + (positive), not −2 (negative); the CPU pilot gave −2 due to |
| 148 | + under-sampling, so seeing it flip to positive on M5 Max is the |
| 149 | + load-bearing finding. |
| 150 | +- **GHMC acceptance rate** — must be ≥ 70% per window (≥ 75% |
| 151 | + preferred). Low acceptance means the ΔG is unreliable. |
| 152 | +- **Wall time per compound** — tells Henry the M5 Max throughput |
| 153 | + so he can plan the next round (EGFR kinase relative FEP). |
| 154 | + |
| 155 | +## Troubleshooting |
| 156 | + |
| 157 | +### `cellsim doctor` fails |
| 158 | + |
| 159 | +Copy the terminal output, send it to Henry. Do NOT try to fix it. |
| 160 | + |
| 161 | +### Script errors immediately with "python: command not found" |
| 162 | + |
| 163 | +You didn't activate the env. Run: |
| 164 | +```bash |
| 165 | +conda activate cellsim |
| 166 | +``` |
| 167 | + |
| 168 | +### Script errors with "Particle coordinate is NaN" |
| 169 | + |
| 170 | +**Send Henry the log anyway.** That failure mode is itself |
| 171 | +scientifically valuable. The CPU version sometimes hits this at |
| 172 | +shorter MD lengths; Henry needs to know if it shows up on |
| 173 | +M5 Max too or if longer sampling dissolves it. |
| 174 | + |
| 175 | +### Run times out after 6 hours and hasn't finished |
| 176 | + |
| 177 | +That's fine. Send the partial CSV — 6 of 12 compounds is better |
| 178 | +than nothing. Just append a line to the tarball note saying |
| 179 | +"killed at <time>, <N> of 12 compounds completed". |
| 180 | + |
| 181 | +### Machine overheats / fan roars / battery drains |
| 182 | + |
| 183 | +Normal for sustained GPU work. Machine is plugged in and |
| 184 | +physically safe. Continue. |
| 185 | + |
| 186 | +### You want to reduce the run to ~2 hours |
| 187 | + |
| 188 | +Edit `scripts/run_freesolv_m5max.sh`, change: |
| 189 | +``` |
| 190 | +--production-steps 25000 |
| 191 | +``` |
| 192 | +to: |
| 193 | +``` |
| 194 | +--production-steps 10000 |
| 195 | +``` |
| 196 | + |
| 197 | +This gives a less-converged result (still useful as a first pass). |
| 198 | +Tell Henry you used shorter production when you send the tarball. |
| 199 | + |
| 200 | +## What this actually tests (Henry's framing) |
| 201 | + |
| 202 | +The CellSim project got a long critique from Henry's professor |
| 203 | +about whether the simulator can actually replace wet-lab |
| 204 | +experiments — specifically whether "physics-derived priors" from |
| 205 | +FEP are good enough to build cell biology on top of. Methane |
| 206 | +hydration is the simplest FEP test: if we can't get methane right, |
| 207 | +nothing else matters. |
| 208 | + |
| 209 | +Your run is **the M5 Max-accessible test** of whether longer MD |
| 210 | +sampling dissolves the entropy-capture issue Henry saw on CPU. |
| 211 | +Professor threshold: |
| 212 | +- Acceptance ≥ 75% |
| 213 | +- ΔG_hyd(methane) = +2.0 ± 0.5 kcal/mol |
| 214 | +- Uncertainty < 0.6 kcal/mol |
| 215 | + |
| 216 | +Hit those and Milestone A clears, Campaign 2 (real cell biology) |
| 217 | +opens. |
| 218 | + |
| 219 | +## Questions |
| 220 | + |
| 221 | +Ask Henry directly. He will give Claude explicit instructions |
| 222 | +too — if your Claude is unsure about something, let it paste |
| 223 | +the question into WeChat to Henry and wait. |
| 224 | + |
| 225 | +Thanks for lending the machine. Good luck. |
0 commit comments