Add rendering, animation, and cryo-EM map tooling#1
Conversation
- chimerax_rest.py: managed ChimeraX REST renderer (GPU) with 0-byte-save fix - pymol_agent.py: turntable movies, render presets, pLDDT coloring - add_helix_records.py: HELIX records for CA-only backbones - map_info.py: MRC/CCP4 sigma-based contour levels - 6 new gotchas (23 total), reference recipes, ffmpeg detection, hardened .gitignore Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3fd254d21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if lo <= _dist(coords[i][2:], coords[i + 3][2:]) <= hi: | ||
| for k in range(i, i + 4): | ||
| is_helix[k] = True |
There was a problem hiding this comment.
Avoid crossing chain boundaries in helix detection
For multi-chain CA-only designs, this distance check compares residue i to i+3 even when those entries span different chains in the PDB order. If chain termini are close enough, residues on both chains get marked as one continuous helix and helix_segments() can emit a HELIX record with the start chain but an end residue from another chain, producing invalid secondary-structure annotations. Restrict the i/i+3 comparison and segment coalescing to the same chain/residue run.
Useful? React with 👍 / 👎.
| nx, ny, nz, mode = struct.unpack("<4i", header[:16]) | ||
| nsymbt = struct.unpack("<i", header[92:96])[0] | ||
| fh.seek(1024 + nsymbt) | ||
| raw = fh.read() |
There was a problem hiding this comment.
Avoid reading entire cryo-EM maps into memory
On realistic cryo-EM maps this unconditional fh.read() loads all voxel bytes before either the numpy path or the advertised stdlib sampler can run; maps can be hundreds of MB to multiple GB, so map_info.py can exhaust memory just to report contour suggestions. Stream/sample the voxel data, memory-map it, or use header statistics when available instead of materializing the full map.
Useful? React with 👍 / 👎.
Summary
New shipped tools and docs for structure rendering, animation, and cryo-EM maps. All stdlib-only, JSON output, graceful degradation — consistent with the existing skill.
render/spin/run.spinturntable movies (ray-traced frames → ffmpeg,cache_frames 0guard, graceful no-ffmpeg fallback);--preset publication|illustration|soft;--color plddt.proteus_doctor.py, hardened.gitignore.Test
make test— 16 tests pass (4 new).