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

Module ringspear

Functions and classes useful for finding ring spears. A ring spear is when a bond between two atoms external to a ring passes through the face of the ring. The bond may be a single bond or a higher-order bond, and it may be cyclic or acyclic. Thus, ring catenation is also found.

To find ring spears within a structure, use:

   check_for_spears(struct)

To find ring spears where struct2 spears struct1, use:

   check_for_spears(struct1, spear_struct=struct2)

To find ring spears, checking only atoms in list "atomlist" as spears, use:

   check_for_spears(struct, atoms=atomlist)

Ring-finding is by far the most expensive operation, so the check_for_spears function allows rings to be passed in as schrodinger.structure._Ring objects if they are already known - or if only a subset of the structure's rings should be used. For a 7000 atom structure with 270 rings, ring-finding took ~ 90% of the total computation time.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  Spear
Contains the atom indexes involved in a ring spear and formats the data in a user-readable string
  SpearRing
Computes and holds information about a ring, and finds bonds that spear that ring.
Functions [hide private]
(schrodinger.infra.structure.DistanceCell, schrodinger.infra.structure.PBC or None)
create_distance_cell(struct, dist, pbc=None)
Create a infrastructure DistanceCell that obeys the given periodic boundary size.
list
check_for_spears(ring_struct, spear_struct=None, atoms=None, rings=None, distorted=False, first_only=True, dist=4.0, pbc=None, max_ring_size=12)
Check for ring spears - rings that have bonds passing through the face of the ring.
Variables [hide private]
  __doc__ = ...
  ROUGH_CUT_DISTANCE = 4.0
The default distance from a ring centroid at which atoms are eliminated from spearing consideration
  __package__ = 'schrodinger.structutils'
Function Details [hide private]

create_distance_cell(struct, dist, pbc=None)

 

Create a infrastructure DistanceCell that obeys the given periodic boundary size.

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to create the distance cell for
  • dist (float) - The distance threshold for the distance cell
  • pbc (None, infrastructure.PBC, or list) - If periodic boundary conditions should be used, provide either an infrastructure.PBC object or the parameters to construct one. Allowed constructors:
       * a, b, c : box lengths
       * a, b, c, alpha, beta, gamma box : box lengths and angles
       * ax, ay, az, bx, by, bz, cx, cy, cz : box vectors
    
Returns: (schrodinger.infra.structure.DistanceCell, schrodinger.infra.structure.PBC or None)
A distance cell object that obeys the given PBC conditions. Note that this is a different type of object than an mmct distance cell and has a completely different API. The second value returned is the PBC object used to create the distance cell or None if no PBC was used.
Raises:
  • ValueError - If the pbc needs to be constructed and the parameters don't match an available constructor

check_for_spears(ring_struct, spear_struct=None, atoms=None, rings=None, distorted=False, first_only=True, dist=4.0, pbc=None, max_ring_size=12)

 

Check for ring spears - rings that have bonds passing through the face of the ring.

Parameters:
  • ring_struct (schrodinger.structure.Structure) - The structure containing the rings to check for spearing
  • spear_struct (schrodinger.structure.Structure) - The structure to check if any bonds spear a ring in ring_struct. If not given, ring_struct will be used - i.e. intrastructure ring spears will be searched for.
  • atoms (list) - List of atom indexes to check to see if they spear a ring. Should be indexes from spear_struct if spear_struct is given, otherwise indexes from ring_struct. If not given, all atoms will be checked.
  • rings (iterable of schrodinger.structure._Ring) - _Ring objects to check to see if they are speared. If not given, all rings in the ring_struct.ring iterator will be used. Use this parameter if you have an optimized method of finding rings in ring_struct or if they are already known.
  • distorted (bool) - If False (default), the structure will be assumed to have reasonable bond lengths, and optimizations will be used to dramatically speed up spear-finding in large structures by eliminating atoms that cannot possibly spear a ring. If True, atom distances will not be used to optimize spear-finding - significantly increasing the time required.
  • first_only (bool) - Whether to return after finding the first ring spear, or whether all ring spears should be found.
  • dist (float) - The distance from the centroid to use when making a first rough cut pass to eliminate atoms that are too far away from a ring to spear it. The default value is the module constant ROUGH_CUT_DISTANCE. This value is ignored if distorted is True.
  • pbc (None, infrastructure.PBC, or list) - If periodic boundary conditions should be used, provide either an infrastructure.PBC object or the parameters to construct one. Allowed constructors:
       * a, b, c : box lengths
       * a, b, c, alpha, beta, gamma box : box lengths and angles
       * ax, ay, az, bx, by, bz, cx, cy, cz : box vectors
    
  • max_ring_size (int or None) - The maximum size ring that will be checked for ring spears. The default value prevents macrocycles from being checked. Set to None to include all rings
Returns: list
A list of found ring-spears, each item is a Spear object. An empty list is returned if no spears are found, and if first_only is True, the list will be at most 1 item long.
Raises:
  • ValueError - If the pbc needs to be constructed and the parameters don't match an available constructor

Variables Details [hide private]

__doc__

Value:
"""
Functions and classes useful for finding ring spears. A ring spear is \
when a
bond between two atoms external to a ring passes through the face of t\
he ring.
The bond may be a single bond or a higher-order bond, and it may be cy\
clic or
acyclic. Thus, ring catenation is also found.
...