• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
zcpbx

zcpbx

MolstarViewer

Public
Like
MolstarViewer
Home
Code
13
frontend
9
routes
6
shared
2
utils
.vtignore
AGENTS.md
CHANGELOG.md
MIGRATION.md
QUICKSTART.md
README.md
deno.json
index.html
index.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
QUICKSTART.md
Code
/
QUICKSTART.md
Search
…
Viewing readonly version of main branch: v418
View latest version
QUICKSTART.md

Quick Start Guide

Get up and running with Molstar Viewer apps in minutes!

πŸš€ Accessing the Apps

The project serves four different Molstar visualization applications:

AppURLDescription
🧬 Viewer/viewerStandard molecular structure viewer
πŸ”¬ Docking Viewer/docking-viewerView molecular docking results
πŸ”­ Mesoscale Explorer/mesoscale-explorerExplore mesoscale structures
πŸ“– MVS Stories/mvs-storiesInteractive visualization stories

πŸ“– Basic Usage

View a PDB Structure

Load any PDB structure by ID:

/viewer?pdb=1cbs

Examples:

  • /viewer?pdb=1FAP - HIV-1 protease
  • /viewer?pdb=1CRN - Crambin
  • /viewer?pdb=4HHB - Hemoglobin

Load from AlphaFold DB

/viewer?afdb=P00520

Load from EMDB

/viewer?emdb=EMD-1832

Load Structure from URL

/viewer?structure-url=https://files.rcsb.org/download/1FAP.pdb&structure-url-format=pdb

βš™οΈ Customization

Hide UI Controls

/viewer?pdb=1cbs&hide-controls=1

Change Data Provider

Use RCSB instead of default PDBe:

/viewer?pdb=1cbs&pdb-provider=rcsb

Enable Illumination

Better lighting for publication-quality images:

/viewer?pdb=1cbs&illumination=1

Combine Multiple Options

/viewer?pdb=1cbs&hide-controls=1&pdb-provider=rcsb&illumination=1&pixel-scale=2

πŸ› οΈ Common Parameters

ParameterValuesDefaultDescription
pdbPDB ID-Load PDB structure
afdbUniProt ID-Load AlphaFold structure
emdbEMDB ID-Load EMDB map
hide-controls0 or 10Hide UI controls
pdb-providerpdbe, rcsbpdbeData provider
illumination0 or 10Enable illumination
pixel-scaleNumber1Rendering resolution
collapse-left-panel0 or 10Collapse left panel

See frontend/README.md for complete parameter list.

🎯 Common Use Cases

Presentation Mode

Clean viewer without controls:

/viewer?pdb=1cbs&hide-controls=1&collapse-left-panel=1

High-Quality Rendering

For screenshots and publications:

/viewer?pdb=1cbs&pixel-scale=2&illumination=1

Embed in Website

Use as iframe with minimal UI:

<iframe src="https://your-val.val.town/viewer?pdb=1cbs&hide-controls=1" width="800" height="600" frameborder="0"> </iframe>

Load Custom Structure

From your own server:

/viewer?structure-url=https://yourserver.com/structure.pdb&structure-url-format=pdb

🎨 Advanced Examples

Compare Structures (Coming Soon)

Use docking viewer for side-by-side comparison:

/docking-viewer?structure1=1cbs&structure2=2cbs

Interactive Stories (Coming Soon)

MVS Stories for guided visualizations:

/mvs-stories?story-id=example-story

Mesoscale Visualization (Coming Soon)

Explore large assemblies:

/mesoscale-explorer?cellpack-url=https://example.com/cellpack.json

πŸ› Troubleshooting

Structure Not Loading?

  1. Check if PDB ID is valid at RCSB PDB
  2. Try different provider: add &pdb-provider=rcsb
  3. Check browser console for errors (F12)

Slow Performance?

  1. Lower pixel scale: &pixel-scale=0.5
  2. Use WebGL1: &prefer-webgl1=1
  3. Try different power preference: &power-preference=low-power

Viewer Not Initializing?

  1. Open browser console (F12) to see error messages
  2. Check if JSR imports are loading correctly
  3. Verify browser supports WebGL

πŸ“š Next Steps

  • Read the full README.md for architecture details
  • Check frontend/README.md for all URL parameters
  • Explore the original source code in viewer/, docking-viewer/, etc.
  • Review CHANGELOG.md for migration details

🀝 Integration Examples

Simple Link

<a href="/viewer?pdb=1cbs">View Structure 1CBS</a>

Dynamic Loading

function loadStructure(pdbId) { window.location.href = `/viewer?pdb=${pdbId}`; }

Programmatic Access

// Wait for viewer to be created window.addEventListener('molstarViewerCreated', (event) => { const viewer = event.detail.viewer; console.log('Viewer ready!', viewer); // Now you can interact with the viewer programmatically viewer.loadPdb('1cbs'); });

πŸ’‘ Tips

  • Bookmark common structures with full URLs including parameters
  • Use consistent providers (pdbe or rcsb) for better caching
  • Start with pixel-scale=1 and adjust based on performance
  • Enable illumination for better visual quality in presentations
  • Hide controls when embedding in other applications
  • Check the console (F12) for detailed error messages

πŸ”— Useful Resources

  • Mol* Homepage
  • RCSB PDB
  • PDBe
  • AlphaFold DB
  • EMDB

Ready to visualize? Start with: /viewer?pdb=1cbs

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.