1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! `assembly_theory` is an open-source, high-performance library for computing
//! *assembly indices* of molecular structures (see, e.g.,
//! [Sharma et al., 2023](https://doi.org/10.1038/s41586-023-06600-9);
//! [Walker et al., 2024](https://doi.org/10.1098/rsif.2024.0367)).
//!
//! This crate is specific to the Rust library; see the
//! [GitHub repository](https://github.com/DaymudeLab/assembly-theory) for ways
//! to use `assembly_theory` as a standalone executable or as a Python package.
//!
//! # Example
//!
//! Install the crate as usual:
//! ```shell
//! cargo add assembly-theory
//! ```
//!
//! Load a molecule from a `.mol` file and calculate its assembly index:
//! ```
//! # use std::{fs, path::PathBuf};
//! use assembly_theory::{
//! assembly::index,
//! loader::parse_molfile_str
//! };
//!
//! # fn main() -> Result<(), std::io::Error> {
//! // 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);
//! # Ok(())
//! # }
//! ```
//!
//! See [`assembly`] for more usage examples.
// TODO: Cite ORCA JOSS paper when it's out.
// Graph-theoretic utility functions.
// Graph representations of molecules and associated parsing.
// Assembly index calculation and supporting functions.
// Python wrapper.