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

Class PolymerBuilderGrowInCellMixin

object --+
         |
        PolymerBuilderGrowInCellMixin

A mixin for classes that uses in-cell polymer grow method.

Instance Methods [hide private]
 
setRingsForOneMol(self, new_init_frag, ringnum)
Create _Ring objects for each fragment in one molecule.
bool
placeOneIniInCell(self, frag, new_chain=True)
Place a new or dead chain fragment containing initiator into the cell.
schrodinger.structure.Structure or None
buildCellNoWrap(self, num_structs, density, avdw_scale)
Make a single attempt at building the cell.
bool
relocate_failed_mol(self, pre_frag, frags_in_one_mol, tried_per_mol)
Place one failed molecule back into the cell.
list
get_dihe_values(self)
Get the possbile dihedral values of current fragment.
bool
has_clashes(self)
Check whether current fragment has clashes and speared rings with pre-existing structure.
 
remove_finished_polymer(self, frags_by_mol, tried_per_mol)
Remove frags_by_mols that have no polymer fragments and update finished polymer number.
 
bitSetOn(self, bitset, frag)
Set the bitset on according to the atom ids in fragments; record rings according to rings in fragments.
 
bitSetOff(self, bitset, frag)
Set the bitset off according to the atom ids in fragments; remove rings according to rings in fragments.
schrodinger.structure.Structure
getBuildingBlock(self)
Get the one single polymer from polymer buider.
iterator of list
getPosition(self, new_chain)
Find random positions in the cell according to the following rules.
iterator of list
getIniFragPosition(self, max_num=10000, max_failed_num=10000)
Return a random point in the space and no other initiators and scaffold within a pre-defined raduis.
 
deleteOtherBranches(self, pre_frag, frags_in_one_mol)
Remove the fragments from the next_frags pool and set off the bitset of moved fragments.
 
placeAllStructsInCell(self)
Place a number of copies of the structure into the cell.
 
preparePbcAndParams(self, avdw_scale)
Prepare pbc and contact parameters.
structure.structureinteraction.AtomPairWithValueList, Bitset
getContactAndBitset(self, frag)
Calculate the bitset of current fragment and the contact of the atoms in fragment with pre-exsiting atoms in the cell.
structure.structureinteraction.AtomPairWithValueList
getContact(self, bitset2)
Calculate contact the atoms in fragment with pre-exsiting atoms in the cell.
 
prepareBuildingBlocksForGrow(self)
Create moieties from polymer residues.

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setRingsForOneMol(self, new_init_frag, ringnum)

 

Create _Ring objects for each fragment in one molecule.

Parameters:
  • new_init_frag (PolymerFragment) - the first fragment containing initiator
  • ringnum (int) - the total number of rings of all molecules in cell

placeOneIniInCell(self, frag, new_chain=True)

 

Place a new or dead chain fragment containing initiator into the cell. If new_chain=True, randomly pick a position in cell; make sure the position is away from pre-existing initiators; check contact of the newly added fragments against all pre-existing atoms. If contact exists, randomly pick anothor position. If new_chain=False, find a random position in the largest void in cell; check contact; if contact exists, loop over all the gridded positions in the largest void.

Parameters:
  • frag (PolymerFragment) - the first fragment containing initiator
  • new_chain (bool) - if True, the fragment is from a new chain; else, the fragment is from a dead chain.
Returns: bool
True, if the initiator fragment is successfully placed in cell

buildCellNoWrap(self, num_structs, density, avdw_scale)

 

Make a single attempt at building the cell. Create the structures and try to place them.

Parameters:
  • num_structs (int) - The number of structures to put into the cell
  • density (float) - The density of the cell
  • avdw_scale (float) - The VDW scale factor for clash cutoffs
Returns: schrodinger.structure.Structure or None
The built cell, or None if an error occurred

relocate_failed_mol(self, pre_frag, frags_in_one_mol, tried_per_mol)

 

Place one failed molecule back into the cell.

Parameters:
  • pre_frag ({PolymerFragment}) - the ini fragment of one polymer
  • frags_in_one_mol (list of {PolymerFragment}) - polymer fragment of this polymer within one polymer
  • tried_per_mol (int) - failed trial number
Returns: bool
True, if successfully placed the ini fragment back

get_dihe_values(self)

 

Get the possbile dihedral values of current fragment.

Returns: list
all polymer dihedral vaules

has_clashes(self)

 

Check whether current fragment has clashes and speared rings with pre-existing structure.

Returns: bool
True, if has clashes

remove_finished_polymer(self, frags_by_mol, tried_per_mol)

 

Remove frags_by_mols that have no polymer fragments and update finished polymer number.

Parameters:
  • frags_by_mol (list of list) - each sublist contains polymer fragments within one polymer
  • tried_per_mol (int) - number of failed attempts of whole molecule

bitSetOn(self, bitset, frag)

 

Set the bitset on according to the atom ids in fragments; record rings according to rings in fragments.

Parameters:
  • bitset (Bitset) - the bitset to set
  • frag (PolymerFragment) - the polymer fragment providing the atom ids

bitSetOff(self, bitset, frag)

 

Set the bitset off according to the atom ids in fragments; remove rings according to rings in fragments.

Parameters:
  • bitset (Bitset) - the bitset to set
  • frag (PolymerFragment) - the polymer fragment providing the atom ids

getBuildingBlock(self)

 

Get the one single polymer from polymer buider.

Returns: schrodinger.structure.Structure
the polymer to place into the cell

getPosition(self, new_chain)

 

Find random positions in the cell according to the following rules. If new_chain=True, randomly pick a position in cell that is away from pre-existing initiators. If new_chain=False, randomly loop over all the gridded positions in the largest void in cell.

Parameters:
  • new_chain (bool) - if True, the fragment is from a new chain; else, the fragment is from a dead chain.
Returns: iterator of list
iterator of [x, y, z], a random position in cell

getIniFragPosition(self, max_num=10000, max_failed_num=10000)

 

Return a random point in the space and no other initiators and scaffold within a pre-defined raduis.

Parameters:
  • max_num (int) - max number of xyz position returned
  • max_failed_num (int) - max number of attemps when finding points self.r_per_ini_frag away from scaffold and other initiator atoms.
Returns: iterator of list
iterator of [x, y, z], a random position in cell

deleteOtherBranches(self, pre_frag, frags_in_one_mol)

 

Remove the fragments from the next_frags pool and set off the bitset of moved fragments.

Parameters:
  • pre_frag (PolymerFragment) - the branching parent polymer fragment
  • frags_in_one_mol (list of PolymerFragment) - the pool of PolymerFragment to be grown

placeAllStructsInCell(self)

 

Place a number of copies of the structure into the cell.

Parameters:

preparePbcAndParams(self, avdw_scale)

 

Prepare pbc and contact parameters.

Parameters:
  • avdw_scale (float) - The VDW scale factor for clash cutoffs

getContactAndBitset(self, frag)

 

Calculate the bitset of current fragment and the contact of the atoms in fragment with pre-exsiting atoms in the cell.

Parameters:
  • frag (Polymerfragment) - The polymer fragment to get atom ids from
Returns: structure.structureinteraction.AtomPairWithValueList, Bitset
close contact between atoms in fragment and pre-existing atom in cell, bitset with atoms in fragment on

getContact(self, bitset2)

 

Calculate contact the atoms in fragment with pre-exsiting atoms in the cell.

Parameters:
  • bitset (Bitset) - the bitset of the atoms in newly added fragment
Returns: structure.structureinteraction.AtomPairWithValueList
close contact between atoms in fragment and pre-existing atom in cell