feat: auto-detect AlphaFold version in chimerax-plot from dataset contents#103
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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_versiononly 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chimerax-plotreconstructs PDB filenames asAF-<id>-F<n>-model_v<af_version>.pdb, takingaf_versionfrom a CLI flag (default6). 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_versionis now used only as a tiebreaker when multiple versions coexist.