Skip to content

Feat: Convert Molstar Homepage Examples to Mol-view-spec/mol-views-stories#109

Merged
zachcp merged 18 commits intomainfrom
feat/new-stories
Apr 3, 2026
Merged

Feat: Convert Molstar Homepage Examples to Mol-view-spec/mol-views-stories#109
zachcp merged 18 commits intomainfrom
feat/new-stories

Conversation

@zachcp
Copy link
Copy Markdown
Collaborator

@zachcp zachcp commented Jan 18, 2026

Description

The molstar homepage has a set of beautiful examples. When you click on these examples you load a Molstar instance that loads a .molx file which is a zip file containing an assets directory and an internal Molstar state tree. Given that we now have mol-view-stories, we should be able to recreate those exact examples via a Story.

image

Actions

This PR will attempt to convert each of those examples and highlight any potential shortfalls in MVS.

Conversion Approach

# open original in one browser window
# open the WIP in another browser tab using:
 deno run --allow-read --allow-write --allow-env --allow-net \
    main.ts watch examples/molstar-examples/motor-hook/
 
# the initial plan/prompt told claude to inspect the molx/state.json file and conversion to molviewSpec via the JS api.
# interact with claude to update the code as per my description to match target. 
# there are enough examples in the cli folder that claude can often pickup the correct JS patterns.  

Molstar Examples Conversion Status

ID Title Comparison Issues/TODOs Status
motor-hook Bacterial Flagellar Motor-Hook Complex motor-hook comparison • Differences in lighting/occlusion
• Spin/animation not working
• Component names missing on right
🟡 Partial
zika-em Zika Virus Assembly and Cryo-EM Density zika comparison • (No specific issues noted) 🟢 Good
1rb8-assembly PhiX174 DNA Binding Protein Assembly 1rb8 comparison • State file looks up symmetry groups from RCSB but need to calculate it
• Upstream example had symmetry axes in wrong place
• Missing cage geometry
• Using lines instead of pentagon/triangle
🔴 Major gaps
cytochromes P-450 Cytochromes Superposition cytochromes comparison 1
cytochromes comparison 2
Polymer coloring:
• Need pdbe-structure-quality-report with issue-count type
• Change from .color({ color: "#4caf50" }) to .color({ custom: { pdbe_structure_quality_report: "issue-count" } })

Ligand coloring:
• Need element-symbol with chain-based carbon coloring
• Params: saturation: 0, lightness: 0.2
• Check if MVS supports carbonColor parameter
🟡 Color scheme issues
btub BtuB in Lipid Bilayer btub comparison • No selector for "lipid"
• Gaussian surface of proteins excessively coarse
🔴 Major gaps
sars-cov-2-virion SARS-CoV-2 Virion sars comparison • Need to update color profiles 🟡 Color scheme issues
npc Nuclear Pore Complex npc comparison • No putty implementation
• Limited surface options
• Need to update colors
🔴 Major gaps
gain-md GAIN Domain Tethered Agonist Exposure gain-md comparison • Need to handle trajectory
• Color scheme updates needed
Leaving out of scope
villin-md Villin Folding Trajectory image • Color by secondary structure needed
• Alpha channel on surface not working
• Trajectory handling required
🟢 Good - Close match with minor or no issues
alpha-orbitals Alpha Orbitals and Density of Atorvastatin (Not yet converted) • To be assessed Leaving out of scope
lighting Lighting and Render Styles (Not yet converted) • To be assessed Leaving out of scope

Status Legend

  • 🟢 Good - Close match with minor or no issues
  • 🟡 Partial - Functional but with notable visual/feature differences
  • 🔴 Major gaps - Missing critical features
  • Not started - Not yet converted

@zachcp
Copy link
Copy Markdown
Collaborator Author

zachcp commented Jan 18, 2026

cc: @dsehnal

@dsehnal
Copy link
Copy Markdown
Member

dsehnal commented Jan 18, 2026

That's quite the audit :)

Trajectory handling required

MVS does support trajectory files. What's the issue here?

@zachcp
Copy link
Copy Markdown
Collaborator Author

zachcp commented Jan 19, 2026

MVS does support trajectory files. What's the issue here?

Wonderful. Do you have an example by any chance? I couldn't quite figure out a pure mvs way to load all the frames. If you can point the way I can update these and the docs as well.

zachcp added 16 commits April 3, 2026 14:53
…coloring

- Load XTC trajectory coordinates separately from GRO structure file
- Add animation cycling through 100 trajectory frames over 5 seconds
- Apply secondary structure coloring to cartoon representation (helices, sheets, loops)
- Add transparent surface with low quality for better animation performance
- Update description to reflect trajectory animation support
- Load XTC trajectory coordinates separately from GRO structure file
- Add animation cycling through 100 trajectory frames over 5 seconds
- Add semi-transparent surface (50% opacity) with low quality for performance
- Update description to reflect trajectory animation support
- Visualization shows conformational changes during tethered agonist exposure
@zachcp zachcp force-pushed the feat/new-stories branch from 89454de to 1960736 Compare April 3, 2026 19:00
@zachcp zachcp marked this pull request as ready for review April 3, 2026 19:31
@zachcp
Copy link
Copy Markdown
Collaborator Author

zachcp commented Apr 3, 2026

After adding molstar/molstar#1783 and getting it into molstar in 5.8, I updated the NPC example which now looks great. I'm going to accept/merge these.

Screenshot 2026-04-03 at 3 33 22 PM

@zachcp zachcp merged commit e4ebd7b into main Apr 3, 2026
4 checks passed
@zachcp zachcp deleted the feat/new-stories branch April 3, 2026 19:34
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