assembly_theory/lib.rs
1//! ORCA (*O*pen *R*eproducible *C*omputation of *A*ssembly Indices) is a free, open-source, and
2//! high-performance library that computes the assembly index of a molecule. It is built with
3//! modern CPU architectures and parallelism in mind.
4//!
5//! The crown jewel of the ORCA crate is the [`crate::assembly::index`] function, which computes
6//! the assembly index of a given molecule.
7//!
8//! ORCA comes with batteries included. You can quickly get started with a parser for the `.mol`
9//! file spec ([`crate::loader::parse_molfile_str`]) and an associated graph-theoretic
10//! representation of a molecule ([`crate::molecule::Molecule`]), as described in assembly index
11//! literature.
12//!
13//! ORCA can also be used as a python library or as a standalone command-line tool
14//!
15//! # Example
16//! ```
17//! # use std::fs;
18//! # use std::path::PathBuf;
19//! use assembly_theory::*;
20//! # fn main() -> Result<(), std::io::Error> {
21//! # let path = PathBuf::from(format!("./data/checks/benzene.mol"));
22//! // Read a molecule data file
23//! let molfile = fs::read_to_string(path)?;
24//! let benzene = loader::parse_molfile_str(&molfile).expect("Cannot parse molfile.");
25//!
26//! // Compute assembly index of benzene
27//! assert_eq!(assembly::index(&benzene), 3);
28//! # Ok(())
29//! # }
30//! ```
31
32// TODO: Cite ORCA JOSS paper when it's out.
33
34// Molecule definition, joining operation
35pub mod molecule;
36
37// Data IO
38pub mod loader;
39
40// The hard bit: compute assembly index
41pub mod assembly;
42
43// Utility functions
44mod utils;
45
46// Python library
47#[cfg(feature = "python")]
48pub mod python;