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.mol
file as astr
.enumerate_str
: An enumeration mode from ["extend"
,"grow-erode"
(default)]. SeeEnumerateMode
for details.canonize_str
: A canonization mode from ["nauty"
,"faulon"
,"tree-nauty"
(default),"tree-faulon"
]. SeeCanonizeMode
for details.parallel_str
: A parallelization mode from ["none"
,"depth-one"
(default),"always"
]. SeeParallelMode
for details.memoize_str
: A memoization mode from [none
,frags-index
,canon-index
(default)]. SeeMemoizeMode
for details.kernel_str
: A kernelization mode from ["none"
(default),"once"
,"depth-one"
,"always"
]. SeeKernelMode
for 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::Bound
for details.
§Python Returns
A 3-tuple containing:
- The molecule’s
int
assembly index. - The molecule’s
int
number of non-overlapping isomorphic subgraph pairs. - The
int
number 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