polymerist.rdutils.bonding.portlib

Specification for representing, defining, and characterizing selective intermolecular bond placeholders (“ports”)

Attributes

PORT_SCHEMA

PORT_QUERY

Exceptions

MolPortError

Raised when port-related errors as encountered

Classes

Port

Class for encapsulating the components of a "port" bonding site (linker-bond-bridgehead)

Functions

is_linker(→ bool)

Indicate whether an atom is a linker (intermonomer "*" type atom)

get_num_linkers(→ int)

Count how many wild-type inter-molecule linker atoms are in a Mol

get_port_ids(→ Generator[tuple[int, int], None, None])

Get the linker and bridgehead indices of all ports found in an RDKit Mol

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

Get indices of all atoms which are ports

get_ports(→ Generator[Port, None, None])

Find and generate all ports in a molecule. Can optioanlly narrow scope to port whose bridegehead is a particular atom and/or whose linker has a particular flavor

get_num_ports(→ int)

Counts the number of port atoms present in a Mol

get_single_port(→ Port)

Get the singular port of a Mol which contains only 1 port

Module Contents

polymerist.rdutils.bonding.portlib.PORT_SCHEMA = '[#0D1]~[!#0]'
polymerist.rdutils.bonding.portlib.PORT_QUERY
exception polymerist.rdutils.bonding.portlib.MolPortError[source]

Bases: Exception

Raised when port-related errors as encountered

polymerist.rdutils.bonding.portlib.is_linker(rdatom: rdkit.Chem.rdchem.Atom) bool[source]

Indicate whether an atom is a linker (intermonomer “*” type atom)

polymerist.rdutils.bonding.portlib.get_num_linkers(rdmol: rdkit.Chem.rdchem.Mol) int[source]

Count how many wild-type inter-molecule linker atoms are in a Mol

class polymerist.rdutils.bonding.portlib.Port[source]

Class for encapsulating the components of a “port” bonding site (linker-bond-bridgehead)

linker: rdkit.Chem.rdchem.Atom
bond: rdkit.Chem.rdchem.Bond
bridgehead: rdkit.Chem.rdchem.Atom
bondable_flavors: ClassVar[polymerist.genutils.containers.UnorderedRegistry]
property flavor: int

Return the flavor of the port

static are_bondable(port_1: Port, port_2: Port) bool[source]

Determine if two port atoms can be combined into a new bond

matches_flavor(target_flavor: int | None) bool[source]

Returns whether a port has a particular flavor

polymerist.rdutils.bonding.portlib.get_port_ids(rdmol: rdkit.Chem.rdchem.Mol) Generator[tuple[int, int], None, None][source]

Get the linker and bridgehead indices of all ports found in an RDKit Mol

polymerist.rdutils.bonding.portlib.get_linker_ids(rdmol: rdkit.Chem.rdchem.Mol) Generator[int, None, None][source]

Get indices of all atoms which are ports

polymerist.rdutils.bonding.portlib.get_ports(rdmol: rdkit.Chem.rdchem.Mol, target_atom_id: int | None = None, target_flavor: int | None = None) Generator[Port, None, None][source]

Find and generate all ports in a molecule. Can optioanlly narrow scope to port whose bridegehead is a particular atom and/or whose linker has a particular flavor

polymerist.rdutils.bonding.portlib.get_num_ports(rdmol: rdkit.Chem.rdchem.Mol, target_atom_id: int | None = None, target_flavor: int | None = None) int[source]

Counts the number of port atoms present in a Mol

polymerist.rdutils.bonding.portlib.get_single_port(rdmol: rdkit.Chem.rdchem.Mol) Port[source]

Get the singular port of a Mol which contains only 1 port