polymerist.rdutils.reactions.fragment

For fragmenting molecules by reaction and residue information

Attributes

LOGGER

P

HEAVY_FORMER_LINKER_QUERY_ATOM

bond_adjoins_linker

IBIS

Classes

IntermonomerBondIdentificationStrategy

Abstract base for Intermonomer Bond Identification Strategies for fragmentation during in-silico polymerization

ReseparateRGroups

IBIS which cleaves any new bonds formed between atoms that were formerly the start of an R-group in the reaction template

CutMinimumCostBondsStrategy

Subtype of IBIS which chooses bonds as solutions to minimum graph cut problem

Functions

bridgehead_atom_ids(→ Generator[int, None, None])

Generates the indices of all atoms in a reaction product which were tagged

get_shortest_path_bonds(→ list[int])

Returns bond indices along shortest path between two atoms in a Mol

bond_is_newly_formed(→ bool)

Bond condition checking if a bond was newly formed in a reaction

Module Contents

polymerist.rdutils.reactions.fragment.LOGGER
polymerist.rdutils.reactions.fragment.P
polymerist.rdutils.reactions.fragment.HEAVY_FORMER_LINKER_QUERY_ATOM: rdkit.Chem.QueryAtom
polymerist.rdutils.reactions.fragment.bridgehead_atom_ids(product: rdkit.Chem.Mol) Generator[int, None, None][source]

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

polymerist.rdutils.reactions.fragment.get_shortest_path_bonds(rdmol: rdkit.Chem.Mol, start_atom_idx: int, end_atom_idx: int) list[int][source]

Returns bond indices along shortest path between two atoms in a Mol

polymerist.rdutils.reactions.fragment.bond_is_newly_formed(bond: rdkit.Chem.Bond) bool[source]

Bond condition checking if a bond was newly formed in a reaction (i.e. present in the product(s) but not the reactant(s))

polymerist.rdutils.reactions.fragment.bond_adjoins_linker: polymerist.rdutils.selection.BondCondition
class polymerist.rdutils.reactions.fragment.IntermonomerBondIdentificationStrategy[source]

Bases: abc.ABC

Abstract base for Intermonomer Bond Identification Strategies for fragmentation during in-silico polymerization

locate_intermonomer_bonds(product: rdkit.Chem.Mol) Generator[int, None, None][source]

Generates the indices of all identified inter-monomer bonds by molecule, no more than once each

produce_fragments(product: rdkit.Chem.Mol, separate: bool = True) rdkit.Chem.Mol | tuple[rdkit.Chem.Mol][source]

Apply break all bonds identified by this IBIS algorithm and return the resulting fragments

polymerist.rdutils.reactions.fragment.IBIS
class polymerist.rdutils.reactions.fragment.ReseparateRGroups[source]

Bases: IntermonomerBondIdentificationStrategy

IBIS which cleaves any new bonds formed between atoms that were formerly the start of an R-group in the reaction template

class polymerist.rdutils.reactions.fragment.CutMinimumCostBondsStrategy(base_bond_cost: float | None = None, bond_discounts: dict[str, tuple[int, Callable[[rdkit.Chem.Mol], tuple[int, int]]]] | None = None, bond_cost_keyword: str | None = 'cost_to_cut', max_bonds_per_cut: int = 1, *args: P, **kwargs: P)[source]

Bases: 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

base_bond_cost = None
bond_discounts = None
bond_cost_keyword = 'cost_to_cut'
max_bonds_per_cut = 1