Package schrodinger :: Package application :: Package matsci :: Module coarsegrain
[hide private]
[frames] | no frames]

Module coarsegrain

Utilities for working with coarse grain structures

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  ParticleInfo
ParticleInfo(key, name, rgb, radius, mass)
  Internals
Manage the internal coordinates of a structure.
  FusedRing
Manage a fused ring.
Functions [hide private]
OrderedDict
get_type_dict_from_st(st, type_dict=None)
Return a sorted type dict for the given structure.
float
_get_rh_cg_cutoff_factor(model)
Get the scale factor for the cutoff when computing rclone in repulsive harmonic CG models.
bool
system_has_charged_particles(model)
Check if any particle in the given system has a charge based on the sites FFIO block
dict
get_cg_cutoff_data(model)
Return the coarse grain cutoff data, i.e.
float
compute_max_internal_distance(struct)
Compute the largest distance between any pair of atoms that are a) bonded, b) 1-3 in an angle or c) 1-4 in a dihedral
str
get_coarse_grain_msj_header(struct)
Get the appropriate MSJ header text for this coarse grain structure
str
get_coarse_grain_msj_family_header(struct)
Get any additional header text that needs to be inserted into the task stage of the msj file if this structure is coarse grain.
(False, msg) or True
validate_no_cg(struct=None, structs=None, rows=None)
Fail a validation check if any of the structures is a coarse grain structure
bool
is_coarse_grain(struct, by_atom=False)
Check if struct is a coarse grain structure
 
set_as_coarse_grain(struct)
Mark struct as a coarse grain structure
 
set_nonbond_potential_type(struct, nbtype)
Mark the structure with the non-bond pontential type
str or None
get_nonbond_potential_type(struct)
Return the type of non-bond potential for this structure
bool
is_lennard_jones(struct)
Check if this is a Lennard-Jones coarse grain structure
bool
is_repulsive_harmonic(struct)
Check if this is a repulsive harmonic coarse grain structure
 
set_atom_coarse_grain_properties(struct, atom, name, rgb=(100, 100, 100), atom_type=400, formal_charge=0.0, partial_charge=0.0, radius=10.0, mass=12.0)
Set the properties required for a coarse grain particle atom
structure.Structure
setCGBondLengths(st)
Set the bond lengths of the given CG structure according to the particle radii.
structure.Structure
fix_linear_angles(struct, internals=None, angles=None)
Return a copy of the given structure with linear angles fixed.
Variables [hide private]
  __doc__ = ...
  CG_REP_TYPE = 'CG'
  REP_TYPE_KEY = 's_matsci_rep_type'
  NB_TYPE_KEY = 's_matsci_cg_non-bond_type'
  FF_CUTOFF_PROPERTY = 'r_matsci_cg_ff_cutoff_(Ang)'
  LENNARD_JONES = 'Lennard-Jones'
  DISSIPATIVE_PARTICLE = 'Repulsive harmonic'
  NONBOND_POTENTIALS = ['Lennard-Jones', 'Repulsive harmonic']
  CG_UNIQUE_BOND_PARTICLE_1_LABEL_KEY = 's_matsci_cg_particle_1_...
  CG_UNIQUE_BOND_PARTICLE_2_LABEL_KEY = 's_matsci_cg_particle_2_...
  CG_UNIQUE_PARTICLE_LABEL_KEY = 's_matsci_cg_particle_label'
  CG_ELEMENT_SYMBOL = 'C'
  CG_ATOMIC_NUMBER = 6
  DEFAULT_MMOD_ATOM_TYPE = 400
  DEFAULT_RADIUS = 10.0
  DEFAULT_MASS = 12.0
  DEFAULT_RGB = (100, 100, 100)
  CG_PARTICLE_COLOR_NAME_KEY = 's_matsci_cg_particle_color_name'
  CUTOFF = 'cutoff'
  R_CLONE = 'r_clone'
  FAR_TYPE = 'far_type'
  MARGIN = 'margin'
  FAR_TYPE_NONE = 'none'
  FAR_TYPE_PME = 'pme'
  MSJ_LJ_COARSE_GRAIN_HEADER = '\n\n #\n # Unive...
  MSJ_RH_COARSE_GRAIN_HEADER = '\n\n #\n # Unive...
  MAX_INFRA_FF_CHARGE = 18
  MIN_INFRA_FF_CHARGE = -18
  EXCLUDE_NONE = 'None'
  EXCLUDE_BONDS = 'Bonds'
  EXCLUDE_BONDS_ANGLES = 'Bonds and 1-3 Angles'
  EXCLUDE_BONDS_ANGLES_DIHEDRALS = 'Bonds, 1-3 Angles, and 1-4 D...
  SHADOW_START = '{'
  SHADOW_END = '}'
  RH_CUTOFF_FACTOR_DIHEDRALS = 4.0
  RH_CUTOFF_FACTOR_ANGLES = 2.75
  RH_CUTOFF_FACTOR_BONDS = 1.5
  __package__ = 'schrodinger.application.matsci'
