polymerist.polymers.monomers ============================ .. py:module:: polymerist.polymers.monomers .. autoapi-nested-parse:: For representing, generating, and modifying information about groups of monomer fragments Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/polymerist/polymers/monomers/fragments/index /autoapi/polymerist/polymers/monomers/repr/index /autoapi/polymerist/polymers/monomers/specification/index Attributes ---------- .. autoapisummary:: polymerist.polymers.monomers.PE_FRAGMENTS polymerist.polymers.monomers.MPD_TMC_FRAGMENTS polymerist.polymers.monomers.PEG_PLGA_FRAGMENTS Classes ------- .. autoapisummary:: polymerist.polymers.monomers.MonomerGroup Functions --------- .. autoapisummary:: polymerist.polymers.monomers.compliant_mol_SMARTS Package Contents ---------------- .. 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 .. py:data:: PE_FRAGMENTS :type: dict[str, list[str]] .. py:data:: MPD_TMC_FRAGMENTS :type: dict[str, list[str]] .. py:data:: PEG_PLGA_FRAGMENTS :type: dict[str, list[str]] .. py:function:: compliant_mol_SMARTS(smarts: Union[polymerist.smileslib.cleanup.Smiles, polymerist.smileslib.cleanup.Smarts]) -> str Convert a generic SMARTS string into a monomer specification-compliant one For details on specification, see https://doi-org.colorado.idm.oclc.org/10.1021/acs.jcim.3c01691 :Parameters: **smarts** (*Union[Smiles, Smarts]*) -- The SMARTS (or, by virtue of superset, SMILES) string to convert :returns: **compliant_smarts** -- The structurally-correspondent monomer specification-compliant SMARTS string :rtype: Smarts