Giter Club home page Giter Club logo

molbokeh's Introduction

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

molbokeh's People

Contributors

jeffrichardchemistry avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

niaev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.