Skip to content

Try to bring molstar to Jupyter notebook (no lab yet).

Notifications You must be signed in to change notification settings

hainm/molstarview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usable but still "Work-in-progress"

Codes are copied/adapted from nglview and molstar. Will update the licenses.

molstarview-widget

Example

  • Load structure and trajectory
from molstarview.widget import MolstarView
from nglview.adaptor import SimpletrajTrajectory
import nglview as nv

traj = SimpletrajTrajectory(nv.datafiles.XTC, nv.datafiles.PDB)
view = MolstarView()
view.add_trajectory(traj)

struc = nv.FileStructure('1tsu.pdb')
view.add_structure(struc)
view

Installation

Only development installation is available (requires Node.js and Yarn version 1),

$ git clone https://github.com/molstar/molstarview-widget.git
$ cd molstarview-widget
$ pip install -e .
$ jupyter nbextension install --py --symlink --overwrite --sys-prefix molstarview
$ jupyter nbextension enable --py --sys-prefix molstarview

When actively developing your extension for JupyterLab, run the command:

$ jupyter labextension develop --overwrite molstarview

Then you need to rebuild the JS when you make a code change:

$ cd js
$ yarn run build

You then need to refresh the JupyterLab page when your javascript changes.

Acknowledgement

About

Try to bring molstar to Jupyter notebook (no lab yet).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published