awesome-panel / panel-chemistry

๐Ÿงช๐Ÿ“ˆ ๐Ÿ. 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 and HoloViz Panel.
MIT License
119 stars 16 forks source link

Add mols2grid #17

Open arifin-chemist89 opened 3 years ago

arifin-chemist89 commented 3 years ago

Chemical gallery viewer seems very interested. Example: https://github.com/cbouy/mols2grid

Do you think it is possible to add it to panel-chemistry?

MarcSkovMadsen commented 3 years ago

Sure.

The first thing to determine is if this is something that needs to be displayed only or if it needs bidirectional communication.

If its the first then the job is to determine how to get the html to display in a HTML pane. If its the second then its more complicated and involves a custom bokeh model.

As far as I can see this is something to display only.

image

Looking at the MolGrid.display function can give inspiration for how to display this in Panel.

image

I see two ways of "including" it in panel-chemistry. 1) We just create an example notebook showing how to use this with Panel. 2) We create a MolGrid pane that can take a molds2grid.MolGrid as input. What would you prefer @arifin-chemist89 ?

MarcSkovMadsen commented 3 years ago

Could you describe you use case and requirement some more @arifin-chemist89? This can be done in many ways. If you could write some pseudo example code of how you would like this to work. Maybe with an image or two. That would guide me the best.

arifin-chemist89 commented 3 years ago

Thanks @MarcSkovMadsen for quick response.

There are some of use cases for it that I can imagine.

  1. If we have a list of SMILES, we could display it with mols2grid, then some structures then use the sub list for other purposes (for example to plot the properties of those molecules, created the dataset of the selected molecules).
  2. With JSME editor that you have included to the panel-chemistry, we could build the lists of SMILES that obtained from JSME, and then show the gallery by using mols2grid.
  3. Hovering over the images or button click on the image to show the 3D structures by NGL.
arifin-chemist89 commented 3 years ago

Hi @MarcSkovMadsen, as you said, it is really easy to render it through panel's HTML pane. However, since the callback seems important, I prefer to have MolGrid pane.