Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhsmit/ipymolstar
PDBeMolstar as anywidget
https://github.com/jhsmit/ipymolstar
anywidget molstar pdbe
Last synced: 2 months ago
JSON representation
PDBeMolstar as anywidget
- Host: GitHub
- URL: https://github.com/jhsmit/ipymolstar
- Owner: Jhsmit
- Created: 2024-02-14T10:00:22.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-10-04T09:19:38.000Z (3 months ago)
- Last Synced: 2024-10-05T00:13:49.854Z (3 months ago)
- Topics: anywidget, molstar, pdbe
- Language: Jupyter Notebook
- Homepage:
- Size: 514 KB
- Stars: 22
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ipymolstar
![image](https://github.com/Jhsmit/ipymolstar/assets/7881506/589a94d5-2647-4977-90aa-c886c10cacb9)
## Live Demos
Give `ipymolstar` a spin without even installing python!
- Try it in jupyter lab via [JupyterLite](https://github.com/Jhsmit/ipymolstar-demo) 🌍🚀
- Explore the solara ☀️ [demo application](https://github.com/Jhsmit/ploomber-solara-ipymolstar) on [Ploomber-cloud](https://hidden-resonance-5816.ploomberapp.io) ⛅
- Grab a cup and play with the solara app demo code in [PyCafe](https://app.py.cafe/snippet/solara/v1?c=H4sIAN-cF2YAA8VZCW_bNhT-K5wKDErnOHGbLKsBYWuObgOWLluyAUMUGJRE20JkUqUoJ0aW_76PpCRT8tG0TTEasWTy8fHdB_PgxSJh3tBLZ7mQihQio5KGfCzFjKT5YiayQlFJquWL02N2bqd65OqXs_Ozywo2oYrGGS0KVtTAzVSP0CJJY1WB2jP6NEtpAyvvekTOQ94io5_RKOT681ODK-TmYSg5xeQw5AQDdLK4zNgoTYakUJIEJPQGHxY89CxAXBZKzEYaz5BoYsi_5L3gDID6YYGiySgWmZBLFC_eHelPjaXIUz4kkRAZVt_RrKg2TtOEjXKRLWYMmzes31G1ZXXKsCooiCw2wsRURptXueAjaIYnVEIIm1AIK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HGxbImISCNKYnYbZNBh1H4CupYQ6l_b91C57COlbkn1GOti1UoWubWJcsydlwqhXR7CWsAl6voDUnBOjt1cms9ahaC-mUNTNXZBToi7Y4zdm9Lcf22KwVS5U1n0zqmKxYs8T50xXSZ0vgMbGN5isE8AerdQTvgbUeGNGsE-jFsHce3uE7TuV-oRaaVOGU6Tg7Jq_0cvK7seHIUWCV8g9W4EXOd8PT4JKtxGLtE1dEqEN3R6OH0mOjD12hfD2si3RixDbhooI17bwB9ivV11F_FnCeLtp1D_hfhOna5TbyrEXC7gLO0UBvqli8T91r_OJmy-DYS92t4rfnU9yNrebSHLovdvobcFowyOosSSu7R3Dj5RO8K7rvMrRCMfsL650jX28QU9O7FxRoToMrc-KD9MNckD8vtj7qW_7ixaQSB_tpkYC4fL18-aNAhuX_cZltbJL6UekUyaZO81c4mDA2Bkk7zYel_VquJFF_W3FWcRtFJ41tEYjSbqGhM8dkjUSbi2-BKtmo3PdzMp3P7OeOlbwp3XCvJACfoMI-bnhEIQ4Gk0CCN4iwFNtMyrlOFnOsKQMgLQKG82SAmxIEEsnUMtq6Wt4io2rTedJtSfMV8t_lcLbeVDaEnWSIpUm9Pn22ZtiejNF82gn7dEH5HBijllqLe4kIvPq01fmG-n9rl7ugI5cNoq6vl3YeKQhito37bsQGsWR49tPso45c1-Oae356Hvw6LdUGl-z94Ti2nHQhK_-wg2d6O_0YXolR-PE2zRDJeCwdmruBZ5tFplM3c-tb6qQ25ZKg-uFMUV1QsmazpCeoX3DDg_iOi0qCEdbt44UrGPpfX4TtaThvvOXKZznA5Y7Tm9WCOH8pUGr0X-v8Jzf8OsKYrJMxZUvGb5rnWlDccm4sdjyWpOuM0ygCFIMYe_wOmoGbMlxgAAA) ☕
- Upload your Alphafold3 .zip result and view plddt or chain colors in the `solarafold` result viewer on [huggingface](https://huggingface.co/spaces/Jhsmit/solarafold) 🤗## Installation
```sh
pip install ipymolstar
```## Use
```python
from ipymolstar import PDBeMolstar
view = PDBeMolstar(molecule_id='1qyn', theme='light', hide_water=True)
view
```Loading local data, hiding the buttons:
```python
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](https://github.com/Jhsmit/ploomber-solara-ipymolstar)## Cite
`ipymolstar` uses [anywidget](https://github.com/manzt/anywidget) to create a widget based on the [PDBe integration](https://github.com/molstar/pdbe-molstar) of [Mol*](https://molstar.org/).
When using `ipymolstar`, please cite:
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](https://doi.org/10.1093/nar/gkab314).
See also the [RCSB citation policies](https://www.rcsb.org/pages/policies) for additional citation information.
## Development
### 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 th env var `ANYWIDGET_HMR` to 1.
Windows:
```bash
set ANYWIDGET_HMR=1
jupyter lab
```