pub fn _index_search(
mol_block: &str,
enumerate_str: &str,
canonize_str: &str,
parallel_str: &str,
memoize_str: &str,
kernel_str: &str,
bound_strs: Vec<String>,
) -> PyResult<(u32, u32, usize)>Expand description
Computes a molecule’s assembly index and related information using a top-down recursive search, parameterized by the specified options.
Python version of index_search.
§Python Parameters
mol_block: The contents of a.molfile as astr.enumerate_str: An enumeration mode from ["extend","grow-erode"(default)]. SeeEnumerateModefor details.canonize_str: A canonization mode from ["nauty","faulon","tree-nauty"(default),"tree-faulon"]. SeeCanonizeModefor details.parallel_str: A parallelization mode from ["none","depth-one"(default),"always"]. SeeParallelModefor details.memoize_str: A memoization mode from [none,frags-index,canon-index(default)]. SeeMemoizeModefor details.kernel_str: A kernelization mode from ["none"(default),"once","depth-one","always"]. SeeKernelModefor details.bound_strs: A list of bounds containing zero or more of ["log","int","vec-simple","vec-small-frags","cover-sort","cover-no-sort","clique-budget"]. The default bounds are ["int","vec-simple","vec-small-frags"]. Seecrate::bounds::Boundfor details.
§Python Returns
A 3-tuple containing:
- The molecule’s
intassembly index. - The molecule’s
intnumber of non-overlapping isomorphic subgraph pairs. - The
intnumber of assembly states searched.
§Python Example
import assembly_theory as at
# Load a mol block from file.
with open('data/checks/anthracene.mol') as f:
mol_block = f.read()
# Calculate the molecule's assembly index using the specified options.
(index, num_matches, states_searched) = at.index_search(
mol_block,
"grow-erode",
"tree-nauty",
"none",
"none",
"none",
["int", "vec-simple", "vec-small-frags"])
print(f"Assembly Index: {index}") # 6
print(f"Non-Overlapping Isomorphic Subgraph Pairs: {num_matches}") # 466
print(f"Assembly States Searched: {states_searched}") # 2562