Package schrodinger :: Package application :: Package matsci :: Module amorphous :: Class BaseMoiety
[hide private]
[frames] | no frames]

Class BaseMoiety

object --+
         |
        BaseMoiety
Known Subclasses:

Base class for all polymer units - initiator, terminator, cascader, monomers

Instance Methods [hide private]
 
__init__(self, struct, markers=None, name=None)
Create a BaseMoiety object
int
findAttachedAtomIndex(self, mark_index, prop=None, propval=True)
Find the index of the atom attached to the atom with the given index, optionally setting a property/value on that atom
 
moveHeadToOrigin(self)
Move the structure so that the head atom is at the origin
 
alignToVector(self, struct, current_vector, vector)
Rotate the structure so that the current_vector is aligned to a new vector
(schrodinger.structure.Structure, AttachementAtoms)
getStructureForCoupling(self, orientation, location=None, vector=None, remove_marker=True, residue_number=None)
Get the appropriate structure to couple to the existing unit
float
getBondLength(self, element1, element2)
Get the desired bond length between the grower atom of the existing unit and the coupling atom of this moiety
list
determineCouplerLocation(self, xyz, vector, element1, element2)
Figure out the XYZ coordinates where the coupler atom should go
 
addToChain(self, chain, grower, grow_marker, orientation, remove_marker=True, set_residue_data=False, propagate_chain_data=False, chain_namer=None)
Bind this moiety to an existing chain
 
findBackbone2BranchingPoint(self, exclude_markers)
Find the branching point and the shortest path to the nearest atom in backbone_path_indexes.
 
checkRequiredProperties(self, struct, propexps)
Check to see if the structure has the desired properties set on it
 
readFromStructure(self, struct, propexps=None)
Read the data for this moiety from the structure object and check to make sure all the required properties are set
 
findSideGroup(self)
Find and mark the side group atoms.
 
finalizeSideGroup(self)
Find atoms in backbone (marked as BACKBONE_ATOM_PROP) but not in the shortest path (backbone_path_indexes) and then treat these atoms along with their side groups as the side groups of certain atom in shortest path (backbone_path_indexes)
 
markBackboneAtom(self, index)
Mark the atom as a backbone atom and make sure that if the atom is in a ring that all atoms in the ring are marked as backbone
 
setAsFragment(self)
Set backbone path and side atoms for Initiator and Terminator.
 
findRotatableBonds(self)
Find rotatable bond along the backbone path.

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

Class Methods [hide private]
 
write(cls, filename, struct, markers, name, classname=None)
Write the structure out to a file, tagging it with properties in such a way that the driver will recognize when reading the structure in
Class Variables [hide private]
  bond_length_cache = {}
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, struct, markers=None, name=None)
(Constructor)

 

Create a BaseMoiety object

Parameters:
  • struct (schrodinger.structure.Structure) - The structure of this Moiety
  • markers (list) - A list of the indexes of the Rx atoms. If not supplied, information will be read from the structure properties
Overrides: object.__init__

findAttachedAtomIndex(self, mark_index, prop=None, propval=True)

 

Find the index of the atom attached to the atom with the given index, optionally setting a property/value on that atom

Parameters:
  • mark_index (int) - The index of the atom that we want to find an atom attached to.
  • prop (str) - An atom property name
  • propval - The value to set prop to on the found attached atom. The type of this object depends on the type of property being set
Returns: int
The index of an atom attached to the mark_index atom. If more than one atom is attached to mark_index atom, the first one is returned.

alignToVector(self, struct, current_vector, vector)

 

Rotate the structure so that the current_vector is aligned to a new vector

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to rotate. The coordinates of this structure will be modified by this method
  • current_vector (list) - The current vector that will be aligned to the new vector
  • vector (list) - The new vector that current_vector should be aligned to
Returns:
There is no return value, the structure is modified directly

getStructureForCoupling(self, orientation, location=None, vector=None, remove_marker=True, residue_number=None)

 

Get the appropriate structure to couple to the existing unit

Parameters:
  • orientation (str) - Should be the HEADFIRST or TAILFIRST constant, indicates which end of the moiety will bind
  • location (list) - XYZ coordinates that the coupling atom (head or tail depending on orientation) should be moved to (moving the rest of this moiety with it)
  • vector (list) - The vector that the coupler-coupling marker vector should be aligned to
  • remove_marker (bool) - Whether the marker atom should be removed.
  • residue_number (int or None) - If not None, the resnum property of every atom in the returned structure will be set to this value and the residue name will be assigned.
Returns: (schrodinger.structure.Structure, AttachementAtoms)
A copy of the structure of this moiety rotated and translated as requested so that it can bind in the specified orientation. An AttachedAtoms tuple that gives the coupler, grower and marker indexes for this structure.

getBondLength(self, element1, element2)

 

Get the desired bond length between the grower atom of the existing unit and the coupling atom of this moiety

