polymerist.rdutils.reactions.fragment ===================================== .. py:module:: polymerist.rdutils.reactions.fragment .. autoapi-nested-parse:: For fragmenting molecules by reaction and residue information Attributes ---------- .. autoapisummary:: polymerist.rdutils.reactions.fragment.LOGGER polymerist.rdutils.reactions.fragment.P polymerist.rdutils.reactions.fragment.HEAVY_FORMER_LINKER_QUERY_ATOM polymerist.rdutils.reactions.fragment.bond_adjoins_linker polymerist.rdutils.reactions.fragment.IBIS Classes ------- .. autoapisummary:: polymerist.rdutils.reactions.fragment.IntermonomerBondIdentificationStrategy polymerist.rdutils.reactions.fragment.ReseparateRGroups polymerist.rdutils.reactions.fragment.CutMinimumCostBondsStrategy Functions --------- .. autoapisummary:: polymerist.rdutils.reactions.fragment.bridgehead_atom_ids polymerist.rdutils.reactions.fragment.get_shortest_path_bonds polymerist.rdutils.reactions.fragment.bond_is_newly_formed Module Contents --------------- .. py:data:: LOGGER .. py:data:: P .. py:data:: HEAVY_FORMER_LINKER_QUERY_ATOM :type: rdkit.Chem.QueryAtom .. py:function:: bridgehead_atom_ids(product: rdkit.Chem.Mol) -> Generator[int, None, None] Generates the indices of all atoms in a reaction product which were tagged as R-group bridgehead (i.e. wild) atoms in the reaction template definition .. py:function:: get_shortest_path_bonds(rdmol: rdkit.Chem.Mol, start_atom_idx: int, end_atom_idx: int) -> list[int] Returns bond indices along shortest path between two atoms in a Mol .. py:function:: bond_is_newly_formed(bond: rdkit.Chem.Bond) -> bool Bond condition checking if a bond was newly formed in a reaction (i.e. present in the product(s) but not the reactant(s)) .. py:data:: bond_adjoins_linker :type: polymerist.rdutils.selection.BondCondition .. py:class:: IntermonomerBondIdentificationStrategy Bases: :py:obj:`abc.ABC` Abstract base for Intermonomer Bond Identification Strategies for fragmentation during in-silico polymerization .. py:method:: locate_intermonomer_bonds(product: rdkit.Chem.Mol) -> Generator[int, None, None] Generates the indices of all identified inter-monomer bonds by molecule, no more than once each .. py:method:: produce_fragments(product: rdkit.Chem.Mol, separate: bool = True) -> Union[rdkit.Chem.Mol, tuple[rdkit.Chem.Mol]] Apply break all bonds identified by this IBIS algorithm and return the resulting fragments .. py:data:: IBIS .. py:class:: ReseparateRGroups Bases: :py:obj:`IntermonomerBondIdentificationStrategy` IBIS which cleaves any new bonds formed between atoms that were formerly the start of an R-group in the reaction template .. py:class:: CutMinimumCostBondsStrategy(base_bond_cost: Optional[float] = None, bond_discounts: Optional[dict[str, tuple[int, Callable[[rdkit.Chem.Mol], tuple[int, int]]]]] = None, bond_cost_keyword: Optional[str] = 'cost_to_cut', max_bonds_per_cut: int = 1, *args: P, **kwargs: P) Bases: :py:obj:`IntermonomerBondIdentificationStrategy` Subtype of IBIS which chooses bonds as solutions to minimum graph cut problem All bonds in a molecule are given some base cost to cut, then a discount is applied to some bonds by specified conditions Cuts are then made (no more than once) on the lowest cost bond(s) separating each pair of R-groups .. py:attribute:: base_bond_cost :value: None .. py:attribute:: bond_discounts :value: None .. py:attribute:: bond_cost_keyword :value: 'cost_to_cut' .. py:attribute:: max_bonds_per_cut :value: 1