Function Details [hide private]

get_type_dict_from_st(st, type_dict=None)

 

Return a sorted type dict for the given structure.

Parameters:
  • st (schrodinger.structure.Structure) - the structure from which to obtain the type dict
  • type_dict (OrderedDict or None) - specify a type dict to include in the returned type dict (note that this type dict takes precedence over the type dict data for the given structure) or None if there isn't one
Returns: OrderedDict
the sorted type dict, keys are particle names, values are ParticleInfo

_get_rh_cg_cutoff_factor(model)

 

Get the scale factor for the cutoff when computing rclone in repulsive harmonic CG models. The scale factor is based on whether there are FF terms for dihedrals or angles.

Parameters:
Returns: float
The scale factor for the cutoff term

system_has_charged_particles(model)

 

Check if any particle in the given system has a charge based on the sites FFIO block

Parameters:
Returns: bool
True if an FFIO sites block exists in the given system and contains at least one charged particle. False if there is either no such block or the block contains only neutral particles

get_cg_cutoff_data(model)

 

Return the coarse grain cutoff data, i.e. cutoff, margin, and r_clone.

Parameters:
Returns: dict
the coarse grain cutoff, far type, margin, and r_clone values. Each key in the dictionary is a format specifier from the MSJ_*_COARSE_GRAIN_HEADER string and the value is the value for that format specifier
Raises:
  • ValueError - if model is incorrect

compute_max_internal_distance(struct)

 

Compute the largest distance between any pair of atoms that are a) bonded, b) 1-3 in an angle or c) 1-4 in a dihedral

Parameters:
Returns: float
The largest distance between any pair of atoms involved in a bond, angle or torsion

get_coarse_grain_msj_header(struct)

 

Get the appropriate MSJ header text for this coarse grain structure

Parameters:
Returns: str
The header text appropriate for this structure. An empty string is returned if the structure is not coarse-grained. The LJ header is used for coarse-grained systems with unrecognized non-bond potential type.

get_coarse_grain_msj_family_header(struct)

 

Get any additional header text that needs to be inserted into the task stage of the msj file if this structure is coarse grain. This header can then be inserted when creating the .msj file by using the extra_task_text keyword to the desmondutils.create_msj call. i.e. header = coarsegrain.get_coarse_grain_msj_family_header(system) desmondutils.create_msj(stages, extra_task_text=header)

Parameters:
Returns: str
The header text, if any, required for the current input. If no additional header text is required, an empty string is returned.

validate_no_cg(struct=None, structs=None, rows=None)

 

Fail a validation check if any of the structures is a coarse grain structure

One and only one of struct, structs or rows should be given

Parameters:
Returns: (False, msg) or True
False and error message if the structure is coarse grain, True if everything is OK. Return value is acceptable for an AF2 valiator.

