pysoftk.topologies package

Submodules

pysoftk.topologies.branched module

class pysoftk.topologies.branched.Bd(core, arm, atom)[source]

Bases: object

A class for creating a branched polymer from given RDKit molecules.

Examples

Note

RDKit package must be installed.

arm
atom
branched_polymer(relax_iterations=100, force_field='MMFF', swap_H=True)[source]

Function to create branched polymers

Parameters:
  • force_field (str) – Selected force field between MMFF or UFF

  • relax_iterations (int) –

    Number of iterations used for relaxing a molecular object.

    swap_H: bool

    Indicates if the user defined atomic place holder is changed to a Hydrogen atom or remain as the used species.

Returns:

newMol_H – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

core
merge_arms(core, arm, atom)[source]
Function to attach user defined molecules to a

provided molecular core using a placeholder.

Parameters:
  • core (rdkit.Chem.rdchem.Mol) – RDKit Mol object

  • arm (rdkit.Chem.rdchem.Mol) – RDKit Mol object.

  • atom (str) – The placeholder atom to combine the molecules and form a new monomer.

Returns:

mol – RDKit Mol object.

Return type:

rdkit.Chem.rdchem.Mol

pysoftk.topologies.diblock module

class pysoftk.topologies.diblock.Db(ma, mb, atom)[source]

Bases: object

A class for creating a diblock copolymers from

given RDKit molecules.

Examples

Note

RDKit package must be installed.

atom
diblock_copolymer(len_block_A, len_block_B, force_field='MMFF', relax_iterations=100, rot_steps=1)[source]

Function to create a diblock copolymer

Parameters:
  • len_block_A (int) – Length of the molecular block A

  • len_block_B (int) – Length of the molecular block B

  • force_field (str) – Selected force field between MMFF or UFF

  • relax_iterations (int) – Number of iterations used for relaxing a molecular object.

  • rot_steps (int) – Number of rotational steps for finding conformations.

Returns:

diblock – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

ma
mb
class pysoftk.topologies.diblock.Pt(pattern, mols, atom)[source]

Bases: object

A class for creating a Patterned polymers from a list of RDKit molecules.

Examples

Note

RDKit package must be installed.

atom
mols
pattern
pattern_block_poly(relax_iterations=100, force_field='MMFF', swap_H=True, rot_steps=1, more_iter=10)[source]

Function to create a polymer based on an alphabetic ordered pattern.

Parameters:
  • relax_iterations (int) – Number of iterations used for relaxing a molecular object.

  • force_field (str) – Selected FF between MMFF or UFF

  • swap_H (bool) – Indicates if the user defined atomic place holder is changed to a Hydrogen atom or remain as the used species.

  • rot_steps (int) – Number of rotational steps for finding conformations.

  • more_iter (int) – Number of extra iterations for further optimising the molecular object.

Returns:

return – A molecular pysoftk object.

Return type:

mol

pysoftk.topologies.ranpol module

class pysoftk.topologies.ranpol.Rnp(ma, mb, atom)[source]

Bases: object

A class for creating a random copolymer from given RDKit molecules.

Examples

Note

RDKit package must be installed.

atom
ma
mb
random_ab_copolymer(len_polymer, pA, relax_iterations=100, force_field='MMFF', swap_H=True)[source]
Function to build a random copolymer using an user provided

probability (pA) for merging the monomer ma and imposing the condition pB=1-pA.

Parameters:
  • len_polymer (int) – User defined length of the polymer.

  • pA (float) – User defined attaching probability of ma.

  • relax_iterations (int) – User defined iterations for a FF.

  • force_field (str) – User selected force field between “MMFF” or “UFF”.

  • swap_H (bool) – Indicates if the user defined atomic place holder is changed to a Hydrogen atom or remain as the used species.

Returns:

mol – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

random_abc_copolymer(mc, len_polymer, pA, pB, relax_iterations=100, force_field='MMFF', swap_H=True)[source]
Function to build a random copolymer based on an user defined

probability (pA) of merging mA, pB for monomer mb, and the condition pC=1-pA-pB.

Parameters:
  • mc (rdkit.Chem.rdchem.Mol) – RDKit Mol object #

  • len_polymer (float) – User defined length of the polymer.

  • pA (float) – User defined attaching probability of ma.

  • pB (float) – User defined attaching porbability of mb.

  • atom (str) – User defined atom used as place-holder.

  • relax_iterations (int) – User defined iterations for a FF.

  • force_field (str) – User selected FF.

  • swap_H (bool) – Indicates if the user defined atomic place holder is changed to a Hydrogen atom or remain as the used species.

Returns:

mol – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

pysoftk.topologies.ring module

class pysoftk.topologies.ring.Rn(mol, atom)[source]

Bases: object

A class for creating a circular (ring-shaped) polymer

from given RDKit molecules.

Examples

Note

RDKit package must be installed.

atom
mol
pol_ring(len_polymer=2, force_field='MMFF', relax_iterations=100, shift=1.25, more_iter=10)[source]

Function to create a polymer with ring structure (circular)

Parameters:
  • mol (rdkit.Chem.rdchem.Mol) – RDKit Mol object

  • atom (str) – The placeholder atom to combine the molecules and form a new monomer

  • len_polymer (int) – Extension of the polymer

  • force_field (str) – Selected FF to perform a relaxation

  • relax_iterations (int) – Number of iterations to perform a FF geometry optimisation.

  • shift (float) – User defined shift for spacing the monomers using the LP function.

  • more_iter (int) – User defined variable to perform more iterations using the selected FF.

Returns:

pol_ring – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

pysoftk.topologies.ring.apply_force_field(molecule: Mol, force_field: str, relax_iterations: int) None[source]

Applies the specified force field to the molecule.

pysoftk.topologies.ring.check_proto(mol, force_field='MMFF', relax_iterations=100, rot_steps=1, ff_thr=1e-06)[source]

Function to check the proto polymer creation.

Parameters:
  • mol (rdkit.Chem.rdchem.Mol) – RDKit Mol object

  • force_field (str) – Selected FF to perform a relaxation

  • relax_iterations (int) – Number of iterations to perform a FF geometry optimisation.

  • rot_steps (int) – Number of possible confomers to search after optimisation.

  • ff_thr (force field convergence threshold) – Force convergence criteria.

Returns:

newMol_H – RDKit Mol object

Return type:

rdkit.Chem.rdchem.Mol

Module contents