Skip to content

feat: render mutated residues as spheres in ChimeraX plots for better…#107

Merged
St3451 merged 2 commits into
masterfrom
feat/chimerax-spheres-on-mutated-residues
May 28, 2026
Merged

feat: render mutated residues as spheres in ChimeraX plots for better…#107
St3451 merged 2 commits into
masterfrom
feat/chimerax-spheres-on-mutated-residues

Conversation

@St3451
Copy link
Copy Markdown
Collaborator

@St3451 St3451 commented May 28, 2026

Summary

Mutated residues are colored by attribute in chimerax-plot output, 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 .defattr file (result_gene.dropna()), so they're computed once per gene from the existing data — no new inputs.

Changes

  • get_chimerax_command gets a new optional colored_positions=None parameter. When provided, appends to the ChimeraX --cmd script: sel :<positions>; style sel sphere; hide sel cartoons; show sel atoms; ~sel;
  • generate_chimerax_plot computes colored_positions once per gene and passes it to both the regular and cluster-variant chimerax calls.

Copilot AI review requested due to automatic review settings May 28, 2026 16:53
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 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_positions from the per-gene result table so the highlighted residues match those present in the generated .defattr files.
  • Minor formatting/whitespace cleanup around the updated call sites.

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

Comment thread scripts/plotting/chimerax_plot.py Outdated
@St3451 St3451 force-pushed the feat/chimerax-spheres-on-mutated-residues branch from 3827449 to 129e3ae Compare May 28, 2026 17:16
@St3451 St3451 requested a review from Copilot May 28, 2026 17:16
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

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

@St3451 St3451 merged commit 4b49194 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