Skip to main content

MolBokeh

PyPI version PyPI Downloads This project supports Python 3.8+

MolBokeh is a simple package for viewing the image of molecules in interactive graphics from the Bokeh package without the need to run a web application such as flask or dash in the backend, thus facilitating integration with other tools and codes.

Installation

pip3 install molbokeh

Simple usage

For more detailed usage examples, look the notebook at example/how_to_use.ipynb or open in Google Colab (Opt1), Colab (Opt2)

import pandas as pd
from MolBokeh import MolBokeh
from bokeh.plotting import figure,show
from bokeh.models import ColumnDataSource

path = 'data.csv'
df = pd.read_csv(path)

source = ColumnDataSource(df)
fig = figure(width=600, height=500,tools="pan,box_zoom,wheel_zoom,zoom_in,zoom_out,reset,save,hover")
fig.scatter(x='MolWt', y='MolLogP', source=source, size=12,alpha=0.6)

## Adding molecules
fig = MolBokeh().add_molecule(fig=fig,
                              source=source,
                              smilesColName='Smiles_canon',
                              hoverAdditionalInfo=['MolWt','MolLogP','nRing','qed','TPSA'],
                              molSize=(100,100))
show(fig)

Parameters info

Parameter Type Default Description
fig bokeh.plotting._figure.figure required Bokeh plot object created from source(df)
source bokeh.models.sources.ColumnDataSource required Bokeh data type used to plot initial chart.
smilesColName str required Smiles column name in dataframe used to create source object
hoverAdditionalInfo None or list None List of column names (variables) to be shown within the graphs hover.
molSize tuple (150,150) Size of the image of the molecule to be shown within the hover, also changes the size of the hover frame

Metadata

Release files for MolBokeh 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MolBokeh 1.0.1
File Size Uploaded
MolBokeh-1.0.1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MolBokeh 1.0.1
File Interpreter ABI Platform
MolBokeh-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / MolBokeh-1.0.1.tar.gz

Download URL MolBokeh-1.0.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
33c15fe1730df7e92af1a37dd90249ba45ac4e02f53cc5d25fb099fe3ad7b115
BLAKE2b-256 checksum
How to use checksums
f4e29a2c1d36faf7c7282492070de9262c8dbfbea00dab1f1bf1c8e206d45d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release files / MolBokeh-1.0.1-py3-none-any.whl

Download URL MolBokeh-1.0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ace28f90c244d066b4b0234f6d461ec1424c104eed0ff131c45613647606421
BLAKE2b-256 checksum
How to use checksums
ae8f2db9633940599bd46438fc654c48ab9636bb83947b5d3315ad623d028fdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page