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]
  Internals
Manage the internal coordinates of a structure.
  FusedRing
Manage a fused ring.
Functions [hide private]
float
_get_rh_cg_cutoff_factor(model)
Get the scale factor for the cutoff when computing rclone in repulsive harmonic CG models.
float, float, and float
get_cg_cutoff_data(model)
Return the coarse grain cutoff data, i.e.
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.
schrodinger.structure._Ring or None
get_ring_containing_atoms(atoms, struct=None, rings=None)
Return the first ring containing the given atoms.
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'
  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 = 3.5
  RH_CUTOFF_FACTOR_ANGLES = 2.5
  RH_CUTOFF_FACTOR_BONDS = 1.5
  __package__ = 'schrodinger.application.matsci'
Function Details [hide private]

_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

get_cg_cutoff_data(model)

 

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

Parameters:
Returns: float, float, and float
the coarse grain cutoff, margin, and r_clone values
Raises:
  • ValueError - if model is incorrect

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

get_ring_containing_atoms(atoms, struct=None, rings=None)

 

Return the first ring containing the given atoms.

Parameters:
  • atoms (tuple) - contains atom indices
  • struct (structure.Structure or None) - the structure containing the atoms or None if rings are provided
  • rings (list or None) - contains schrodinger.structure._Ring or None if struct is provided
Returns: schrodinger.structure._Ring or None
the first ring containing the given atoms or None if a ring was not found
Raises:
  • ValueError - if neither struct nor rings are provided

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 = %.3f
...

MSJ_RH_COARSE_GRAIN_HEADER

Value:
'''

         #
         # Universal settings for repulsive harmonic coarse grain syst\
ems
         #
         glue = none
         cutoff_radius = %.3f
...

EXCLUDE_BONDS_ANGLES_DIHEDRALS

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