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

Class Internals

object --+
         |
        Internals

Manage the internal coordinates of a structure.

Instance Methods [hide private]
 
__init__(self, astructure, uniqueify=False)
Create an instance.
list
orderInternalByName(self, atoms)
Order the atoms of the given internal coordinate by name.
tuple
getNames(self, atoms, uniqueify=False)
Return the atom names for the given list of atoms.
tuple
getIdxs(self, atoms)
Return the atom indices for the given list of atoms.
dict
avgInternals(self, internals)
Average the values of the internals in the given dictionary of internals.
OrderedDict
recursivelySort(self, internals)
Return the given dictionary of internal coordinates recursively sorted by the names of the constitutive atoms.
bool
setInternals(self, internals, atoms, internals_excluded=None, data=None, uniqueify=False)
Set internals.
dict
averageAndSort(self, internals)
Average and sort the given internals.
 
setSites(self)
Set the sites dictionary.
 
setBonds(self)
Set the bonds dictionary.
 
setAngles(self)
Set angles dictionary.
 
setDihedrals(self)
Set dihedrals dictionary.
list
getNewAngles(self, new_bonds)
Return the new angles.
list
getNewDihedrals(self, new_bonds)
Return the new dihedrals.
 
removeInternalsWithNewBonds(self, exclude_what='Bonds')
Remove internals with new bonds.
list
findNewBonds(self, name_1, name_2, bonds_deep, exclude_what='Bonds')
Return the new bond pairs.
 
updateInternalsForNewBonds(self, new_bonds_tuples, exclude_what='Bonds')
Update the internals when a new set of bonds has been defined
dict
_findNonBondPairs(self, exclude=None)
This finds all pairs of particle types that have at least one non-bond interaction.
 
setNonBonds(self, exclude_newbonds=True)
Set nonbonds dictionary.
 
setBasic(self, exclude_what='Bonds')
Set basic dictionaries.
 
setIncludedExcludedNonBonds(self, exclude_what='Bonds')
Define which non-bond interactions are included and excluded
 
setAngleNonBonds(self)
Set angle nonbonds dictionary.
 
setNonAngleNonBonds(self)
Set the nonangle nonbonds dictionary.
 
setDihedralNonBonds(self)
Set dihedral nonbonds dictionary.
 
setNonAngleNonDihedralNonBonds(self)
Set the nonangle nondihedral nonbonds dictionary.
 
setBondNonBonds(self)
Set the bond nonbonds dictionary.
 
setAllPairs(self)
Set the all pairs dictionary.
dict
mergeNonbonds(self, nonbonds, new_nonbonds, sort=False)
Return a copy of the first nonbonds dict merged with the second.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, astructure, uniqueify=False)
(Constructor)

 

Create an instance.

Parameters:
  • astructure (structure.Structure) - the structure for which the internal coordinates are needed
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Overrides: object.__init__

orderInternalByName(self, atoms)

 

Order the atoms of the given internal coordinate by name.

Parameters:
  • atoms (list) - contains structure._StructureAtom of the internal coordinate to be ordered
Returns: list
atoms sorted by name

getNames(self, atoms, uniqueify=False)

 

Return the atom names for the given list of atoms.

Parameters:
  • atoms (list) - contains structure._StructureAtom
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Returns: tuple
contains atom names

getIdxs(self, atoms)

 

Return the atom indices for the given list of atoms.

Parameters:
  • atoms (list) - contains structure._StructureAtom
Returns: tuple
contains atom indices

avgInternals(self, internals)

 

Average the values of the internals in the given dictionary of internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
Returns: dict
keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values

recursivelySort(self, internals)

 

Return the given dictionary of internal coordinates recursively sorted by the names of the constitutive atoms.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values
Returns: OrderedDict
internals recursively sorted

setInternals(self, internals, atoms, internals_excluded=None, data=None, uniqueify=False)

 

