Skip to main content

A collection of cheminformatics utility functions for use with marimo notebooks.

Project description

marimo-chem-utils

A collection of cheminformatics utility functions for use with marimo, an open-source reactive notebook for Python.

Installation

You can install marimo-chem-utils using pip:

pip install marimo-chem-utils

Usage

Here is an example of how to use some of the functions in this library.

import pandas as pd
import marimo as mo
from marimo_chem_utils import (
    add_fingerprint_column,
    add_image_column,
    add_inchi_key_column,
    add_tsne_columns,
    interactive_chart
)

# Load some data
df = pd.read_csv("https://raw.githubusercontent.com/PatWalters/datafiles/refs/heads/main/carbonic.csv")

# Add fingerprints, images, and InChI keys
df = add_fingerprint_column(df, fp_type="counts_fp")
df = add_image_column(df, smiles_column="SMILES")
df = add_inchi_key_column(df, smiles_column="SMILES")

# Generate t-SNE coordinates
df = add_tsne_columns(df)

# Create an interactive plot
chart = interactive_chart(df, x_col="TSNE_x", y_col="TSNE_y", color_col="PIC50", image_col="image")

# In a marimo cell, you would display the chart like this:
# mo.ui.altair_chart(chart)

This will create a pandas.DataFrame with additional columns for fingerprints, images, and InChI keys, and then generate an interactive t-SNE plot that you can explore in your marimo notebook. The plot will display molecule images in the tooltips.

Examples

The examples directory contains marimo notebooks that demonstrate how to use marimo-chem-utils. You can run them from the command line.

  • scatterplot.py: An interactive scatterplot that shows chemical structures as tooltips. Selections on the plot are used to display a grid of molecules.
marimo edit examples/scatterplot.py
  • clustering.py: An example of clustering molecules and viewing the cluster members.
marimo edit examples/clustering.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marimo_chem_utils-0.2.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marimo_chem_utils-0.2.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file marimo_chem_utils-0.2.2.tar.gz.

File metadata

  • Download URL: marimo_chem_utils-0.2.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for marimo_chem_utils-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a77af7802eef0d6524ea4d2adc779c6a2ea1b9f68237c800f3cab9a98116c889
MD5 05962a6609c2c4be8b03a9ecaeae7286
BLAKE2b-256 63f2360640cce7eec7686ad3901886afe33d1cd37bda23a58d07fcfd750d75cf

See more details on using hashes here.

File details

Details for the file marimo_chem_utils-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: marimo_chem_utils-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for marimo_chem_utils-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d7b4786c88bc9496eb46189a1f2cb19f3fe504484823a7b2b7e8cd71536be99
MD5 4cd144144a22de38ca52ea9c4ec68c40
BLAKE2b-256 f4058b1f28964f29c14ad7a6ada7baf3bafca8ae9d912347f688379e84791aff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page