altmol
altmol enhances Altair visualizations by integrating interactive 2D molecular structures,
leveraging RDKit for rendering.
This package is inspired by the capabilities of molplotly.
Installation
altmol can be easily installed using pip or poetry, accommodating both traditional and modern Python workflows.
Using pip
pip install altmol
Using Poetry
If you're managing your project with Poetry, add altmol to your project using:
poetry add altmol
Alternatively, you can manually add it to your pyproject.toml and then install it using:
poetry install
Quick Start
To get started with altmol, ensure you have Altair and RDKit installed in your environment.
Here's a simple example to illustrate how to create an interactive scatter plot with molecule visualizations:
import altair as alt
import pandas as pd
from altmol.plot import chem_plot
from altmol.chem import encode_molecules
# URL of the ESOL dataset
url_esol = 'https://raw.githubusercontent.com/deepchem/deepchem/master/datasets/delaney-processed.csv'
# Load your dataset
df = pd.read_csv(url_esol)
# Prepare your data (ensure you have a 'smiles' column for molecular structures)
df = encode_molecules(df, smiles_col_name='smiles', img_format='svg')
x_col_name = "measured log solubility in mols per litre"
y_col_name = "ESOL predicted log solubility in mols per litre"
# Generate and display the interactive plot
chart = chem_plot(
df,
x_axis=alt.X(f"{x_col_name}:Q", title="True Log solubility"),
y_axis=alt.Y(f"{y_col_name}:Q", title="Pred Log solubility"),
tooltip=[x_col_name, y_col_name],
selector=False,
interactive=False,
title="ESOL Regression"
)
chart.display()
Contributing
Contributions to altmol are welcome! Whether it's bug reports, feature requests,
or contributions to the code, we value your input.
License
altmol is released under the MIT License. See the LICENSE file for more details.
Acknowledgements
altmol is built upon the powerful capabilities of RDKit
and Altair, and we are grateful to the developers and contributors of these projects.
Metadata
Release files for altmol 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| altmol-0.2.2.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| altmol-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / altmol-0.2.2.tar.gz
| Download URL | altmol-0.2.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90173da9975067dcaf6d125eebe9b5be8d2189add52a931396e5aa9f111a9eee
|
|
BLAKE2b-256 checksum How to use checksums |
10c4403265f5e9fedd0e2f53e716b1772f99393c0ce2c4ec4bc6b0d5d332d405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / altmol-0.2.2-py3-none-any.whl
| Download URL | altmol-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f34db3f2cd62566a8af0894538d4d55e48fdc540d1673a2ece0fd1225a55654
|
|
BLAKE2b-256 checksum How to use checksums |
94b953497ecd8327b2a91453e42cd44c152e43a1cb7cf22d1b16d387c3060530
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|