Set internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
  • atoms (list) - contains structure._StructureAtom for a given internal
  • internals_excluded (dict or None) - contains internals that should be excluded from being set. keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
  • data (tuple or None) - a tuple of data for the given internal or None if it needs to be measured
  • uniqueify (bool) - if True then relevant internal coordinates will be uniqueified by type
Returns: bool
True if the internal was set, or False if it was not set due to already appearing in the internals_excluded dict

averageAndSort(self, internals)

 

Average and sort the given internals.

Parameters:
  • internals (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values
Returns: dict
sorted keys where keys are tuples of names of the constitutive atoms, values are pair tuples containing (1) tuple of tuples containing atom indices for all of the internals with the given key and (2) a tuple of average internal values

getNewAngles(self, new_bonds)

 

Return the new angles.

Parameters:
  • new_bonds (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds
Returns: list
contains schrodinger.structure._StructureAtom triples tuples for new angles

getNewDihedrals(self, new_bonds)

 

Return the new dihedrals.

Parameters:
  • new_bonds (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds
Returns: list
contains schrodinger.structure._StructureAtom quadruples tuples for new dihedrals

removeInternalsWithNewBonds(self, exclude_what='Bonds')

 

Remove internals with new bonds.

Parameters:
  • exclude_what (str) - What to exclude - should be one of the EXCLUDE_* constants

findNewBonds(self, name_1, name_2, bonds_deep, exclude_what='Bonds')

 

Return the new bond pairs.

Parameters:
  • name_1 (str) - the name of the first particle
  • name_2 (str) - the name of the second particle
  • bonds_deep (int) - the number of bonds separating the particles
  • exclude_what (str) - What nonbonds to exclude when regenerating the lists of included and excluded nonbonds after adding these bonds - should be one of the EXCLUDE_* constants
Returns: list
contains schrodinger.structure._StructureAtom pair tuples for new bonds

updateInternalsForNewBonds(self, new_bonds_tuples, exclude_what='Bonds')

 

Update the internals when a new set of bonds has been defined

Parameters:
  • new_bonds_tuples (list) - contains schrodinger.structure._StructureAtom pair tuples for new bonds
  • exclude_what (str) - What nonbonds to exclude when regenerating the lists of included and excluded nonbonds after adding these bonds - should be one of the EXCLUDE_* constants

_findNonBondPairs(self, exclude=None)

 

This finds all pairs of particle types that have at least one non-bond interaction. Unlike other types of internals (sites, bonds, angles, etc) we do not want to enumerate all instances. Therefore, for each pair of types, we just check pairs of those atoms until we find a single non-bonded example. Once we have that one example, that's all we need to add that pair to the non-bond pair type list.

Parameters:
  • exclude (dict or None) - contains internals that should not be considered as example pairs, probably due to the 1-3 angle nonbond setting. keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
Returns: dict
keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values

setNonBonds(self, exclude_newbonds=True)

 

Set nonbonds dictionary.

Parameters:
  • exclude_newbonds (bool) - If True, exclude new bonds added by the user. If False, only exclude pairs that are actually bonded.

setBasic(self, exclude_what='Bonds')

 

Set basic dictionaries.

Parameters:
  • exclude_what (str) - What nonbonds to exclude - should be one of the EXCLUDE_* constants

setIncludedExcludedNonBonds(self, exclude_what='Bonds')

 

Define which non-bond interactions are included and excluded

Parameters:
  • exclude_what (str) - What to exclude - should be one of the EXCLUDE_* constants

mergeNonbonds(self, nonbonds, new_nonbonds, sort=False)

 

Return a copy of the first nonbonds dict merged with the second.

Parameters:
  • nonbonds (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
  • new_nonbonds (dict) - keys are tuples of names of the constitutive atoms, values is a list of pair tuples containing (1) a tuple of atom indices and (2) a tuple of internal values or None if there isn't one
  • sort (bool) - whether to sort the merged nonbonds
Returns: dict
merged nonbonds