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

Class Monomer

object --+    
         |    
BaseMoiety --+
             |
            Monomer

The repeating unit that makes up the polymer chain

Instance Methods [hide private]
 
__init__(self, struct)
Create a Monomer object
 
setAllTransBackbone(self)
Set all the backbone dihedrals to 180
bool
hasChirality(self)
Check if this monomer has a chiral backbone
 
findHeadTailBranch(self)
Find and mark the head, tail and any branching atoms
 
findBackbone(self)
Find the set of atoms that creates the shortest distance (number of bonds) between the head and tail atoms.
 
findRingSideGroup(self, struct, terminator_indexes, root_index)
Return a list of atoms bound to root_index (and recursively all atoms bound to those atoms, ad infinitum).
 
alignOnXAxis(self)
Align the monomer so the head is at the origin and the backbone is aligned to the +X axis
 
flipTailFirst(self)
Flip the structure so the tail is on the origin and the backbone is aligned to the +X axis
 
setupTacticity(self)
Store both R and S structures for the monomer so we don't have to keep inverting the chirality when needed.
schrodinger.structure.Structure
getNextStructure(self, orientation)
Get the next monomer structure with the given orientation.
AttachmentAtoms
getCouplerAndGrower(self, orientation)
Get the coupler, coupler_marker, grower and grow_marker atoms for this monomer
str
getCouplerElement(self, orientation)
Get the element of the coupler atom
bool
isBrancher(self)
Is this monomer a braching monomer?
 
readFromStructure(self, struct)
Overrides the parent method to add and read Monomer-specific properties.
 
getPDBName(self)
Get a PDB residue-like Name for this moiety
 
setAsFragment(self)
Prepare monomer information for in-cell grow.
list of {Monomer}
breakTemplatePolymer(self)
Copy the original moieties to tmp_moieties and break the monomers into small new monomers according to rotatable bonds in side group.
list of tuple
findBondsToBreak(self)
Search the side groups of all backbone atoms and find the 'first neighbor' rotatable bonds.
 
stripSideStructs(self, struct_copy, pdbres)
Strip the sub structures in side groups and form new monomers from these sub structures.
str
getNewResidueName(self, is_finished_moiety)
Generate the residue name for new sub structure.
 
updateTemplatePolymerResidue(self, struct, pdbres, resname)
Update the residue number and name for the atoms in template polymer for the newly added residue.

Inherited from BaseMoiety: addToChain, alignToVector, checkRequiredProperties, determineCouplerLocation, finalizeSideGroup, findAttachedAtomIndex, findBackbone2BranchingPoint, findRotatableBonds, findSideGroup, getBondLength, getStructureForCoupling, markBackboneAtom, moveHeadToOrigin

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

Class Methods [hide private]
 
write(cls, filename, struct, *args)
Write out the structure
Static Methods [hide private]
 
addPropsToStructure(struct, letter, markers, name, tacticity, branching_percent, branching_max_gen, all_trans)
Add properties to the structure that the driver will need as input
Class Variables [hide private]

Inherited from BaseMoiety: bond_length_cache

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, struct)
(Constructor)

 

Create a Monomer object

Monomers drawn by the user as:
    R1-stuff-R2
And stored as:
    marker1-head-stuff-tail-marker2

where marker1 is the R1 atom, head is the atom it is bound to, marker2
is the R2 atom and tail is the atom it is bound to, and stuff
is everything else.

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

hasChirality(self)

 

Check if this monomer has a chiral backbone

Returns: bool
Whether the backbone has a chiral atom

findBackbone(self)

 

Find the set of atoms that creates the shortest distance (number of bonds) between the head and tail atoms. This is the monomer backbone.

Backbone atoms are marked with a backbone atom property

findRingSideGroup(self, struct, terminator_indexes, root_index)

 

Return a list of atoms bound to root_index (and recursively all atoms
bound to those atoms, ad infinitum).  terminator_indexes is a set of
atoms that terminate the group - when a terminator atom is encountered,
the group stops growing in that direction.  Unlike
Structure.getMovingAtoms or buildcomplex.find_atoms_to_remove, this
method gracefully handles cases where terminator atoms and group atoms
share the same ring.  Imagine naphthalene:
    3   7
   / \ /           4   2   8
  |   |   |
  5   1   9
   \ / \ /
    6   10

If root_index=6 and terminator_indexes={1}, all other atoms will become
part of the same group as 6 - because there is a path all the way around
the outer ring that bypasses 1 going clockwise from 6.

