Clustering molecules using Apple Silicon GPU
Project description
MLXMolCluster
Leverage Apple Silicon to cluster molecules using MLX.
At the time of writing, the project contains two clustering methods:
- Butina
- KMeans
Additional clustering methods will be added over time.
Examples have been written and can be found here.
Installation
Install from PyPI:
pip install mlx-mol-cluster
Or install directly from the GitHub repository:
pip install git+https://github.com/tlint101/MLXMolCluster.git
Example
The following is an example of clustering molecules using Butina on MLX.
# generate molecular fingerprints
fp_gen = rdFingerprintGenerator.GetRDKitFPGenerator(fpSize=1024)
rdkit_fps = [fp_gen.GetFingerprint(mol) for mol in mol_list]
# convert to mlx arrays
mlx_fp = fp_to_mlx(rdkit_fps)
# Butina cluster
butina_mlx = butina(mlx_fp)
A speed comparison can be seen at the tutorial section. The runs were performed on a M2 Pro chip
(10 CPU, 16 GPU)
NOTE: The figure can be misleading. The figure shows the clustering speed of already generated molecular fingerprints. The main bottleneck of clustering remains on the generation of molecular fingerprints. This is done on the CPU before being converted to the GPU. Depending on the number of molecules, this can be time intensive.
Additional
Collaborations are welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlx_mol_cluster-0.2.0.tar.gz.
File metadata
- Download URL: mlx_mol_cluster-0.2.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.14.2 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef1168fb9be65c79daaa5d1709124bcc9d1f33e2bc91fca8bd40ade8da3a125
|
|
| MD5 |
1843c5c5de072b7ebb489c0b68f2f73c
|
|
| BLAKE2b-256 |
9bd3dc4f25b6615aaf7e7f9b0085d20ba4fb420168668ef03d67488c0d66dfe2
|
File details
Details for the file mlx_mol_cluster-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mlx_mol_cluster-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.14.2 Darwin/25.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d385bdb4d8495979d94bd594af21dc5011e69ec352903e4dcd43b0842af06b3
|
|
| MD5 |
423f7114df073ef0004910b1ff715948
|
|
| BLAKE2b-256 |
4c271493ebd2a20646f44bd8c373675818d51f3f4435eddaad6a20c6f147849b
|