polymerist.polymers.monomers.repr ================================= .. py:module:: polymerist.polymers.monomers.repr .. autoapi-nested-parse:: For representing monomer information Attributes ---------- .. autoapisummary:: polymerist.polymers.monomers.repr.LOGGER Classes ------- .. autoapisummary:: polymerist.polymers.monomers.repr.MonomerGroup Module Contents --------------- .. py:data:: LOGGER .. py:class:: MonomerGroup Stores collections of residue-labelled monomer SMARTS .. py:attribute:: monomers :type: dict[str, Union[polymerist.smileslib.Smarts, list[polymerist.smileslib.Smarts]]] .. py:attribute:: term_orient :type: dict[str, str] .. py:method:: add_monomer(resname: str, smarts: Union[polymerist.smileslib.Smarts, Iterable[polymerist.smileslib.Smarts]]) -> None Register new monomers, either directly from SMARTS or from a container of SMARTS .. py:method:: is_terminal(monomer: rdkit.Chem.Mol) -> bool :staticmethod: Determine whether or not a monomer is terminal .. py:property:: SMARTS :type: dict[str, list[polymerist.smileslib.Smarts]] Alias of legacy "monomers" attribute .. py:method:: iter_rdmols(term_only: Optional[bool] = None) -> Generator[tuple[str, rdkit.Chem.Mol], None, None] Generate (residue name, RDKit Mol) pairs of all monomers present Simplifies iteration over internal lists of monomer Mols Can optionally filter by monomer termination: term_only=True -> only terminal monomers term_only=False -> only middle monomers term_only=None -> all monomers .. py:method:: rdmols(term_only: Optional[bool] = None) -> dict[str, list[rdkit.Chem.Mol]] Returns dict of RDKit Mol lists keyed by residue name Can optionally filter by monomer termination: term_only=True -> only terminal monomers term_only=False -> only middle monomers term_only=None -> all monomers .. py:method:: contributions(term_only: Optional[bool] = None) -> dict[str, list[int]] Returns dict of the number of real (i.e. non-linker) atoms in each residue list .. py:property:: n_monomers :type: int Returns number of distinct monomer templates present Distinct monomers under the same residue name are counted separately .. py:method:: linear_end_groups() -> dict[str, tuple[str, rdkit.Chem.Mol]] Returns head-and-tail end group residue names and Mol objects as defined by term_orient If term orient is undefined, will automatically take then first <= 2 terminal groups available to be the end groups :returns: **end_groups** -- A dict whose keys are any of {'head', 'tail'} and whose values are 2-tuples of residue names and Mols for the corresponding monomer :rtype: dict[str, tuple[str, Chem.Mol]] .. py:method:: is_homopolymer() -> bool Identify if a polymer is a homopolymer (i.e. only 1 type of middle monomer) .. py:property:: is_branchable :type: bool Whether it is possible to generate a branched polymer from this set of monomers .. py:property:: is_linear :type: bool Whether a group of monomers can ONLY be assembled into a linear chain .. py:property:: is_linear_homopolymer :type: bool Identify if a polymer is a linear homopolymer .. py:property:: num_mid_and_term :type: tuple[int, int] Counts of how many of the monomers are middle vs terminal, respectively