🧪 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
Data Analysis for First Year Laboratory at Imperial College, London.

Data Analysis for First Year Laboratory at Imperial College, London. For personal reference only, and to reference in lab reports and lab books.

Martin He 0 Aug 29, 2022
Numerical Analysis toolkit centred around PDEs, for demonstration and understanding purposes not production

Numerics Numerical Analysis toolkit centred around PDEs, for demonstration and understanding purposes not production Use procedure: Initialise a new i

George Whittle 1 Nov 13, 2021
The Dash Enterprise App Gallery "Oil & Gas Wells" example

This app is based on the Dash Enterprise App Gallery "Oil & Gas Wells" example. For more information and more apps see: Dash App Gallery See the Dash

Austin Caudill 1 Nov 08, 2021
This repository contains some analysis of possible nerdle answers

Nerdle Analysis https://nerdlegame.com/ This repository contains some analysis of possible nerdle answers. Here's a quick overview: nerdle.py contains

0 Dec 16, 2022
Statistical Rethinking: A Bayesian Course Using CmdStanPy and Plotnine

Statistical Rethinking: A Bayesian Course Using CmdStanPy and Plotnine Intro This repo contains the python/stan version of the Statistical Rethinking

Andrés Suárez 3 Nov 08, 2022
Udacity - Data Analyst Nanodegree - Project 4 - Wrangle and Analyze Data

WeRateDogs Twitter Data from 2015 to 2017 Udacity - Data Analyst Nanodegree - Project 4 - Wrangle and Analyze Data Table of Contents Introduction Proj

Keenan Cooper 1 Jan 12, 2022
Geospatial data-science analysis on reasons behind delay in Grab ride-share services

Grab x Pulis Detailed analysis done to investigate possible reasons for delay in Grab services for NUS Data Analytics Competition 2022, to be found in

Keng Hwee 6 Jun 07, 2022
Feature engineering and machine learning: together at last

Feature engineering and machine learning: together at last! Lambdo is a workflow engine which significantly simplifies data analysis by unifying featu

Alexandr Savinov 14 Sep 15, 2022
Data cleaning tools for Business analysis

Datacleaning datacleaning tools for Business analysis This program is made for Vicky's work. You can use it, too. 数据清洗 该数据清洗工具是为了商业分析 这个程序是为了Vicky的工作而

Lin Jian 3 Nov 16, 2021
Data imputations library to preprocess datasets with missing data

Impyute is a library of missing data imputation algorithms. This library was designed to be super lightweight, here's a sneak peak at what impyute can do.

Elton Law 329 Dec 05, 2022
CPSPEC is an astrophysical data reduction software for timing

CPSPEC manual Introduction CPSPEC is an astrophysical data reduction software for timing. Various timing properties, such as power spectra and cross s

Tenyo Kawamura 1 Oct 20, 2021
University Challenge 2021 With Python

University Challenge 2021 This repository contains: The TeX file of the technical write-up describing the University / HYPER Challenge 2021 under late

2 Nov 27, 2021
A computer algebra system written in pure Python

SymPy See the AUTHORS file for the list of authors. And many more people helped on the SymPy mailing list, reported bugs, helped organize SymPy's part

SymPy 9.9k Dec 31, 2022
BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings.

BinTuner is a cost-efficient auto-tuning framework, which can deliver a near-optimal binary code that reveals much more differences than -Ox settings. it also can assist the binary code analysis rese

BinTuner 42 Dec 16, 2022
sportsdataverse python package

sportsdataverse-py See CHANGELOG.md for details. The goal of sportsdataverse-py is to provide the community with a python package for working with spo

Saiem Gilani 37 Dec 27, 2022
This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics!

COSMETICS GENERATOR This cosmetics generator allows you to generate the new Fortnite cosmetics, Search pak and search cosmetics! Remember to put the l

ᴅᴊʟᴏʀ3xᴢᴏ 11 Dec 13, 2022
PySpark Structured Streaming ROS Kafka ApacheSpark Cassandra

PySpark-Structured-Streaming-ROS-Kafka-ApacheSpark-Cassandra The purpose of this project is to demonstrate a structured streaming pipeline with Apache

Zekeriyya Demirci 5 Nov 13, 2022
CleanX is an open source python library for exploring, cleaning and augmenting large datasets of X-rays, or certain other types of radiological images.

cleanX CleanX is an open source python library for exploring, cleaning and augmenting large datasets of X-rays, or certain other types of radiological

Candace Makeda Moore, MD 20 Jan 05, 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
Analyzing Covid-19 Outbreaks in Ontario

My group and I took Covid-19 outbreak statistics from ontario, and analyzed them to find different patterns and future predictions for the virus

Vishwaajeeth Kamalakkannan 0 Jan 20, 2022