If root_index=6 and terminator_indexes={1,2}, then only atoms 6, 5, 4, 3
will be members of the group, because both atoms 1 and 2 terminate the
group.

root_index is always part of the group

@type struct: schrodinger.structure.Structure
@param struct: The structure to use

@type terminator_indexes: set of int
@param terminator_indexes: The indexes of the atoms that terminate the
group.

@type root_index: int
@param root_index: The index of the first atom in the group. All
neighbors of this atom that are not terminator atoms will be added to
the list.

@rtype: list
@return: A list of all atoms recursively bound to the root atom,
including root_index itself but not including any atom in
terminator_indexes

setupTacticity(self)

 

Store both R and S structures for the monomer so we don't have to keep inverting the chirality when needed. This takes a miniscule amount of effort, since it is only done once per monomer type

getNextStructure(self, orientation)

 

Get the next monomer structure with the given orientation. "Next" in this case takes into account the chirality of the previous structure - for syntactic polymers, the monomers alternate chirality.

Parameters:
  • orientation (str) - HEADFIRST or TAILFIRST constants
Returns: schrodinger.structure.Structure
The next structure to use for this monomer

getCouplerAndGrower(self, orientation)

 

Get the coupler, coupler_marker, grower and grow_marker atoms for this monomer

Parameters:
  • orientation (str) - HEADFIRST or TAILFIRST constants
Returns: AttachmentAtoms
The atoms indexes of the coupler, grower and marker atoms. Which one is the head and which is the tail depends on orientation.

getCouplerElement(self, orientation)

 

Get the element of the coupler atom

Parameters:
  • orientation (str) - HEADFIRST or TAILFIRST constants
Returns: str
The element of the coupler atom Whether this is the head and or the tail depends on orientation.

isBrancher(self)

 

Is this monomer a braching monomer?

Returns: bool
Whether this monomer is a branching monomer

addPropsToStructure(struct, letter, markers, name, tacticity, branching_percent, branching_max_gen, all_trans)
Static Method

 

Add properties to the structure that the driver will need as input

Parameters:
  • struct (schrodinger.structure.Structure) - The structure to add the properties to
  • letter (str) - The one-character code for this monomer
  • markers (list of int) - Atom indexes of the marker atoms
  • name (str) - The title to use
  • tacticity (str) - One of the TACTICITY module constants specifying the tacticity for this monomer
  • branching_percent (float) - The % chance to branch for this monomer
  • branching_max_gen (int) - The maximum branching generations for this monomer
  • all_trans (bool) - Whether the intra-monomer backbone dihedrals should be all set to 180.

write(cls, filename, struct, *args)
Class Method

 

Write out the structure

Parameters:
  • filename (str) - The path to the file
  • struct (schrodinger.structure.Structure) - The structure to write out

    See the addPropsToStructure method for additional argument documentation

Overrides: BaseMoiety.write

readFromStructure(self, struct)

 

Overrides the parent method to add and read Monomer-specific properties.

See the parent class method for documentation

Parameters:
  • struct - The structure to check
  • propexps - (property string, explanation of what the property is) for each structure property to check
Overrides: BaseMoiety.readFromStructure

setAsFragment(self)

 

Prepare monomer information for in-cell grow.

Overrides: BaseMoiety.setAsFragment

breakTemplatePolymer(self)

 

Copy the original moieties to tmp_moieties and break the monomers into small new monomers according to rotatable bonds in side group.

Returns: list of {Monomer}
the small monomer moieties that replace the old large one

findBondsToBreak(self)

 

Search the side groups of all backbone atoms and find the 'first neighbor' rotatable bonds.

Returns: list of tuple
'first neighbor' rotable bonds in side groups for all backbone atoms

stripSideStructs(self, struct_copy, pdbres)

 

Strip the sub structures in side groups and form new monomers from these sub structures.

Parameters:
  • struct_copy (schrodinger.structure.Structure) - the structure copy with 'first neighbor' rotatable bonds deleted.
  • pdbres (str) - the name of the residue to strip side structs from

getNewResidueName(self, is_finished_moiety)

 

Generate the residue name for new sub structure.

Parameters:
  • is_finished_moiety (bool) - whether the new sub structure contains the backbone of the parent monomer
Returns: str
residue name for new sub structure

updateTemplatePolymerResidue(self, struct, pdbres, resname)

 

Update the residue number and name for the atoms in template polymer for the newly added residue.

Parameters:
  • struct (schrodinger.structure.Structure) - the new sub struct to form new monomer
  • pdbres (str) - name of the parent residue
  • resname (str) - residue name of the new sub struct