Skip to main content

Clustering molecules using Apple Silicon GPU

Project description

Python Versions MLX

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) Comparisons of Clustering Methods

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


Download files

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

Source Distribution

mlx_mol_cluster-0.2.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

mlx_mol_cluster-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

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

Hashes for mlx_mol_cluster-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6ef1168fb9be65c79daaa5d1709124bcc9d1f33e2bc91fca8bd40ade8da3a125
MD5 1843c5c5de072b7ebb489c0b68f2f73c
BLAKE2b-256 9bd3dc4f25b6615aaf7e7f9b0085d20ba4fb420168668ef03d67488c0d66dfe2

See more details on using hashes here.

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

Hashes for mlx_mol_cluster-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d385bdb4d8495979d94bd594af21dc5011e69ec352903e4dcd43b0842af06b3
MD5 423f7114df073ef0004910b1ff715948
BLAKE2b-256 4c271493ebd2a20646f44bd8c373675818d51f3f4435eddaad6a20c6f147849b

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