Package schrodinger :: Package structutils :: Module measure
[hide private]
[frames] | no frames]

Module measure

Functions for measuring distances and angles in structures.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  _DistanceCell
  DistanceCellIterator
Iterate through neighbors of specified atoms.
Functions [hide private]
 
_get_close_atoms_python(st, dist, atoms=None)
DEPRECATED: This is used to test accuracy and speed gains of the newly wrapped C++ function, and should not be used for general purposes.
 
get_close_atoms(st, dist, atoms=None)
Use this function to find all atoms within a specified distance of each other in roughly O(N) time.
iter
dist_cell_iterator(st, dist=None, atoms=None, cell_handle=None, delete_dist_cell=True)
Create an iterator that uses a distance cell to iterate through neighbors of the specified atoms
 
measure_distance(atom1, atom2)
Measure the distance between two atoms.
 
measure_bond_angle(atom1, atom2, atom3)
Measure the atom between 3 specified atoms.
 
measure_dihedral_angle(atom1, atom2, atom3, atom4)
Measure the dihedral angle between the specified atoms.
 
measure_plane_angle(atom1, atom2, atom3, atom4, atom5, atom6, minangle=False)
Measure the angle between planes of the provided atoms.
Variables [hide private]
  __package__ = 'schrodinger.structutils'
Function Details [hide private]

_get_close_atoms_python(st, dist, atoms=None)

 

DEPRECATED:  
This is used to test accuracy and speed gains of the newly wrapped
C++ function, and should not be used for general purposes.


Use this function to find all atoms within a specified distance of each
other in roughly O(N) time.
Retuns a list of tuples in the form of: (atom1, atom2), where atom1 and
atom2 are atom indices.

This function is only roughly O(N) in the number of atoms in the
molecule because as dist increases it will reach the limit of O(N^2).
Its true cost is O(N*m) where m is the number of atoms in a cubic box
with edges of dist length.

st - Structure object
dist - distance threshold, in angstroms.
atoms - optionally consider only atoms with these indices
        (all atoms in CT by are scanned by default)

NOTE: Each atom pair is listed only once in the output.
NOTE: This funtion is efficient only for small distances (<3A)

get_close_atoms(st, dist, atoms=None)

 

Use this function to find all atoms within a specified distance of each
other in roughly O(N) time.
Returns a list of tuples in the form of: (atom1, atom2), where atom1 and
atom2 are atom indices.

This function is only roughly O(N) in the number of atoms in the
molecule because as dist increases it will reach the limit of O(N^2).
Its true cost is O(N*m) where m is the number of atoms in a cubic box
with edges of dist length.

st - Structure object
dist - distance threshold, in angstroms.
atoms - optionally consider only atoms with these indices
        (all atoms in CT by are scanned by default)

NOTE: Each atom pair is listed only once in the output.
NOTE: This funtion is efficient only for small distances (<3A)

dist_cell_iterator(st, dist=None, atoms=None, cell_handle=None, delete_dist_cell=True)

 

Create an iterator that uses a distance cell to iterate through neighbors of the specified atoms

Parameters:
  • st (schrodinger.structure.Structure) - The structure to examine
  • dist (float) - The distance cutoff for calculating neighbors. Either dist or cell_handle must be given, but not both.
  • atoms (list) - A list of atom numbers to calculate neighbors for. If not, given, st.atom will be used.
  • cell_handle (int) - A handle to an existing distance cell. If not given, a new distance cell will be created with distance dist. Either dist or cell_handle must be given, but not both.
  • delete_dist_cell (bool) - If cell_handle is given and delete_dist_cell is True, then distance cell cell_handle will be deleted after iteration is complete. Has no effect if cell_handle is not given. Defaults to True.
Returns: iter
An iterator that iterates through neighbors of the specified atoms
Raises:
  • ValueError - If both dist and cell_handle are not None

Deprecated: The DistanceCellIterator class provides the same functionality as this function but with increased flexibility

measure_distance(atom1, atom2)

 

Measure the distance between two atoms.

All atom arguments must be _StructureAtom objects (returned from the Structure.atom list), and can be from different structures.

See also the Structure.measure method. It can use integer atom indices in addition to _StructureAtom objects, but is restricted to measurements within the structure and cannot do plane angle measurements.

measure_bond_angle(atom1, atom2, atom3)

 

Measure the atom between 3 specified atoms.

All atom arguments must be _StructureAtom objects (returned from the Structure.atom list), and can be from different structures.

See also the Structure.measure method. It can use integer atom indices in addition to _StructureAtom objects, but is restricted to measurements within the structure and cannot do plane angle measurements.

measure_dihedral_angle(atom1, atom2, atom3, atom4)

 

Measure the dihedral angle between the specified atoms.

All atom arguments must be _StructureAtom objects (returned from the Structure.atom list), and can be from different structures.

See also the Structure.measure method. It can use integer atom indices in addition to _StructureAtom objects, but is restricted to measurements within the structure and cannot do plane angle measurements.

measure_plane_angle(atom1, atom2, atom3, atom4, atom5, atom6, minangle=False)

 

Measure the angle between planes of the provided atoms.

All atom arguments must be _StructureAtom objects (returned from the
Structure.atom list), and can be from different structures. 

See also the Structure.measure method. It can use integer atom indices
in addition to _StructureAtom objects, but is restricted to measurements
within the structure and cannot do plane angle measurements.

Parameters

minangle (bool)
    This applies to the planar angle calculation and if True restricts
    the angle to <= 90.0 degrees.  That is, it treats the order of atoms
    defining a plane as unimportant, and the directionality of the plane
    normals is ignored.