Crate assembly_theory

Crate assembly_theory 

Source
Expand description

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 crate is specific to the Rust library; see the GitHub repository for ways to use assembly_theory as a standalone executable or as a Python package.

§Example

Install the crate as usual:

cargo add assembly-theory

Load a molecule from a .mol file and calculate its assembly index:

use assembly_theory::{
    assembly::index,
    loader::parse_molfile_str
};

// Load a molecule from a `.mol` file.
let path = PathBuf::from(format!("./data/checks/anthracene.mol"));
let molfile = fs::read_to_string(path)?;
let anthracene = parse_molfile_str(&molfile).expect("Parsing failure.");

// Compute the molecule's assembly index using an efficient algorithm.
assert_eq!(index(&anthracene), 6);

See assembly for more usage examples.

Modules§

assembly
Compute assembly indices of molecules.
bounds
Prune assembly states from which the assembly index cannot improve.
canonize
Create canonical labelings for molecular graphs.
kernels
Kernelize match-compatibility graphs to improve top-down search efficiency.
loader
Parse molecules in the .mol file format.
matches
Strucutral information on matches in a molecular graph.
memoize
Memoize assembly states to avoid redundant recursive search.
molecule
Graph-theoretic representation of a molecule.
python
Expose public assembly_theory functionality to a Python package using pyo3.
state
Assembly state of the top-down recursive search algorithm.