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

Class PolymerToFragments

object --+
         |
        PolymerToFragments

Save the struct and break it into fragments.

Instance Methods [hide private]
 
__init__(self, struct, num_struct, dihedral_min=0.0, dihedral_max=360.0, dihedral_num=72, dihedral_exclude=False, only_int=False, only_backbone=False, logger=None)
Prepare infomation for in-cell grow of one single polymer chain.
 
renumberResGetM2PMap(self, polymer)
Loop over all the residues and create mapping from atom id in residue to that in polymer.
 
updateAllAtomIndexMaps(self, polymer)
Get infomation from previous polymer build for polymer grow in cell.
 
setInitiatorResidue(self, polymer)
Save the residue containing the polymer initiator.
 
setResidueConnectivity(self, polymer, moiety, residue_num)
Create mapping from connected resnum pair to connected atom pair.
 
setBackboneAndSideGroup(self, moiety, residue_num)
Update backbone and side group maps.
 
setPathtoBranchingAtom(self, moiety_bb_to_marked_end, residue_num)
Update maps for the path between backbone atom to atom branching point.
 
setRotatableBond(self, moiety_rotatable_bonds, residue_num)
Update maps for the path between backbone atom to atom branching point.
 
createFragForInitiator(self)
Create the the first polymer fragment from the initiator and append the following children of it.
 
finishPolymerFrags(self, polymer)
Generate all polymer fragments from the first generation fragment containing INT and the following generation fragments.
 
assignRingAtomIds(self)
Assign ring atom indexes to each fragment.
 
structToOriginByFrag(self, struct, frag)
Move the structure so the centroid of the fragment is at the origin.
list
getFragCentroid(self, struct, frag)
Calculate the centroid of polymer fragment.
iterator to generate int, [int, int]
getDelNextResnumByResnum(self, cur_resnum)
Given resnum, find all the connected residues and atoms.
 
delConnectivity(self, cur_resnum, next_resnum, atom_id, next_atom_id)
Delete the connectivity from current residue to next residue and the connectivity from next residue to current residue.
PolymerFragment or None
createEndSubFragment(self, cur_frag, dihe_3th_resnum, sub_backbone, dihe_4th_resnum, dihe_4th_atom_id, append_to_frag=None)
Create one child PolymerFragment or append atoms to append_to_frag.
 
addBranchingAtoms(self, cur_frag)
Append extra dihedral 4th atoms for branching.
list of int
resBackbone(self, resnum, atom_id)
Given residue number and starting atom id, return the short backbone path (from the starting atom id to the end) and set head/tail using dictionary.
list, int
continueResBackbone(self, polymer, atom_id)
Return rest of the backbone path continuing from the atom_id.
int or None
bondedAtomIdInSameRes(self, atom_id)
Find the atom id of a neighbor atom within the same residue.
iterator to generate int, [int, int]
getDelNextResnumByAtomID(self, atom_id)
Given atom id, find all the connected residues and atoms.
 
extractMoieties(self)
Extract residue structures in a polymer and save one for each residue type.
 
updateOrigAtomIdx(self)
Update the MONOMER_ORIG_ATOM_IDX_PROP property in each polymer atom with the atom index of atoms in moiety_structs.
 
polymerModifiedByUser(self)
Print message and abort.
 
addStructProperties(self)
Copy and add additional properties to moiety_structs to pass the validations in Moieties.

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, struct, num_struct, dihedral_min=0.0, dihedral_max=360.0, dihedral_num=72, dihedral_exclude=False, only_int=False, only_backbone=False, logger=None)
(Constructor)

 

Prepare infomation for in-cell grow of one single polymer chain.

Parameters:
  • struct (schrodinger.structure.Structure) - the structure to be breaked into fragments
  • num_struct (int) - copy the struct by num_struct times when placing them into the cell
  • dihedral_min (float) - lower limit of dihedral angle
  • dihedral_max (float) - upper limit of dihedral angle
  • dihedral_num (int) - the number of dihedral values
  • dihedral_exclude (bool) - (0, dihedral_min) and (dihedral_max, 360) are used as dihedral angle range, if True.
  • only_init (bool) - the struct as a whole is treated as one fragment
  • only_backbone (bool) - only the rotatable bonds in backbone is considered
  • logger (logging.Logger or None) - The logger for this builder
Overrides: object.__init__

renumberResGetM2PMap(self, polymer)

 

Loop over all the residues and create mapping from atom id in residue to that in polymer.

Parameters:

updateAllAtomIndexMaps(self, polymer)

 

Get infomation from previous polymer build for polymer grow in cell.

Parameters:

setInitiatorResidue(self, polymer)

 

Save the residue containing the polymer initiator.

Parameters:

setResidueConnectivity(self, polymer, moiety, residue_num)

 

Create mapping from connected resnum pair to connected atom pair.

Parameters:

setBackboneAndSideGroup(self, moiety, residue_num)

 