is_coarse_grain(struct, by_atom=False)

 

Check if struct is a coarse grain structure

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to check
  • by_atom (bool) - If True, check each atom to see if it is coarse grain and return True if any atom is coarse grin. If False, check only for the coarse grain structure property. True is useful when the structure has been obtained via maestro.workspace_get, which removes structure-level properties, or if the structure may be a mixed atomistic/coarse-grained structure.
Returns: bool
True if it is a coarse grain structure, False if not

set_as_coarse_grain(struct)

 

Mark struct as a coarse grain structure

Parameters:

set_nonbond_potential_type(struct, nbtype)

 

Mark the structure with the non-bond pontential type

Parameters:
Raises:
  • ValueError - if nbtype is not in NONBOND_POTENTIALS
  • TypeError - if struct is not a coarse grain system

get_nonbond_potential_type(struct)

 

Return the type of non-bond potential for this structure

Parameters:
Returns: str or None
The value of the NB_TYPE_KEY property on the structure, or None if the structure is not a coarse grain structure or does not have this property set

is_lennard_jones(struct)

 

Check if this is a Lennard-Jones coarse grain structure

Parameters:
Returns: bool
True if this is a coarse grain Lennard-Jones structure, False if not

is_repulsive_harmonic(struct)

 

Check if this is a repulsive harmonic coarse grain structure

Parameters:
Returns: bool
True if this is a coarse grain repulsive harmoic structure, False if not

set_atom_coarse_grain_properties(struct, atom, name, rgb=(100, 100, 100), atom_type=400, formal_charge=0.0, partial_charge=0.0, radius=10.0, mass=12.0)

 

Set the properties required for a coarse grain particle atom

Parameters:
  • structure (schrodinger.structure.Structure) - The structure containing the atom
  • atom (schrodinger.structure._StructureAtom) - The atom to set properties on
  • name (str) - The name of the coarse grain particle.
  • rgb (tuple) - The 0-255 tuple of red, green and blue that defines the atom color
  • atom_type (int) - The mmod atom type
  • formal_charge (int) - The formal charge
  • partial_charge (float) - The partial charge
  • radius (float) - The particle radius, in Angstrom
  • mass (float) - The particle mass

setCGBondLengths(st)

 

Set the bond lengths of the given CG structure according to the particle radii.

Parameters:
  • st (structure.Structure) - the CG structure
Returns: structure.Structure
the CG structure with the new bond lengths

fix_linear_angles(struct, internals=None, angles=None)

 

Return a copy of the given structure with linear angles fixed.

Parameters:
  • struct (structure.Structure) - the structure whose angles will be fixed
  • internals (Internals or None) - the internals of the structure, if None it will be defined
  • angles (list or None) - contains tuples of atom names of the angles to be fixed, if None then all will be fixed
Returns: structure.Structure
the structure with angles fixed

Variables Details [hide private]

__doc__

Value:
"""
Utilities for working with coarse grain structures

Copyright Schrodinger, LLC. All rights reserved.
"""

CG_UNIQUE_BOND_PARTICLE_1_LABEL_KEY

Value:
's_matsci_cg_particle_1_label'

CG_UNIQUE_BOND_PARTICLE_2_LABEL_KEY

Value:
's_matsci_cg_particle_2_label'

MSJ_LJ_COARSE_GRAIN_HEADER

Value:
'''

         #
         # Universal settings for Lennard-Jones coarse grain systems
         #
         glue = none
         coulomb_method = pme
         cutoff_radius = {cutoff}
...

MSJ_RH_COARSE_GRAIN_HEADER

Value:
'''

         #
         # Universal settings for repulsive harmonic coarse grain syst\
ems
         #
         glue = none
         cutoff_radius = {cutoff}
...

EXCLUDE_BONDS_ANGLES_DIHEDRALS

Value:
'Bonds, 1-3 Angles, and 1-4 Dihedrals'