polymerist.rdutils.bonding.permutation ====================================== .. py:module:: polymerist.rdutils.bonding.permutation .. autoapi-nested-parse:: Tool for swapping bonds within and between RDKit Mols Attributes ---------- .. autoapisummary:: polymerist.rdutils.bonding.permutation.LOGGER Functions --------- .. autoapisummary:: polymerist.rdutils.bonding.permutation.swap_bonds Module Contents --------------- .. py:data:: LOGGER .. py:function:: swap_bonds(rwmol: rdkit.Chem.rdchem.RWMol, bond_derangement: dict[int, tuple[int, int]], show_steps: bool = False, bond_breakage_marker: str = '--x->', bond_formation_marker: str = '---->') -> Optional[rdkit.Chem.rdchem.RWMol] Takes a modifiable Mol and a bond derangement dict and performs the requested bond swaps Derangement dict should have th following form: keys : int = corresponds to the beginning atom of a bond values : tuple[int, int] = corresponds to the current end atom map number and target end atom map number (in that order) Modifiable Mol can contain multiple disconnected molecular components