Parameters:
  • element1 (str) - The element of the first atom
  • element2 (str) - The element of the first atom
Returns: float
The desired bond distance

determineCouplerLocation(self, xyz, vector, element1, element2)

 

Figure out the XYZ coordinates where the coupler atom should go

Parameters:
  • xyz (list) - The XYZ coordinates of the grower atom
  • vector (list) - The desired bond vector for coupling (goes from grower->coupler)
  • element1 (str) - The element of the grower atom
  • element2 (str) - The element of the coupler atom
Returns: list
The XYZ coordinates where the coupler atom should be placed

addToChain(self, chain, grower, grow_marker, orientation, remove_marker=True, set_residue_data=False, propagate_chain_data=False, chain_namer=None)

 

Bind this moiety to an existing chain

The grower, grow_marker, coupler and coupler_marker are defined so that
the binding occurs like this:

    chain-grower                   coupler_marker
                \                                                         grow_marker                      coupler-this_moiety

    goes to:

    chain-grower
                                         coupler-this_moiety


@type chain: L{schrodinger.structure.Structure}
@param chain: The existing chain to add this moiety to

@type grower: int
@param grower: The index of the atom in the existing chain that this
moiety should bond with

@type grow_marker: int
@param grow_marker: The index of the Rx atom that marks the attachment
point - the grower->grow_marker bond vector indicates the desired
grower->coupler bond vector.

@type orientation: str
@param orientation: Whether this moiety should add head first or tail
first. Should be a module HEADFIRST or TAILFIRST constant.

@type remove_marker: bool
@param remove_marker: Whether the chains grower_marker atom should be
removed. Set to False if adding multiple moieties and you don't want
existing atom numbers to change during the process.

@type set_residue_data: bool
@param set_residue_data: Whether to set the residue number property
for all atoms added by this method to 1 greater than the residue number
of the grow atom on the passed in chain. If False, no residue numbers
will be set. A residue name is also assigned if this value is True.

@type propagate_chain_data: bool
@param propagate_chain_data: Whether to set the chain data
for all atoms added by this method to the same chain information as
the grow atom on the passed in chain. If False or the grower atom
contains no chain information, this will not be done.
This parameter is used if the added moiety should have the same chain
information as the existing moiety. See also the chain_namer parameter.

@type chain_namer: function
@param chain_namer: A function that should be called with the structure
that will be added to chain. The purpose of this function should be to
add chain name data to the added structure. Supply this function if the
moiety to be added is a full chain. If the moiety to be added is just
another monomer, terminator, etc during the building of a single chain,
do not supply this function. This parameter is used if the added moiety
should have different chain information from the existing moiety, and it
is up to the chain_namer function to set that data.
See also the propagate_chain_data paramter.

@rtype: (int, int, int)
@return: The atom indexes of the coupler atom, the new grower atom
and the new grow marker.

findBackbone2BranchingPoint(self, exclude_markers)

 

Find the branching point and the shortest path to the nearest atom in backbone_path_indexes. The braching point may have multiple branches connected to, but only one single pair of [backbone atom][branching atom] = [path with ends] is recorded.

Parameters:
  • exclude_markers (list of int) - the atom ids of markers to be excluded

write(cls, filename, struct, markers, name, classname=None)
Class Method

 

Write the structure out to a file, tagging it with properties in such a way that the driver will recognize when reading the structure in

Parameters:
  • filename (str) - The path to the file
  • struct (schrodinger.structure.Structure) - The structure to write
  • markers (list) - A list of the indexes of the Rx atoms.
  • name (str) - The name to use for the title of the structure
  • classname (str) - The chemical class of this moiety. If not supplied, the actual python class name will be used since those are typically the same as the chemical class.

checkRequiredProperties(self, struct, propexps)

 

Check to see if the structure has the desired properties set on it

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to check
  • propexps (list of tuple) - (property string, explanation of what the property is) for each structure property to check

readFromStructure(self, struct, propexps=None)

 

Read the data for this moiety from the structure object and check to make sure all the required properties are set

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to check
  • propexps (list of tuple) - (property string, explanation of what the property is) for each structure property to check

findSideGroup(self)

 

Find and mark the side group atoms. The side group is any heavy atom not part of the backbone and any hydrogen attached to one of those heavy atoms. Note that IUPAC specifically states that a "sidechain" is an oligomer or polymer, while a "side group" is a non-oligomer/polymer. So monomers have side groups, not sidechains.

markBackboneAtom(self, index)

 

Mark the atom as a backbone atom and make sure that if the atom is in a ring that all atoms in the ring are marked as backbone

Parameters:
  • index (int) - The index of the atom to mark

setAsFragment(self)

 

Set backbone path and side atoms for Initiator and Terminator. Only the atom connected to R1 group is treated as backbone path; all the rest real atoms are treated as side groups.