MolBokeh


NameMolBokeh JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/jeffrichardchemistry/molbokeh
SummarySimple package to display molecules images in bokeh interactive charts.
upload_time2024-02-15 14:42:42
maintainer
docs_urlNone
authorJefferson Richard
requires_python
licenseMIT
keywords cheminformatics chemistry qsar qspr molecular visualization molecular plot bokeh plot
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MolBokeh
[![PyPI version](https://img.shields.io/pypi/v/molbokeh)](https://pypi.python.org/pypi/molbokeh) [![PyPI Downloads](https://static.pepy.tech/badge/molbokeh)](https://www.pepy.tech/projects/molbokeh) [![This project supports Python 3.8+](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org/downloads)


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.

<img src="https://github.com/jeffrichardchemistry/molbokeh/blob/dev/example/content/molbokehview1.gif" width="400"/> <img src="https://github.com/jeffrichardchemistry/molbokeh/blob/dev/example/content/molbokehview2.gif" width="400"/>

# 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)](https://colab.research.google.com/drive/1SJPolSM_ZgjTMkra5LqQpk0mC5Jomqv8#scrollTo=dBJ3u_ivn-z-), [Colab (Opt2)](https://drive.google.com/file/d/1SJPolSM_ZgjTMkra5LqQpk0mC5Jomqv8/view?usp=sharing)

```python
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 |








            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jeffrichardchemistry/molbokeh",
    "name": "MolBokeh",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Cheminformatics,Chemistry,QSAR,QSPR,Molecular visualization,Molecular plot,bokeh plot",
    "author": "Jefferson Richard",
    "author_email": "jrichardquimica@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f4/e2/9a2c1d36faf7c7282492070de9262c8dbfbea00dab1f1bf1c8e206d45d66/MolBokeh-1.0.1.tar.gz",
    "platform": null,
    "description": "# MolBokeh\n[![PyPI version](https://img.shields.io/pypi/v/molbokeh)](https://pypi.python.org/pypi/molbokeh) [![PyPI Downloads](https://static.pepy.tech/badge/molbokeh)](https://www.pepy.tech/projects/molbokeh) [![This project supports Python 3.8+](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org/downloads)\n\n\nMolBokeh 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.\n\n<img src=\"https://github.com/jeffrichardchemistry/molbokeh/blob/dev/example/content/molbokehview1.gif\" width=\"400\"/> <img src=\"https://github.com/jeffrichardchemistry/molbokeh/blob/dev/example/content/molbokehview2.gif\" width=\"400\"/>\n\n# Installation\n\n```\npip3 install molbokeh\n```\n\n\n# Simple usage\n\nFor more detailed usage examples, look the notebook at `example/how_to_use.ipynb` or open in [Google Colab (Opt1)](https://colab.research.google.com/drive/1SJPolSM_ZgjTMkra5LqQpk0mC5Jomqv8#scrollTo=dBJ3u_ivn-z-), [Colab (Opt2)](https://drive.google.com/file/d/1SJPolSM_ZgjTMkra5LqQpk0mC5Jomqv8/view?usp=sharing)\n\n```python\nimport pandas as pd\nfrom MolBokeh import MolBokeh\nfrom bokeh.plotting import figure,show\nfrom bokeh.models import ColumnDataSource\n\npath = 'data.csv'\ndf = pd.read_csv(path)\n\nsource = ColumnDataSource(df)\nfig = figure(width=600, height=500,tools=\"pan,box_zoom,wheel_zoom,zoom_in,zoom_out,reset,save,hover\")\nfig.scatter(x='MolWt', y='MolLogP', source=source, size=12,alpha=0.6)\n\n## Adding molecules\nfig = MolBokeh().add_molecule(fig=fig,\n                              source=source,\n                              smilesColName='Smiles_canon',\n                              hoverAdditionalInfo=['MolWt','MolLogP','nRing','qed','TPSA'],\n                              molSize=(100,100))\nshow(fig)\n\n```\n\n\n\n### Parameters info\n\n|     **Parameter**     |                **Type**                 | **Default** | **Description**                                              |\n| :-------------------: | :-------------------------------------: | :---------: | :----------------------------------------------------------- |\n|         `fig`         |     `bokeh.plotting._figure.figure`     |  required   | Bokeh plot object created from `source(df)`                  |\n|       `source`        | `bokeh.models.sources.ColumnDataSource` |  required   | Bokeh data type used to plot initial chart.                  |\n|    `smilesColName`    |                  `str`                  |  required   | Smiles column name in dataframe used to create source object |\n| `hoverAdditionalInfo` |             `None or list`              |   `None`    | List of column names (variables) to be shown within the graphs hover. |\n|       `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 |\n\n\n\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple package to display molecules images in bokeh interactive charts.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/jeffrichardchemistry/molbokeh"
    },
    "split_keywords": [
        "cheminformatics",
        "chemistry",
        "qsar",
        "qspr",
        "molecular visualization",
        "molecular plot",
        "bokeh plot"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae8f2db9633940599bd46438fc654c48ab9636bb83947b5d3315ad623d028fdd",
                "md5": "8d2cfaff3c775c81252ccdade7ba4c87",
                "sha256": "6ace28f90c244d066b4b0234f6d461ec1424c104eed0ff131c45613647606421"
            },
            "downloads": -1,
            "filename": "MolBokeh-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d2cfaff3c775c81252ccdade7ba4c87",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5485,
            "upload_time": "2024-02-15T14:42:41",
            "upload_time_iso_8601": "2024-02-15T14:42:41.346777Z",
            "url": "https://files.pythonhosted.org/packages/ae/8f/2db9633940599bd46438fc654c48ab9636bb83947b5d3315ad623d028fdd/MolBokeh-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4e29a2c1d36faf7c7282492070de9262c8dbfbea00dab1f1bf1c8e206d45d66",
                "md5": "12684d5a5acdbed47b1ab9d6d58cfee1",
                "sha256": "33c15fe1730df7e92af1a37dd90249ba45ac4e02f53cc5d25fb099fe3ad7b115"
            },
            "downloads": -1,
            "filename": "MolBokeh-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "12684d5a5acdbed47b1ab9d6d58cfee1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5132,
            "upload_time": "2024-02-15T14:42:42",
            "upload_time_iso_8601": "2024-02-15T14:42:42.764737Z",
            "url": "https://files.pythonhosted.org/packages/f4/e2/9a2c1d36faf7c7282492070de9262c8dbfbea00dab1f1bf1c8e206d45d66/MolBokeh-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-15 14:42:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jeffrichardchemistry",
    "github_project": "molbokeh",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "molbokeh"
}
        
Elapsed time: 0.18422s