🧪 Panel-Chemistry - exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.

Overview

🧪 Panel-Chemistry

👨‍🔬 📈 🛠️ 🐍 ❤️

Python Versions Style Black License Test Results Follow on Twitter

The purpose of the panel-chemistry project is to make it really easy for you to do exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.

Panel Chemistry Teaser

Check out the panel-chemistry examples on Binder

Jupyter Notebook Jupyter Labs Panel Apps
Binder Binder Binder

🏁 Background

This project is just starting (2021-05-19) and not much more than an idea.

It was started by the discussion How to display JSME molecular editor with Panel? in the Panel Community Forum

🏃 Getting Started

pip install panel-chemistry

Run the below in a Notebook or using panel serve NAME_OF_SCRIPT.py.

import panel as pn
from panel_chemistry.widgets import JSMEEditor

pn.extension("jsme", sizing_mode="stretch_width")
smiles="N[C@@H](CCC(=O)N[C@@H](CS)C(=O)NCC(=O)O)C(=O)O"
editor = JSMEEditor(value=smiles, height=500, format="smiles")

editor.servable()

JSME Editor

👩‍🏫 Examples

Check out the panel-chemistry reference guides on Binder

Guide Github Notebook Jupyter Notebook Jupyter Labs Panel Apps
JSME Editor View Binder Binder Binder
NGL Viewer View Binder Binder Binder

💡 Inspiration

🎁 Contributing

If you want to contribute reach out via Github Issues or in the Contributor Community Forum on Gitter: https://gitter.im/panel-chemistry/community#

For more details see the Developer Guide

FAQ

How do I Install with Conda?

You can do

conda install pip
pip install panel-chemistry

You can also include panel-chemistry in your environment.yaml file as described on Stack Overflow: Combining conda environment.yml with pip requirements.txt.

