openfe.setup.ligand_network_planning.generate_minimal_redundant_network(ligands: Iterable[SmallMoleculeComponent], mappers: AtomMapper | Iterable[AtomMapper], scorer: Callable[[LigandAtomMapping], float], progress: bool | Callable[[Iterable], Iterable] = True, mst_num: int = 2) LigandNetwork#

Plan a network with a specified amount of redundancy for each node

Creates a network with as few edges as possible with maximum total score, ensuring that every node is connected to two edges to introduce statistical redundancy.

  • ligands (Iterable[SmallMoleculeComponent]) – the ligands to include in the LigandNetwork

  • mappers (AtomMapper or Iterable[AtomMapper]) – the AtomMapper(s) to use to propose mappings. At least 1 required, but many can be given, in which case all will be tried to find the highest score edges

  • scorer (Scoring function) – any callable which takes a LigandAtomMapping and returns a float

  • progress (Union[bool, Callable[Iterable], Iterable]) – progress bar: if False, no progress bar will be shown. If True, use a tqdm progress bar that only appears after 1.5 seconds. You can also provide a custom progress bar wrapper as a callable.

  • mst_num (int) – Minimum Spanning Tree number: the number of minimum spanning trees to generate. If two, the second-best edges are included in the returned network. If three, the third-best edges are also included, etc.