Update backbone and side group maps.

Parameters:

setPathtoBranchingAtom(self, moiety_bb_to_marked_end, residue_num)

 

Update maps for the path between backbone atom to atom branching point.

Parameters:
  • moiety_bb_to_marked_end (dict) - Keys are backbone atom indexes, values are dictionaries with keys being the branching atom and values being the path between backbone atom and branching atom
  • residue_num (int) - residue num

setRotatableBond(self, moiety_rotatable_bonds, residue_num)

 

Update maps for the path between backbone atom to atom branching point.

Parameters:
  • moiety_rotatable_bonds (list of tuple) - (atom 1, atom 2) between which bond is rotatable
  • residue_num (int) - residue num

finishPolymerFrags(self, polymer)

 

Generate all polymer fragments from the first generation fragment containing INT and the following generation fragments.

Parameters:

structToOriginByFrag(self, struct, frag)

 

Move the structure so the centroid of the fragment is at the origin.

Parameters:

getFragCentroid(self, struct, frag)

 

Calculate the centroid of polymer fragment.

Parameters:
Returns: list
the centroid of polymer fragment

getDelNextResnumByResnum(self, cur_resnum)

 

Given resnum, find all the connected residues and atoms. Delete the connectivity from current residue to next residue and the connectivity from next residue to current residue.

Parameters:
  • cur_resnum (int) - the residue number which the atom id belongs to
  • del_connection (bool) - del the connection from current atom and residue to the connected atom and residue
Returns: iterator to generate int, [int, int]
the connected residue number, [atom id, connected atom id]

delConnectivity(self, cur_resnum, next_resnum, atom_id, next_atom_id)

 

Delete the connectivity from current residue to next residue and the connectivity from next residue to current residue.

Parameters:
  • cur_resnum (int) - the residue number which the current atom id belongs to
  • next_resnum (int) - the residue number which the connected atom id belongs to
  • atom_id (int) - the atom id from which other connections are searched
  • next_atom_id (int) - one connected atom id

createEndSubFragment(self, cur_frag, dihe_3th_resnum, sub_backbone, dihe_4th_resnum, dihe_4th_atom_id, append_to_frag=None)

 

Create one child PolymerFragment or append atoms to append_to_frag.

Parameters:
  • cur_frag (PolymerFragment) - current polymer fragment
  • dihe_3th_resnum (int) - the resnum of the 3rd atom in dihedral
  • sub_backbone (list of int) - the backbone whose last atom (dihedral 3rd) will be connected to new fragment
  • dihe_4th_resnum (int) - a guess of the resnum of the 4th atom in res
  • dihe_4th_atom_id (int or None) - the 4th atom of dihedral, if int; None, if the 4th atom is in the adjacent res
  • append_to_frag (PolymerFragment or None) - if None, the found 'branching' is new polymer fragment, and new PolymerFragment is created with dihedral_4th_atom. if not None, the found 'branching' is part of the old polymer fragment and no new PolymerFragment is created. Add dihedral_4th_atom to old polymer fragment.
Returns: PolymerFragment or None
the newly created PolymerFragment, or None if atoms are appended to append_to_frag fragment

addBranchingAtoms(self, cur_frag)

 

Append extra dihedral 4th atoms for branching. Add to the parent of cur_frag instead of cur_frag, if the current fragment and new branch share the 1st, 2nd, and 3rd atoms in a dihedral angle.

Parameters:
  • cur_frag (PolymerFragment) - branching points will be added to the this fragment

resBackbone(self, resnum, atom_id)

 

Given residue number and starting atom id, return the short backbone path (from the starting atom id to the end) and set head/tail using dictionary.

Parameters:
  • resnum (int) - the residue number
  • atom_id (int) - backbone path starts from this atom id
Returns: list of int
the atom ids of backbone from atom_id to the other end

continueResBackbone(self, polymer, atom_id)

 

Return rest of the backbone path continuing from the atom_id.

Parameters:
Returns: list, int
the atom ids of backbone from atom_id to the other end, the index of current atom in the backbone

bondedAtomIdInSameRes(self, atom_id)

 

Find the atom id of a neighbor atom within the same residue.

Parameters:
  • atom_id (int) - atom id
Returns: int or None
the atom id of a neighbor atom in the same residue

getDelNextResnumByAtomID(self, atom_id)

 

Given atom id, find all the connected residues and atoms. Delete the connectivity from current residue to next residue and the connectivity from next residue to current residue.

Parameters:
  • atom_id (int) - the atom id from which all connections are returned
  • del_connection (bool) - del the connection from current atom and residue to the connected atom and residue
Returns: iterator to generate int, [int, int]
the connected residue number, [atom id, connected atom id]

addStructProperties(self)

 

Copy and add additional properties to moiety_structs to pass the validations in Moieties. However, these properties are not used, since polymer is already built.

Parameters: