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 this package in your own scientific work, please consider citing us:

Coming soon!

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.0.tar.gz (215.8 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.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl (521.9 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ x86-64

assembly_theory-0.6.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl (493.7 kB view details)

Uploaded PyPymanylinux: glibc 2.28+ ARM64

assembly_theory-0.6.0-cp310-abi3-manylinux_2_28_x86_64.whl (521.9 kB view details)

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

assembly_theory-0.6.0-cp310-abi3-manylinux_2_28_aarch64.whl (493.5 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

assembly_theory-0.6.0-cp310-abi3-macosx_11_0_arm64.whl (442.6 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

assembly_theory-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl (457.3 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for assembly_theory-0.6.0.tar.gz
Algorithm Hash digest
SHA256 9c207aed8df6b60e86255521e3c67d7fd8ea592e9e1662059657d19d3b24566f
MD5 ce088e671c1f4f854abc1e6aad053c92
BLAKE2b-256 845e140bf58180513dbf4092c8383af70400489d8a37ba355d7f4a9986356455

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assembly_theory-0.6.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 296451034d90375787d5418fe88806f0efe4c2da7954554978121cc67c8a5aec
MD5 cf38703cef7252db287bfb0d65f329ab
BLAKE2b-256 938f419c2056e7126eadba4b2656ebc92fc9ebe3a80785eadee1744450573c6b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assembly_theory-0.6.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ad86f518c7730a011dcbda250bab83f7cdcea409a59ae35a24e9318e62f23740
MD5 78c6ab33200dbeeaa9528da1e62272b7
BLAKE2b-256 42902de43d43144fd745bc13c1b32214fba3bd0766562dc13e1b52c1eae61fb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assembly_theory-0.6.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 94d5d1d55f89bb9549f9965910b11185bbb56df77315fd024b8e94b110d1a4de
MD5 b89ae4a7a32b2687d317bf4c85f2683e
BLAKE2b-256 4b39c3f45dea2228abc77c6cfbfef4328b5564315a817bf2d2374a08af4e783a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assembly_theory-0.6.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c75d9c6224c3b3c0aae98e24bc65a4ac54c475bd163547a944514d7c721f1a41
MD5 0dcb2e6e17fa21660088634fe6920425
BLAKE2b-256 744f423d7c6dab86eb44788dd698f33ebeb46aefc1b85b6557ce74c1ad4619a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for assembly_theory-0.6.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0074770e40fa1ba42b90256713af92114d984dd836bddd011d3980296f1e2ed
MD5 3995c8a775bb58d3cdd7cb408a7e8942
BLAKE2b-256 c6d1ed09f1d832a0b6466f74ad12b10ebb620e8a07ce40d7df328f87867ed40a

See more details on using hashes here.

File details

Details for the file assembly_theory-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for assembly_theory-0.6.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b680b8b99fb01afe5770678b797f3bc05d860f8d27ce6753617b6f741e934f6
MD5 19c0cda8da39784d8f61e561bdedf20d
BLAKE2b-256 944f583f40fb6fc9c5bb4e681cef8ace925ebb0ae0b58432785bb2a8ae40337d

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