๐Ÿ’ก Introduction๏ƒ

  • Pypi version Conda version
  • Tests status Build status Documentation Status Code coverage
  • Powered by RDKit Knime Hub

mols2grid is an interactive molecule viewer for 2D structures, based on RDKit.

Demo showing mols2grid's integration in a Jupyter notebook

๐Ÿ Installation๏ƒ


mols2grid was developped for Python 3.7+ and requires rdkit (>=2020.03.1), pandas and jinja2 as dependencies.
The easiest way to install it is from conda:

conda install -c conda-forge mols2grid

Alternatively, you can also use pip:

pip install rdkit mols2grid

If you notice that the selections, callbacks and interactive filtering arenโ€™t working as intended, you may have to manually activate the extension:

  • for Jupyter Lab: jupyter labextension install mols2grid

  • for Jupyter Notebook: jupyter nbextension install mols2grid

Compatibility

mols2grid is mainly meant to be used in notebooks (Jupyter notebooks, Jupyter Lab, and Google Colab) but it can also be used as a standalone HTML page opened with your favorite web browser, or embedded in a Streamlit app.

Since Streamlit doesnโ€™t seem to support ipywidgets yet, some features arenโ€™t functional: retrieving the selection from Python (you can still export it from the GUI) and using Python callbacks.

knime logo

You can also use mols2grid directly in KNIME, by looking for the `Interactive Grid of Molecules` component on the Knime HUB.
Make sure you have setup Knime's Python integration for the node to work.

๐Ÿ“œ Usage๏ƒ


You can display a grid from:

  • an SDFile

import mols2grid

mols2grid.display("path/to/molecules.sdf")
  • a pandas.DataFrame:

mols2grid.display(df, smiles_col="Smiles")
  • a list of RDKit molecules:

mols2grid.display(mols)

Please head to the notebooks and API reference sections for a complete overview of the features available.

๐Ÿš€ Resources๏ƒ


Feel free to open a pull request if youโ€™d like your snippets to be added to this list!

๐Ÿ‘ Acknowledgments๏ƒ


๐ŸŽ“ Citing๏ƒ


You can refer to mols2grid in your research by using the following DOI:

DOI:10.5281/zenodo.6591473

โš– License๏ƒ


Unless otherwise noted, all files in this directory and all subdirectories are distributed under the Apache License, Version 2.0:

Copyright 2021-2022 Cรฉdric BOUYSSET

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.