polymerist.polymers.monomers

For representing, generating, and modifying information about groups of monomer fragments

Submodules

Attributes

PE_FRAGMENTS

MPD_TMC_FRAGMENTS

PEG_PLGA_FRAGMENTS

Classes

MonomerGroup

Stores collections of residue-labelled monomer SMARTS

Functions

compliant_mol_SMARTS(→ str)

Convert a generic SMARTS string into a monomer specification-compliant one

Package Contents

class polymerist.polymers.monomers.MonomerGroup[source]

Stores collections of residue-labelled monomer SMARTS

monomers: dict[str, polymerist.smileslib.Smarts | list[polymerist.smileslib.Smarts]]
term_orient: dict[str, str]
add_monomer(resname: str, smarts: polymerist.smileslib.Smarts | Iterable[polymerist.smileslib.Smarts]) None[source]

Register new monomers, either directly from SMARTS or from a container of SMARTS

static is_terminal(monomer: rdkit.Chem.Mol) bool[source]

Determine whether or not a monomer is terminal

property SMARTS: dict[str, list[polymerist.smileslib.Smarts]]

Alias of legacy “monomers” attribute

iter_rdmols(term_only: bool | None = None) Generator[tuple[str, rdkit.Chem.Mol], None, None][source]

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

rdmols(term_only: bool | None = None) dict[str, list[rdkit.Chem.Mol]][source]

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

contributions(term_only: bool | None = None) dict[str, list[int]][source]

Returns dict of the number of real (i.e. non-linker) atoms in each residue list

property n_monomers: int

Returns number of distinct monomer templates present Distinct monomers under the same residue name are counted separately

linear_end_groups() dict[str, tuple[str, rdkit.Chem.Mol]][source]

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

Return type:

dict[str, tuple[str, Chem.Mol]]

is_homopolymer() bool[source]

Identify if a polymer is a homopolymer (i.e. only 1 type of middle monomer)

property is_branchable: bool

Whether it is possible to generate a branched polymer from this set of monomers

property is_linear: bool

Whether a group of monomers can ONLY be assembled into a linear chain

property is_linear_homopolymer: bool

Identify if a polymer is a linear homopolymer

property num_mid_and_term: tuple[int, int]

Counts of how many of the monomers are middle vs terminal, respectively

polymerist.polymers.monomers.PE_FRAGMENTS: dict[str, list[str]]
polymerist.polymers.monomers.MPD_TMC_FRAGMENTS: dict[str, list[str]]
polymerist.polymers.monomers.PEG_PLGA_FRAGMENTS: dict[str, list[str]]
polymerist.polymers.monomers.compliant_mol_SMARTS(smarts: polymerist.smileslib.cleanup.Smiles | polymerist.smileslib.cleanup.Smarts) str[source]

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

Return type:

Smarts