Skip to main content

LazyChemVis

Automated 2D visualizations of chemical spaces.

LazyChemVis builds a set of reference 2D maps for a chemical library of interest and then projects new molecules onto those maps. It follows a fit → transform logic:

  • fit learns the reference chemical space once, from a (potentially large) library.
  • transform places any new set of molecules into that same space, cheaply and deterministically, without recomputing the reference embedding.

Four complementary projections are produced, each pairing a molecular representation with a dimensionality reduction method:

Projection Molecular representation Reduction method
PCA 15 physicochemical RDKit descriptors PCA
TMAP ECFP4 (Morgan, radius 2, 2048 bits) TMAP
t-SNE CheMeleon embeddings t-SNE (openTSNE)
UMAP CLAMP embeddings UMAP

At fit time, every projection is distilled into a lightweight surrogate, so transform does not need Docker, the Ersilia models or the TMAP environment. The method is described in the accompanying publication.

Installation

1. Main environment

LazyChemVis installs in two sizes. The base install is enough to project molecules onto an existing reference space; fitting a new one needs the fit extra.

conda create -n lazychemvis python=3.11
conda activate lazychemvis

# Projecting only (lazychemvis transform)
pip install "lazychemvis @ git+https://github.com/ersilia-os/lazy-chemvis.git"

# Fitting and projecting (lazychemvis fit and lazychemvis transform)
pip install "lazychemvis[fit] @ git+https://github.com/ersilia-os/lazy-chemvis.git"

LazyChemVis supports Python 3.11 and 3.12.

2. TMAP environment (required for fit only)

conda create -n tmap-env -c tmap -c conda-forge python=3.9 "tmap=1.0.6" numpy -y
conda env list | grep tmap-env
# e.g. /home/user/anaconda3/envs/tmap-env

--tmap-env expects the path to this environment directory, not its name. TMAP is available on Linux and Intel macOS only.

3. Ersilia and Docker (required for fit only)

The CheMeleon and CLAMP featurizers are served with Ersilia, which requires Docker. Follow the Ersilia installation instructions and make sure Docker is running before fitting.

Usage

LazyChemVis installs one command, lazychemvis, with two subcommands:

Command Description
lazychemvis fit Fit a reference chemical space from a library of molecules
lazychemvis transform Project new molecules onto a fitted reference space

Run lazychemvis <command> --help for the options of each.

Input format

Both commands take -i/--input, a required path to a CSV file with a header row and SMILES in the first column. Any further columns are ignored.

smiles
CCOc1ccc2nc(S(N)(=O)=O)sc2c1
CC(=O)Nc1ccc(O)cc1

Fitting a reference chemical space

lazychemvis fit \
    -i my_reference_library.csv \
    -r my_reference_space \
    --tmap-env /home/user/anaconda3/envs/tmap-env

Options:

Flag Description
-i, --input Required. Path to the CSV of reference SMILES
-r, --reference Required. Directory in which the fitted reference space is written
--tmap-env Required. Path to the TMAP conda environment directory
--no-cache Recompute every featurizer output instead of reusing the ones already in the reference directory
--low-memory Lighter TMAP settings for very large libraries (above ~1M molecules)
--no-report Skip building the HTML report
-v, --verbose Show the full log on the console

When it finishes, my_reference_space/report/report.html shows the four reference maps and a summary of surrogate quality. Re-running a fit into the same reference directory reuses the featurizer outputs already there, so an interrupted fit resumes where it stopped.

Projecting new molecules

lazychemvis transform \
    -i my_new_compounds.csv \
    -r my_reference_space \
    -o my_results

Options:

Flag Description
-i, --input Required. CSV of the molecules to project
-r, --reference Required. Directory of a previously fitted reference space
-o, --output Required. Directory for the output coordinates, figures and report
--no-plots Write only the CSV, skipping the figures and the report
--no-report Write the figures but skip the HTML report
-v, --verbose Show the full log on the console

Outputs written to the output directory:

  • coordinates.csv — one row per input molecule, in input order, with columns smiles, pca_x, pca_y, tmap_x, tmap_y, tsne_x, tsne_y, umap_x, umap_y. Unparseable SMILES keep their row; their TMAP coordinates are NaN, so filter on tmap_x before using the other columns.
  • report/report.html — the HTML report, with the figures also saved as PDF in report/pdf/. Keep the report/ folder together when sharing it.
  • lazychemvis.log — the full log of the run.

License

This repository is open-sourced under the GPL-3.0 license. See the LICENSE file for details.

About the Ersilia Open Source Initiative

The Ersilia Open Source Initiative is a tech-nonprofit organization fueling sustainable research in the Global South. Ersilia's main asset is the Ersilia Model Hub, an open-source repository of AI/ML models for antimicrobial drug discovery.

Ersilia Logo

Metadata

Release files for lazychemvis 1.4.0

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

Source distribution (sdist)

Source distribution for lazychemvis 1.4.0
File Size Uploaded Provenance Actions
lazychemvis-1.4.0.tar.gz 126.6 kB Without provenance Details for lazychemvis-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 256.7 kB

Release files / lazychemvis-1.4.0.tar.gz

Download URL lazychemvis-1.4.0.tar.gz
Size 126.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1836c866fbcccec873cfce2f321b970edcd5cd9ecc974dd377ce3a24a511d913
BLAKE2b-256 checksum
How to use checksums
157d8fe60a2883d56670bc4edd9afea6eec240a4dbe4b01c3107cae825bc7563
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.2 CPython/3.14.4 Linux/7.0.0-1020-azure

Release files / lazychemvis-1.4.0-py3-none-any.whl

Download URL lazychemvis-1.4.0-py3-none-any.whl
Size 130.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4474d27ebf616cbd70449e7301bcfb68bccf5d3de1d51df939aadf1ffaa701b
BLAKE2b-256 checksum
How to use checksums
93b611d91410af1565d03ca9b81ce8ffe325c4bd8d623681b03868e2dde47246
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.2 CPython/3.14.4 Linux/7.0.0-1020-azure

Security for lazychemvis 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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