Package schrodinger :: Package structutils :: Module rgroup_enumerate :: Class RgroupEnumerator
[hide private]
[frames] | no frames]

Class RgroupEnumerator

object --+
         |
        RgroupEnumerator


Enumerate a structure using R-group sources.

A source is a sequence with an iterable of Structure as its first element,
followed by one or more core atom atom indices where the side chains from
the source should be inserted.

RgroupEnumerator objects are iterable. Example:

    sources = [
        (StructureReader('r1.maegz'), 4, 12),
        (StructureReader('r2.maegz'), 8),
    ]
    for prod_st in RgroupEnumerator(core_st, sources):
        ...

will use the first reader to replace atoms 4 and 12 in an homo fashion
(meaning that for a given product, the groups attached to atoms 4 and 12 are
always the same), in combination with the structures for the second reader
for atom 8.

The structures in each R-group source should each have one dummy atom
(symbol '', atomic number zero).

The user of the class can request only a slice of the full set of
combinations to be yielded, by providing the optional 'start' and 'stop'
constructor arguments. These follow the standard Python slicing convention.

Instance Methods [hide private]
 
__init__(self, core_st, sources, optimize_sidechains=True, start=0, stop=None)
Initialize an enumerator for a given core structure and specification of rgroup sources.
 
__iter__(self)
schrodinger.structure.Structure
attachSidechains(self, sidechains)
Attach the sidechains to the core structure and return the resulting structure.
2-tuple (list of int, int)
_attachSidechain(self, prod, sidechain, atom_index)
Attach a sidechain to the core at the specified atom index.
 
_generateCoordinates(self, st, core_atoms)
Generate 3D coordinates for the non-core atoms in the structure using fast3d.
 
_alignCore(self, st, input_core_atoms, product_core_atoms)
Superimpose the product structure on the input core.

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, core_st, sources, optimize_sidechains=True, start=0, stop=None)
(Constructor)

 

Initialize an enumerator for a given core structure and specification of rgroup sources.

Parameters:
  • core_st (schrodinger.structure.Structure) - core structure
  • sources (list of list) - side chain sources. See class description for details.
  • optimize_sidechains (bool) - if true, generate 3D coordinates for the side chain atoms using Fast3D. The input coordinates will only be used for determining stereochemistry. If false, position the side chains using rigid rotation and translation (and an arbitrary torsional angle around the new bond).
  • start (int) - beginning of results slice (used by subjobs)
  • stop (int or None) - end of results slice (used by subjobs)
Overrides: object.__init__

attachSidechains(self, sidechains)

 

Attach the sidechains to the core structure and return the resulting structure.

Parameters:
Returns: schrodinger.structure.Structure
product structure.

_attachSidechain(self, prod, sidechain, atom_index)

 

Attach a sidechain to the core at the specified atom index. Returns the indices of the two atoms that should be deleted, as well as the index of the sidechain atom that is now bonded to the core. (This low-level method doesn't delete them because the caller may be attaching multiple sidechains, and deleting each time could trigger confusing renumbering and be less efficient.)

Parameters:
Returns: 2-tuple (list of int, int)
list of atoms to delete, R-group atom bound to core

_generateCoordinates(self, st, core_atoms)

 

Generate 3D coordinates for the non-core atoms in the structure using fast3d.

Parameters:
  • st (schrodinger.structure.Structure) - structure, to be modified in place
  • core_atoms (list of int) - list of core atoms which will be kept frozen (may be empty)

_alignCore(self, st, input_core_atoms, product_core_atoms)

 

Superimpose the product structure on the input core.

Parameters:
  • st (schrodinger.structure.Structure) - structure to rotate in place
  • input_core_atoms (list of int) - list of core atoms in self.core_st
  • product_core_atoms (list of int) - list of core atoms in 'st