feat: render mutated residues as spheres in ChimeraX plots for better…#107
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves ChimeraX snapshot readability by rendering the residues that receive attribute-based coloring as spheres, making the mutation-associated colors stand out more clearly against the cartoon ribbon.
Changes:
- Extend
get_chimerax_command(...)to optionally render “colored/mutated” residue positions as spheres (and hide their cartoons) before saving the image. - Compute and pass
colored_positionsfrom the per-gene result table so the highlighted residues match those present in the generated.defattrfiles. - Minor formatting/whitespace cleanup around the updated call sites.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… visibility # Conflicts: # scripts/plotting/chimerax_plot.py
…using computed values
3827449 to
129e3ae
Compare
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
Mutated residues are colored by attribute in
chimerax-plotoutput, but the color is washed out by the cartoon ribbon, making it hard to read. Mirror the visualization used in the Oncodrive3D paper: hide the cartoon for the mutated residues and render them as spheres in their attribute color.Mutated residues = colored residues = positions written to the
.defattrfile (result_gene.dropna()), so they're computed once per gene from the existing data — no new inputs.Changes
get_chimerax_commandgets a new optionalcolored_positions=Noneparameter. When provided, appends to the ChimeraX--cmdscript:sel :<positions>; style sel sphere; hide sel cartoons; show sel atoms; ~sel;generate_chimerax_plotcomputescolored_positionsonce per gene and passes it to both the regular and cluster-variant chimerax calls.