schrodinger.application.matsci.polymer module

Module containing functionalities related to polymers

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.polymer.create_polymer_name(mol)

Create a polymer name for the passed molecule by finding its monomers. Returns None if the molecule is not a polymer or has unexpected composition, e.g. more than one initiator. The format is “a-{initiator}-w-{terminator}-poly({list of other monomers})” Example: a-chloro-w-fluoro-poly(caprolactam-chloroprene)

Parameters:

mol (_Molecule) – The molecule to get the name for

Return type:

str or None

Returns:

The polymer name, or None if the molecule is not a polymer

schrodinger.application.matsci.polymer.find_polymer_species(structs)

Convenience function to find polymer species in the passed structures. Molecules that are not polymers are grouped by SMILES. See clusterstruct.find_species for more information

Parameters:

structs (iterable) – The structures to get species for

Return type:

dict

Returns:

Keys are unique SMILES strings or group names for species, values are SpeciesData objects for that species

schrodinger.application.matsci.polymer.get_carb_atom_identifier_map(struct, atom_ids=None)

Get a mapping of carbohydrate atom identifiers to atom IDs for the passed structure

Parameters:
  • struct (structure._Structure) – The structure to get the mapping for

  • atom_ids (iterable) – The atom IDs to get the mapping for. If None, all atoms are used

Return type:

dict

Returns:

A mapping of carbohydrate atom identifiers to atom IDs

schrodinger.application.matsci.polymer.find_crystal_end_pairs(struct)

Find all pairs of head/tail atoms at crystal chunk boundaries.

Parameters:

struct (structure.Structure) – The structure to analyze

Return type:

list(tuple(int, int))

Returns:

List of (start_atom_id, end_atom_id) pairs for all crystal chunks

schrodinger.application.matsci.polymer.find_close_crystal_pairs(struct, end_pairs, distance_cutoff=8.0)

Find pairs of end atoms that are within a distance cutoff of each other.

Parameters:
  • struct (structure.Structure) – The structure containing the atoms with PBC

  • end_pairs (list(tuple(int, int))) – List of (start_atom_id, end_atom_id) pairs

  • distance_cutoff (float) – Maximum distance in Angstroms for pairs

Return type:

list(tuple(int, int))

Returns:

List of (atom_id1, atom_id2) pairs within the distance cutoff

schrodinger.application.matsci.polymer.add_crystal_restraints(cms_model, force_constant=0.0001)

Add stretch_harm restraints to maintain crystal structure integrity.

This function identifies head/tail atoms at crystal chunk boundaries and adds harmonic distance restraints between them and between nearby pairs.

Parameters:
  • cms_model (cms.Cms) – The CMS model to add restraints to

  • force_constant (float) – Force constant for the harmonic restraints

schrodinger.application.matsci.polymer.remove_crystal_restraints(cms_model)

Remove all restraints from a CMS model.

Parameters:

cms_model (cms.Cms) – The CMS model to remove restraints from

schrodinger.application.matsci.polymer.add_crystal_restraints_to_file(cms_file, force_constant=0.5)

Read a CMS file, add crystal restraints, and write it back.

Parameters:
  • cms_file (str) – Path to the CMS file

  • force_constant (float) – Force constant for the harmonic restraints

Return type:

int

Returns:

Number of restraints added

schrodinger.application.matsci.polymer.remove_crystal_restraints_from_file(cms_file)

Read a CMS file, remove all restraints, and write it back.

Parameters:

cms_file (str) – Path to the CMS file

schrodinger.application.matsci.polymer.scale_crystal_restraints(cms_model, new_force_constant)

Scale force constants of existing stretch_harm restraints.

Preserves reference distances (r0) while updating force constants.

Parameters:
  • cms_model (cms.Cms) – The CMS model with existing restraints

  • new_force_constant (float) – New force constant value

Return type:

int

Returns:

Number of restraints scaled

schrodinger.application.matsci.polymer.scale_crystal_restraints_in_file(cms_file, new_force_constant)

Read a CMS file, scale restraint force constants, and write it back.

Parameters:
  • cms_file (str) – Path to the CMS file

  • new_force_constant (float) – New force constant value

Return type:

int

Returns:

Number of restraints scaled