PDBeMolstar as anywidget
Project description
ipymolstar
Live Demos
Give ipymolstar a spin without even installing python!
- Try it in jupyter lab via JupyterLite 🌍🚀
- Explore the solara ☀️ demo application on Ploomber-cloud ⛅
- Grab a cup and play with the solara, pyshiny or panel live demo's on PyCafé ☕
- Upload your Alphafold3 .zip result and view plddt or chain colors in the
solarafoldresult viewer on huggingface 🤗
Preview
You can run a quick preview of ipymolstar in a notebook with juv:
juv run example.ipynb
Installation
pip install ipymolstar
[!WARNING]
Make sure you install ipymolstar in an environment that contains your installation of Jupyter. If you have installed Jupyter in a different environment from your project (requiring you to use a named, non-default kernel), you will have to install ipymolstar (or only anywidget) in your Jupyter environment as well.
Use
from ipymolstar import PDBeMolstar
view = PDBeMolstar(molecule_id='1qyn', theme='light', hide_water=True)
view
Loading local data, hiding the buttons:
from pathlib import Path
fpth = Path().resolve() / 'assets' / '6vsb.bcif'
custom_data = {
'data': fpth.read_bytes(),
'format': 'cif',
'binary': True,
}
view = PDBeMolstar(
custom_data=custom_data,
hide_controls_icon=True,
hide_expand_icon=True,
hide_settings_icon=True,
hide_selection_icon=True,
hide_animation_icon=True,
hide_water=True,
hide_carbs=True,
)
view
See the example notebook for more advanced usage. Solara example code can be found here
Citing
ipymolstar uses anywidget to create a widgets based on Mol*
To cite Mol*:
David Sehnal, Sebastian Bittrich, Mandar Deshpande, Radka Svobodová, Karel Berka, Václav Bazgier, Sameer Velankar, Stephen K Burley, Jaroslav Koča, Alexander S Rose: Mol* Viewer: modern web app for 3D visualization and analysis of large biomolecular structures, Nucleic Acids Research, 2021; 10.1093/nar/gkab31.
PDBeMolstar
The PDBeMolstar widget is based on the PDBe integration of Mol*.
MolViewSpec
The MolViewSpec widget is based on MolViewSpec. To cite MolViewSpec:
Sebastian Bittrich, Adam Midlik, Mihaly Varadi, Sameer Velankar, Stephen K. Burley, Jasmine Y. Young, David Sehnal, Brinda Vallat: Describing and Sharing Molecular Visualizations Using the MolViewSpec Toolkit, Current Protocols, 2024; 10.1002/cpz1.1099
See also the RCSB citation policies for additional citation information.
Development
The molviewspec widget front-end code bundles it's JavaScript dependencies. After setting up Python, make sure to install these dependencies locally:
npm install
While developing, you can run the following in a separate terminal to automatically rebuild JavaScript as you make changes:
npm run dev
Creating a new release
- update
__version__in__init__.py - create a new release on GitHub, choose as tag 'v' +
__version__; ie 'v0.0.3' - GitHub actions should automatically deploy to PyPi
Hot reloading
To enable anywidget hot reloading, you need to set the env var ANYWIDGET_HMR to 1.
Windows:
set ANYWIDGET_HMR=1
jupyter lab
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ipymolstar-0.1.0.tar.gz.
File metadata
- Download URL: ipymolstar-0.1.0.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39abe60c3a53d484c06b960871e9f9077201cd771f149c9f71ab138fb5fd6e71
|
|
| MD5 |
3c78b68eda98aad3d5c3145cb7b8153a
|
|
| BLAKE2b-256 |
7b26fad1d05042580e84eb26315d14cd0501887c7e6d77cb1da5f126c44d74c7
|
Provenance
The following attestation bundles were made for ipymolstar-0.1.0.tar.gz:
Publisher:
pypi_main.yml on Jhsmit/ipymolstar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ipymolstar-0.1.0.tar.gz -
Subject digest:
39abe60c3a53d484c06b960871e9f9077201cd771f149c9f71ab138fb5fd6e71 - Sigstore transparency entry: 194831050
- Sigstore integration time:
-
Permalink:
Jhsmit/ipymolstar@54ace8a4ba01abce9b98fa7d786ef8706339bbc9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jhsmit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_main.yml@54ace8a4ba01abce9b98fa7d786ef8706339bbc9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ipymolstar-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: ipymolstar-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1361541cd25927a0daa41de9647c6116266a4f1f7d31888bee02a308cb97f1d8
|
|
| MD5 |
9c3fba9776c2ddbd698f5f3c4d6f6e4e
|
|
| BLAKE2b-256 |
b2725907058da13cb4dbecb58e0d1035a5e1ca16cb69fed64f797b0cf205d1bf
|
Provenance
The following attestation bundles were made for ipymolstar-0.1.0-py2.py3-none-any.whl:
Publisher:
pypi_main.yml on Jhsmit/ipymolstar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ipymolstar-0.1.0-py2.py3-none-any.whl -
Subject digest:
1361541cd25927a0daa41de9647c6116266a4f1f7d31888bee02a308cb97f1d8 - Sigstore transparency entry: 194831052
- Sigstore integration time:
-
Permalink:
Jhsmit/ipymolstar@54ace8a4ba01abce9b98fa7d786ef8706339bbc9 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Jhsmit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_main.yml@54ace8a4ba01abce9b98fa7d786ef8706339bbc9 -
Trigger Event:
release
-
Statement type: