Skip to content

feat: auto-detect AlphaFold version in chimerax-plot from dataset contents#103

Merged
St3451 merged 1 commit into
masterfrom
feat/chimerax-af-version-autodetect
May 28, 2026
Merged

feat: auto-detect AlphaFold version in chimerax-plot from dataset contents#103
St3451 merged 1 commit into
masterfrom
feat/chimerax-af-version-autodetect

Conversation

@St3451
Copy link
Copy Markdown
Collaborator

@St3451 St3451 commented May 28, 2026

Summary

chimerax-plot reconstructs PDB filenames as AF-<id>-F<n>-model_v<af_version>.pdb, taking af_version from a CLI flag (default 6). The Nextflow pipeline never forwards --af_version, and MANE builds force v4 — so against a v4 dataset, every PDB lookup fails and the script silently skips every gene with no output.

Inspect <datasets_dir>/pdb_structures/ at runtime and pick the AlphaFold version actually present. The user-supplied --af_version is now used only as a tiebreaker when multiple versions coexist.

The chimerax-plot subcommand reconstructs the PDB filename from the
--af_version CLI option (default 6), but the Nextflow pipeline never
forwards that option and MANE builds force v4. Result: when a user runs
chimerax-plot against a v4 dataset without passing --af_version, every
candidate PDB path 404s and the script silently skips every gene with
no output.

Inspect <datasets_dir>/pdb_structures/ at runtime and pick the AF version
actually present. The user-supplied --af_version is used only as a
tiebreaker when multiple versions coexist; otherwise it's a hint at best.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 28, 2026 15:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes chimerax-plot failing to find any PDBs when the dataset was built with a different AlphaFold DB version than the CLI default by detecting the version directly from the dataset’s pdb_structures/ directory.

Changes:

  • Added detect_af_version() helper to scan <datasets_dir>/pdb_structures/ for *-model_v<N>.pdb[.gz] files and select the appropriate AlphaFold version.
  • Updated generate_chimerax_plot() to use the detected version (using --af_version only as a tiebreaker when multiple versions exist).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
scripts/plotting/utils.py Adds AlphaFold version detection logic by inspecting filenames in pdb_structures/.
scripts/plotting/chimerax_plot.py Uses detected AlphaFold version before constructing candidate PDB paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@St3451 St3451 changed the title feat: auto-detect AlphaFold version from data dir in chimerax-plot feat: auto-detect AlphaFold version in chimerax-plot from dataset contents May 28, 2026
@St3451 St3451 merged commit b796b4b into master May 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants