Function depth

Source
pub fn depth(mol: &Molecule) -> u32
Expand description

Compute assembly depth; see Pagel et al. (2024).

Note: This function is currently very (unusably) slow. It primarily exists in this crate as a proof of concept.

ยงExample

use assembly_theory::assembly::depth;
use assembly_theory::loader::parse_molfile_str;

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

// Compute the molecule's assembly depth.
assert_eq!(depth(&benzene), 3);