Skip to main content

Open, reproducible calculation of assembly indices

Project description

assembly-theory

assembly-theory is an open-source, high-performance library for computing assembly indices of molecular structures (see, e.g., Sharma et al., 2023; Walker et al., 2024). This Python package wraps the functionality of the assembly-theory Rust crate for easier interoperability with existing cheminformatic libraries (e.g., RDKit) and computational pipelines.

If you're looking for the Rust crate or standalone executable versions of assembly-theory or if you're trying to build this Python package from source, see our GitHub repository.

Installation

Install assembly-theory using a Python virtual environment manager of your choosing:

pip install assembly-theory   # Using pip.
pipx install assembly-theory  # Using pipx.
uv add assembly-theory        # Using uv.

Usage

assembly-theory exposes several functions, all of which expect a "mol block" (i.e., the contents of a .mol file as a string) as input. For example:

import assembly_theory as at  # Note the '_' instead of '-'!

# Load a mol block from file...
with open('anthracene.mol') as f:
    mol_block = f.read()

# ...or define the mol block directly.
mol_block = """


 14 16  0  0  0  0  0  0  0  0999 V2000
   25.2202  -16.2366    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   25.2202  -17.6385    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   26.4373  -18.3394    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   26.4373  -15.5356    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   27.6471  -16.2366    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   27.6412  -17.6385    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   28.8523  -18.3446    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   28.8644  -15.5409    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   30.0755  -16.2469    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   30.1327  -17.6453    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   31.2674  -18.3552    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   32.4846  -17.6672    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   32.4973  -16.2688    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   31.2927  -15.5589    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  9  8  2  0     0  0
  8  5  1  0     0  0
  5  4  2  0     0  0
  4  1  1  0     0  0
  1  2  2  0     0  0
  2  3  1  0     0  0
  3  6  2  0     0  0
  9 10  1  0     0  0
 10 11  1  0     0  0
 11 12  2  0     0  0
 12 13  1  0     0  0
 13 14  2  0     0  0
 14  9  1  0     0  0
  5  6  1  0     0  0
  6  7  1  0     0  0
  7 10  2  0     0  0
M  END"""

# Calculate the molecule's assembly index.
at.index(mol_block)  # 6

Combine assembly-theory with RDKit (installed separately) if you need to manipulate molecular representations or incorporate assembly index calculations in a broader cheminformatics pipeline.

import assembly_theory as at
from rdkit import Chem

# Get a mol block from a molecule's SMILES representation.
anthracene = Chem.MolFromSmiles("c1ccc2cc3ccccc3cc2c1")
anthracene = Chem.MolToMolBlock(anthracene)

# Calculate the molecule's assembly index.
at.index(anthracene)  # 6

API Reference

See the assembly_theory::python documentation for a complete list of functions exposed to this package along with usage examples.

Citation

If you use assembly-theory in your own scientific work, please consider citing us! On GitHub, you can use the "Cite this repository" dropdown in the About section to get APA and BibTeX citations; this is also directly compatible with the Zotero browser plugin. Otherwise, you can use the following BibTeX entry:

@article{Vimal2026-assemblytheory,
    title = {{assembly-theory: Open, Reproducible Calculation of Assembly Indices}},
    author = {Vimal, Devansh and Parzych, Garrett and Smith, Olivia M. and Parkar, Devendra and Bergen, Holly and Daymude, Joshua J. and Mathis, Cole},
    journal = {Journal of Open Source Software},
    volume = {11},
    number = {117},
    pages = {9318},
    month = jan,
    year = 2026,
    doi = {10.21105/joss.09318},
    url = {https://joss.theoj.org/papers/10.21105/joss.09318},
}

License

assembly-theory is licensed under the Apache License, Version 2.0 or the MIT License, at your option.

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

assembly_theory-0.6.1.tar.gz (218.1 kB view details)

Uploaded Source

Built Distributions

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

assembly_theory-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (617.0 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

assembly_theory-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl (586.9 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_x86_64.whl (616.9 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_aarch64.whl (586.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

assembly_theory-0.6.1-cp310-abi3-macosx_11_0_arm64.whl (534.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file assembly_theory-0.6.1.tar.gz.

File metadata

  • Download URL: assembly_theory-0.6.1.tar.gz
  • Upload date:
  • Size: 218.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for assembly_theory-0.6.1.tar.gz
Algorithm Hash digest
SHA256 a877b44d827b7555745fbb5e2703f31c078412bdbed44bb1b1621532793da6b5
MD5 4faf64ea2ab4f0574777b1828f5bb524
BLAKE2b-256 ea467a4cf41147eba009b73d9436d6286764681784d910d06af50ecf89840b8c

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 df6e842f619012dde5c2fcd8149a43a93d0fde10312f023260e3dbb6d38c6cb8
MD5 e409101951e0bfc8d504b429f2bcd640
BLAKE2b-256 bd7166c02f4fe60ff189820032f351ad492129fea819aff798de7c8c253a156e

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 31a2bbbcefd9e4593061dd6ab8f680974156505d837ef551767ce2a477f8782d
MD5 ade1156c6885995055b006548f312185
BLAKE2b-256 07d882324dd672a71e39d1072a56f8374f3df5b15d231e4611a60935f9881d8a

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4e1ea883f25e10bff771a0fc28a1a865b72f8a513ca004b509e56675073cdf3
MD5 c4e5bbc262e5d941d815ab448e609e81
BLAKE2b-256 9e0a37479252e7cfe6d06519d1933fe087c5cfed690c49c33cc98fa22358be9c

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.1-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c4105486ee9e9a08a0691e5c6dafddff373ed7fd1776de5da8691b0841d667d8
MD5 00497f35e69bc2a0dc3f399bdfbddeb2
BLAKE2b-256 a0823132a81ba182e9de16743fedfee48c1fb6b8f4eb10efde525d7f62951b08

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 21bce64ef9365fe0a85a5a33331c0bd30667543e582dc65829271e7e98ceb78c
MD5 828a833bb8a5d69d3ee2855771a26a7a
BLAKE2b-256 054f0824e301c45d07fc751d9316728fbf1b2c0f28d0788745e199e338e549d9

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