Comments
  • Request for Conda support

    Request for Conda support

    As chemo-informaticians nowadays who use Python, are mainly relied on RDKit to compute about molecule information, it is preferable that that RDKit could be easily bundled in panel-chemistry. But, since RDKit installation with pip is really tedious, registering panel-chemistry in Anaconda repository could help users to use it easily.

    opened by arifin-chemist89 17
  • Adds Pbde Molstar

    Adds Pbde Molstar

    Continuation of #19

    A Panel Pane to wrap the PDBe implementation of the Mol* ('MolStar') viewer.

    Check out

    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; https://doi.org/10.1093/nar/gkab314.

    Todo:

    • [] Test that dynamic updates work
    • [] Decide if light theme should be could default as is custom in Panel.
    • [] Decide if default theme should be dark or default/ light.
    • [] Add/ use utility functions
    • [] Add events.
    • [] Fix that the component get slower and slower on each rerender.
    • [] Reference Notebook
    • [] Add automated tests
    • [] Test, Test, Test
    • [] pypi package
    • [] conda package
    • [] Communication

    Nice to have

    • Some Gallery notebook showing an example application.
    • Some way to update the css file across all PdbeMolstar instances when the theme changes.
    • Set default theme based on theme=default or them=dark url query args.
    opened by MarcSkovMadsen 16
  • Add pdbe molstar viewer

    Add pdbe molstar viewer

    Current status of the PR adds the PBDe webcomponent implementation of the molstar viewer

    The webcomponent works well although there are some bugs/confusion around setting of some boolean parameters: https://github.com/PDBeurope/pdbe-molstar/issues/44

    pdbe-molstar-webcomponent

    I'm planning to further add the PDBe JS plugin as ReactiveHTML and perhaps also the Mol* viewer

    opened by Jhsmit 7
  • Molstar updates

    Molstar updates

    A Panel Pane to wrap the PDBe implementation of the Mol* ('MolStar') viewer.

    Check out

    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; https://doi.org/10.1093/nar/gkab314.

    Continuation of #20

    Changes:

    • Adding a default visual style hides waters by default, set default to None
    • Theme default to default (= light)
    • Hide structure split per boolean, update via visual.visibility
    • Hide canvas button split per boolean, update via rerender (only works for some buttons)
    • Added function for coloring a selection (one color)
    • Add function for coloring a selection (many colors)

    I've changed the theme to 'default' (which is light). Since this is the default in panel I think it makes the most sense. It looks like the CSS theme already updates across PDBeMolStar instances (at least in jupyer notebooks) Ideally we would also couple the background color to the theme. Previously I used bg_color with default=None and set the bg color depending on the theme but that is currently bugged (https://github.com/holoviz/panel/issues/3058). Ideally as you state under 'nice to have' would be nice to have it like that :)

    The selection and coloring API has a few more options (color by auth_residue_number,) which I'm not familiar with but I suspect its related to the mmCIF protein structure data format

    Current (known) bugs:

    • [ ] If you set hide_water is True via __init__ they cannot be switched back to show

    Previous:

    Todo:

    • [x] Test that dynamic updates work
    • [x] Decide if light theme should be could default as is custom in Panel.
    • [x] Decide if default theme should be dark or default/ light.
    • [x] Add/ use utility functions
      • [x] ~~.select()~~ color() function can be used for coloring
      • [x] `.clear_selection()
      • [x] highlight()
      • [x] clear_highlight()
      • [x] reset()
    • [x] Add events.
      • [x] hide/show water, het, polymer, etc
      • [x] hide/show some (but not all) canvas buttons
    • [ ] Fix that the component get slower and slower on each rerender. (I have not experienced this)
    • [x] Reference Notebook
    • [x] Add automated tests
    • [ ] Test, Test, Test
      • [ ] Test on non-protein molecules
      • [ ] Test other formats than pdb (mmcif, mdtraj?)
    • [ ] pypi package
    • [ ] conda package
    • [ ] Communication

    Nice to have

    • Some Gallery notebook showing an example application.
    • Some way to update the css file across all PdbeMolstar instances when the theme changes (this seems to happen already, at least in the notebook example).
    • Set default theme based on theme=default or them=dark url query args.
    opened by Jhsmit 6
  • pip install failure

    pip install failure

    I was following the instructions from video 0.1:

    git clone https://github.com/MarcSkovMadsen/panel-chemistry.git
     cd panel-chemistry
     conda create --name panel-chemistry
     conda activate panel-chemistry
     pip install -e .[all]
    

    this resulted in an error for pywinpty

     Cargo, the Rust package manager, is not installed or is not on PATH.
        This package requires Rust and Cargo to compile extensions.
    
    opened by ea42gh 6
  • Question about static-dirs in panel

    Question about static-dirs in panel

    Hi, I've been working with the pdbe molstar code and I think it's fantastic. I'm a little confused about how static files would work for panel in a jupyter notebook though. Is there a way to specify an assets directory in a notebook without running panel serve --static-dirs from the command line?

    opened by cschlick 5
  • Fixing issue #23 (import error with panel 0.13+)

    Fixing issue #23 (import error with panel 0.13+)

    Fixing issue in #23 : cannot import name 'string_types' from 'panel.util' They removes from six import string_types in panel 0.13, so I juste replaced

    from panel.util import lazy_load, string_types
    

    by

    from panel.util import lazy_load
    from six import string_types
    
    opened by tubiana 2
  • Configure Project for

    Configure Project for "Prebuilt Bokeh Extensions"

    We also need to setup the project to support pre-built Bokeh Extensions.

    This is described in https://awesome-panel.readthedocs.io/en/latest/guides/awesome-panel-extensions-guide/bokeh-extensions.html#prebuilt-bokeh-extensions. If possible we should record and distribute this as a video to make it easier for the Panel Community to build new packages/ extensions in the future.

    opened by MarcSkovMadsen 2
  • Make it dead easy to try panel-chemistry

    Make it dead easy to try panel-chemistry

    Request

    Make it dead easy to try panel-chemistry. I would like a CLI tool panel-chemistry with the commands

    • hello which panel serves the example notebooks
    • examples which copies the example notebooks to /examples/panel-chemistry.

    Motivation

    Currently there is some friction to try out panel-chemistry. You have to open Binder (slow) or download the notebooks from github. It takes some time and some users might now how to do or understand its possible. You can also git clone the repo. There are 4 commands you have to execute and it might fail.

    Drawbacks

    It would add dependencies like Typer and Rich to the package if we implement it like the awesome-panel-cli.

    Alternatives

    • Not do it.
    • I've also considered whether the awesome-panel-cli should enable plugins. So having one cli to collect everything. But I think

    Additional Context

    We should do this in a general way that is consistent with awesome-panel-cli, panel-highcharts etc.

    enhancement 
    opened by MarcSkovMadsen 1
  • Feature/0.2.0

    Feature/0.2.0

    Updates the package to v 0.0.2 and

    • adds Panel 0.14.0 support and Python 3.10 support
    • removes Python 3.6 support
    • refactors to an awesome-panel-cli powered project.
    opened by MarcSkovMadsen 1
  • ImportError: cannot import name 'string_types' from 'panel.util'

    ImportError: cannot import name 'string_types' from 'panel.util'

    When testing on panel 0.13.0rc5 I get

    2022-04-07 21:06:14,769 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x0000029BC5655100>: cannot import name 'string_types' from 'panel.util' (c:\repos\private\awesome-panel\.venv\lib\site-packages\panel\util.py)
    File 'ngl_viewer.py', line 15, in <module>:
    from panel.util import lazy_load, string_types Traceback (most recent call last):
      File "c:\repos\private\awesome-panel\.venv\lib\site-packages\bokeh\application\handlers\code_runner.py", line 231, in run
        exec(self._code, module.__dict__)
      File "C:\repos\private\awesome-panel\awesome_panel\apps\py3dmol.py", line 4, in <module>
        from panel_chemistry.pane import Py3DMol
      File "c:\repos\private\awesome-panel\.venv\lib\site-packages\panel_chemistry\pane\__init__.py", line 6, in <module>
        from .ngl_viewer import NGLViewer
      File "c:\repos\private\awesome-panel\.venv\lib\site-packages\panel_chemistry\pane\ngl_viewer.py", line 15, in <module>
        from panel.util import lazy_load, string_types
    ImportError: cannot import name 'string_types' from 'panel.util' (c:\repos\private\awesome-panel\.venv\lib\site-packages\panel\util.py)
    
    opened by MarcSkovMadsen 1
  • Align teaser .gif video with awesome-panel-cli video

    Align teaser .gif video with awesome-panel-cli video

    Request

    Align the panel-chemistry intro video

    with the awesome-panel-cli video

    Motivation

    • I think the awesome-panel-cli video communicates better.
    • I would like the same look and feel across awesome-panel projects.

    Drawbacks

    Takes time.

    Alternatives

    Keep it as it is.

    Additional Context

    The panel-chemistry video is

    https://github.com/awesome-panel/panel-chemistry/blob/main/assets/panel-chemistry-teaser.gif

    The awesome-panel-cli video is

    https://github.com/awesome-panel/awesome-panel-cli/blob/main/assets/videos/awesome-panel-cli-intro.gif

    documentation enhancement good first issue 
    opened by MarcSkovMadsen 0
  • Add NGL Molecule Viewer

    Add NGL Molecule Viewer

    PyHDX has an existing NGL Molecule Viewer which is ok to copy or get inspiration from.

    https://github.com/Jhsmit/PyHDX/blob/master/dev/bokeh_extension.py

    https://twitter.com/Jhsmit_/status/1398233190519693317

    image

    opened by MarcSkovMadsen 3
Releases(v0.0.6)
  • v0.0.6(May 25, 2021)

    Added guicolor and improved reference notebook of JSME Editor

    https://user-images.githubusercontent.com/42288570/119439642-13e1c400-bd23-11eb-8ad3-7826a030c771.mp4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(May 24, 2021)

    In this release

    • a first version of the JSMEEditor is included.
      • We created a draft of a nice reference notebook.
    • we released the first panel-chemistry package to Pypi. Check out https://pypi.org/project/panel-chemistry/
    • We improved the look and feel of the project

    jsme-editor-x1-5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(May 23, 2021)

    This release add a JSME Editor Widget. But only as a dummy widget.

    The idea is to demonstrate that the easiest way to add a new Bokeh/ Panel extension is to start as simple as possible. And that is to copy some existing small component, refactor minimally, build and test it works. Then you can start refactoring and extending the component.

    image

    You can see how this was implemented in this video https://youtu.be/AA8qIY_zrbA

    Supplementary written documentation can be found in

    Source code(tar.gz)
    Source code(zip)
  • v0.0.2(May 23, 2021)

  • v0.0.1(May 22, 2021)

    This Release provides the basic structure of a HoloViz Panel Extensions project. This includes

    • A nice CLI based on Python Invoke
    • Automated tests on pull requests and pushes to the main branch based on Github Actions.
    • A nice setup for Binder including example notebooks, panel apps served and VS Code server.
    • A nice setup.py file for release to PyPi.
    Source code(tar.gz)
    Source code(zip)
Owner
Marc Skov Madsen
Data, Models and Analytics Ninja. PhD, CFA® and Lead Data Scientist Developer at Ørsted. Developer of awesome-panel.org and awesome-streamlit.org
Marc Skov Madsen
PyEmits, a python package for easy manipulation in time-series data.

PyEmits, a python package for easy manipulation in time-series data. Time-series data is very common in real life. Engineering FSI industry (Financial

Thompson 5 Sep 23, 2022
International Space Station data with Python research 🌎

International Space Station data with Python research 🌎 Plotting ISS trajectory, calculating the velocity over the earth and more. Plotting trajector

Facundo Pedaccio 41 Jun 16, 2022
Programmatically access the physical and chemical properties of elements in modern periodic table.

API to fetch elements of the periodic table in JSON format. Uses Pandas for dumping .csv data to .json and Flask for API Integration. Deployed on "pyt

the techno hack 3 Oct 23, 2022
ETL pipeline on movie data using Python and postgreSQL

Movies-ETL ETL pipeline on movie data using Python and postgreSQL Overview This project consisted on a automated Extraction, Transformation and Load p

Juan Nicolas Serrano 0 Jul 07, 2021
Cold Brew: Distilling Graph Node Representations with Incomplete or Missing Neighborhoods

Cold Brew: Distilling Graph Node Representations with Incomplete or Missing Neighborhoods Introduction Graph Neural Networks (GNNs) have demonstrated

37 Dec 15, 2022
Uses MIT/MEDSL, New York Times, and US Census datasources to analyze per-county COVID-19 deaths.

Covid County Executive summary Setup Install miniconda, then in the command line, run conda create -n covid-county conda activate covid-county conda i

Ahmed Fasih 1 Dec 22, 2021
Evidence enables analysts to deliver a polished business intelligence system using SQL and markdown.

Evidence enables analysts to deliver a polished business intelligence system using SQL and markdown

915 Dec 26, 2022
🧪 Panel-Chemistry - exploratory data analysis and build powerful data and viz tools within the domain of Chemistry using Python and HoloViz Panel.

🧪📈 🐍. The purpose of the panel-chemistry project is to make it really easy for you to do DATA ANALYSIS and build powerful DATA AND VIZ APPLICATIONS within the domain of Chemistry using using Python a

Marc Skov Madsen 97 Dec 08, 2022
Randomisation-based inference in Python based on data resampling and permutation.

Randomisation-based inference in Python based on data resampling and permutation.

67 Dec 27, 2022
PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io

PyStan PyStan is a Python interface to Stan, a package for Bayesian inference. Stan® is a state-of-the-art platform for statistical modeling and high-

Stan 229 Dec 29, 2022
This mini project showcase how to build and debug Apache Spark application using Python

Spark app can't be debugged using normal procedure. This mini project showcase how to build and debug Apache Spark application using Python programming language. There are also options to run Spark a

Denny Imanuel 1 Dec 29, 2021
Zipline, a Pythonic Algorithmic Trading Library

Zipline is a Pythonic algorithmic trading library. It is an event-driven system for backtesting. Zipline is currently used in production as the backte

Quantopian, Inc. 15.7k Jan 07, 2023
Data Scientist in Simple Stock Analysis of PT Bukalapak.com Tbk for Long Term Investment

Data Scientist in Simple Stock Analysis of PT Bukalapak.com Tbk for Long Term Investment Brief explanation of PT Bukalapak.com Tbk Bukalapak was found

Najibulloh Asror 2 Feb 10, 2022
ASTR 302: Python for Astronomy (Winter '22)

ASTR 302, Winter 2022, University of Washington: Python for Astronomy Mario Jurić Location When: 2:30-3:50, Monday & Wednesday, Winter quarter 2022 Wh

UW ASTR 302: Python for Astronomy 4 Jan 12, 2022
Data Intelligence Applications - Online Product Advertising and Pricing with Context Generation

Data Intelligence Applications - Online Product Advertising and Pricing with Context Generation Overview Consider the scenario in which advertisement

Manuel Bressan 2 Nov 18, 2021
:truck: Agile Data Preparation Workflows made easy with dask, cudf, dask_cudf and pyspark

To launch a live notebook server to test optimus using binder or Colab, click on one of the following badges: Optimus is the missing framework to prof

Iron 1.3k Dec 30, 2022
PipeChain is a utility library for creating functional pipelines.

PipeChain Motivation PipeChain is a utility library for creating functional pipelines. Let's start with a motivating example. We have a list of Austra

Michael Milton 2 Aug 07, 2022
Helper tools to construct probability distributions built from expert elicited data for use in monte carlo simulations.

Elicited Helper tools to construct probability distributions built from expert elicited data for use in monte carlo simulations. Credit to Brett Hoove

Ryan McGeehan 3 Nov 04, 2022
X-news - Pipeline data use scrapy, kafka, spark streaming, spark ML and elasticsearch, Kibana

X-news - Pipeline data use scrapy, kafka, spark streaming, spark ML and elasticsearch, Kibana

Nguyễn Quang Huy 5 Sep 28, 2022
An Aspiring Drop-In Replacement for NumPy at Scale

Legate NumPy is a Legate library that aims to provide a distributed and accelerated drop-in replacement for the NumPy API on top of the Legion runtime. Using Legate NumPy you do things like run the f

Legate 502 Jan 03, 2023