chemviz
Fast, easy-to-install chemical space visualization.
chemviz maps molecules with TMAP (Probst & Reymond), UMAP, t-SNE or PCA, all reimplemented in pure Python + numba: molecules in, an interactive map out, in one line. There is nothing to compile and no conda environment to set up, and it maps millions of molecules on a laptop.
Documentation: chemviz.readthedocs.io, with a gallery of interactive maps.
- One line:
cv.tmap("molecules.csv").save("map.html"). - Four methods, one API:
cv.tmap,cv.umap,cv.tsneandcv.pcatake the same inputs (SMILES lists, DataFrames, CSV/SDF files, fingerprints) and return the same map object. - Fast and light: a TMAP of 250k molecules in ~10 s from SMILES, 1M in under 40 s, the whole of ChEMBL (2.9M) in under 2 minutes with ~4 GB of RAM. From the same MinHash vectors, that is 2.5–3× faster than the original tmap, with 3–4× less memory.
- Interactive viewer: a single self-contained HTML file (WebGL) that shows the structure on hover, colours, filters, searches, lasso-selects and exports to CSV. It also works offline, and in Jupyter its selection syncs with Python.
- New molecules on an existing map:
ref.project("hits.csv")places them in seconds, without moving the map. - Static plots with matplotlib, and a command line:
chemviz tmap molecules.csv -o map.html.
Installation
pip install chemviz
# or
uv add chemviz
# with the Jupyter widget (selections synced with Python)
pip install "chemviz[jupyter]"
Requires Python ≥ 3.12. Every dependency (RDKit, numba, numpy, pandas, matplotlib, joblib) installs from wheels; UMAP and t-SNE need neither umap-learn nor openTSNE.
Quick start
import chemviz as cv
m = cv.tmap("molecules.csv") # the SMILES column is detected automatically
m.save("map.html") # interactive viewer, open it in any browser
m.plot(color="activity") # static matplotlib figure
m.save("map.chemviz") # the map itself, to reload with cv.load
cv.umap("molecules.csv").save("umap.html") # same for cv.tsne and cv.pca
hits = m.project("hits.csv") # place new molecules on the map, without moving it
From the command line:
chemviz tmap molecules.csv -o map.html -o map.chemviz
chemviz project map.chemviz hits.csv -o hits.html
Methods
| Method | What the map shows | ZINC250k | ChEMBL 1M |
|---|---|---|---|
cv.tmap |
A tree linking each molecule to a close neighbour: series and their branching are easy to follow, and nearest neighbours stay together. | 9 s | 37 s |
cv.umap |
Tight, well separated clusters; distances between clusters mean little. | 14 s | 58 s |
cv.tsne |
Clusters with fine local detail, well preserved neighbourhoods; distances between clusters mean little. | 90 s | 6.5 min |
cv.pca |
A linear projection of fingerprints: broad trends and gradients, but similar molecules overlap. | 5 s | 19 s |
Times are end to end from SMILES on a 20-thread desktop. chemviz's UMAP and t-SNE match the quality of umap-learn and openTSNE on the same neighbour graphs, and are faster; see the benchmarks and how to choose a method.
Credits
chemviz is an independent reimplementation of TMAP, MHFP, UMAP and t-SNE. If you use it, please cite the original work (see citing):
- D. Probst, J.-L. Reymond. Visualization of very large high-dimensional data sets as minimum spanning trees. J. Cheminform. 12, 12 (2020). doi:10.1186/s13321-020-0416-x
- D. Probst, J.-L. Reymond. A probabilistic molecular fingerprint for big data settings. J. Cheminform. 10, 66 (2018). doi:10.1186/s13321-018-0321-8
- L. McInnes, J. Healy, J. Melville. UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction. arXiv:1802.03426 (2018). doi:10.48550/arXiv.1802.03426
- L. van der Maaten, G. Hinton. Visualizing Data using t-SNE. J. Mach. Learn. Res. 9, 2579–2605 (2008).
- P. G. Poličar, M. Stražar, B. Zupan. openTSNE: A Modular Python Library for t-SNE Dimensionality Reduction and Embedding. J. Stat. Softw. 109(3) (2024). doi:10.18637/jss.v109.i03
License
MIT
Metadata
Release files for chemviz 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chemviz-0.2.0.tar.gz | 70.2 kB | With provenance | Details for chemviz-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chemviz-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for chemviz-0.2.0-py3-none-any.whl |
Total release size: 139.1 kB
Release files / chemviz-0.2.0.tar.gz
| Download URL | chemviz-0.2.0.tar.gz |
|---|---|
| Size | 70.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cc5e8785a5115d0704e858394a372cd980484d34206898215f33365f7990b05
|
|
BLAKE2b-256 checksum How to use checksums |
dbcd0824c5213d39ceba9a0b9b5fd5e2ab6524f5f8754f4862995d95903c91a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / chemviz-0.2.0-py3-none-any.whl
| Download URL | chemviz-0.2.0-py3-none-any.whl |
|---|---|
| Size | 68.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cb543bd2d62768e73d439905e289885515ba1110199b971725232307139b4fbd
|
|
BLAKE2b-256 checksum How to use checksums |
2ec7bf84dd26797791e7b7ec7b9695c7b36061efc5ad1daaf7ca26dacf28e64f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for chemviz 0.2.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for chemviz-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA 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.