polymerist.rdutils.bonding.portlib ================================== .. py:module:: polymerist.rdutils.bonding.portlib .. autoapi-nested-parse:: Specification for representing, defining, and characterizing selective intermolecular bond placeholders ("ports") Attributes ---------- .. autoapisummary:: polymerist.rdutils.bonding.portlib.PORT_SCHEMA polymerist.rdutils.bonding.portlib.PORT_QUERY Exceptions ---------- .. autoapisummary:: polymerist.rdutils.bonding.portlib.MolPortError Classes ------- .. autoapisummary:: polymerist.rdutils.bonding.portlib.Port Functions --------- .. autoapisummary:: polymerist.rdutils.bonding.portlib.is_linker polymerist.rdutils.bonding.portlib.get_num_linkers polymerist.rdutils.bonding.portlib.get_port_ids polymerist.rdutils.bonding.portlib.get_linker_ids polymerist.rdutils.bonding.portlib.get_ports polymerist.rdutils.bonding.portlib.get_num_ports polymerist.rdutils.bonding.portlib.get_single_port Module Contents --------------- .. py:data:: PORT_SCHEMA :value: '[#0D1]~[!#0]' .. py:data:: PORT_QUERY .. py:exception:: MolPortError Bases: :py:obj:`Exception` Raised when port-related errors as encountered .. py:function:: is_linker(rdatom: rdkit.Chem.rdchem.Atom) -> bool Indicate whether an atom is a linker (intermonomer "*" type atom) .. py:function:: get_num_linkers(rdmol: rdkit.Chem.rdchem.Mol) -> int Count how many wild-type inter-molecule linker atoms are in a Mol .. py:class:: Port Class for encapsulating the components of a "port" bonding site (linker-bond-bridgehead) .. py:attribute:: linker :type: rdkit.Chem.rdchem.Atom .. py:attribute:: bond :type: rdkit.Chem.rdchem.Bond .. py:attribute:: bridgehead :type: rdkit.Chem.rdchem.Atom .. py:attribute:: bondable_flavors :type: ClassVar[polymerist.genutils.containers.UnorderedRegistry] .. py:property:: flavor :type: int Return the flavor of the port .. py:method:: are_bondable(port_1: Port, port_2: Port) -> bool :staticmethod: Determine if two port atoms can be combined into a new bond .. py:method:: matches_flavor(target_flavor: Optional[int]) -> bool Returns whether a port has a particular flavor .. py:function:: get_port_ids(rdmol: rdkit.Chem.rdchem.Mol) -> Generator[tuple[int, int], None, None] Get the linker and bridgehead indices of all ports found in an RDKit Mol .. py:function:: get_linker_ids(rdmol: rdkit.Chem.rdchem.Mol) -> Generator[int, None, None] Get indices of all atoms which are ports .. py:function:: get_ports(rdmol: rdkit.Chem.rdchem.Mol, target_atom_id: Optional[int] = None, target_flavor: Optional[int] = None) -> 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 .. py:function:: get_num_ports(rdmol: rdkit.Chem.rdchem.Mol, target_atom_id: Optional[int] = None, target_flavor: Optional[int] = None) -> int Counts the number of port atoms present in a Mol .. py:function:: get_single_port(rdmol: rdkit.Chem.rdchem.Mol) -> Port Get the singular port of a Mol which contains only 1 port