-
Notifications
You must be signed in to change notification settings - Fork 4
05_Building_a_Polymer
5.1 Growing Blocks
Growing a building block involves adding a fragment to an existing block in the cell. This is done with the growBlocks command:
mycell.growBlocks( 10, cellEndGroups=['A:a'], libraryEndGroups=['B:a'], dihedral=90, maxTries=500 )
The arguments to the growBlocks argument are as follows:
- toGrow: Specifies the number of blocks to add.
- cellEndGroups: A list of the endGroup types in the cell that the new
blocks will be bonded to. If more than one endGroup type is supplied, the endGroup will be randomly chosen from that list.
- libraryEndGroups: A list of the endGroup types from the library that
will be used to form the bonds. If more than one endGroup type is supplied, the endGroup will be randomly chosen from that list.
- dihedral: The dihedral angle about the bond (given in the third column
in the .csv file).
- maxTries: The maximum number of attempts to make before giving up on
growing the block.
5.2 Joining Blocks
The joinBlocks command is used to join existing blocks in the cell together:
mycell.joinBlocks( 10, cellEndGroups=['A:a','B:a'], dihedral=90, maxTries=500 )
This will randomly select two blocks (with endGroups specified in the list supplied to cellEndGroups, or just two random blocks if cellEndGroups is expressed as ‘None’) and attempt to bond them by removing the second block from the cell and attaching it to the first. If the bond fails (for example, due to clashes), the second block will be returned to its original position.
The arguments required for the joinBlocks command are:
- toJoin: The number of blocks to join.
- cellEndGroups: A list of the different endGroup types that should be
bonded. If this is expressed as ‘None’, endGroups will be chosen at random.
- dihedral: The dihedral angle about the bond (given in the third column
in the .csv file).
- maxTries: The maximum number of moves to try when joining two blocks.
5.3 Zipping Blocks
The zipBlocks command joins existing building blocks in the cell by changing the bondMargin and bondAngleMargin parameters that were specified when the cell was created, and then looping over all the free endGroups to see if any more can bond with the new parameters (Figure 6). The blocks remain stationary in this step, unlike in the joinBlocks argument.

The zipBlocks command is expressed as:
zipBlocks(bondMargin=5, bondAngleMargin=30, clashTest=True, clashDist=1.6)
The zipBlocks argument looks for capAtoms that are within a cone constructed from the bond vector between the endGroup and capAtom. In the case of the example above, the cone will be of length 5 Å and angle 30°.
The variables in the zipBlocks argument are:
- bondMargin: The new bond margin, given in angstroms.
- bondAngleMargin: The new bond angle margin, given in degrees.
- clashCheck: This is a True or False check for clashes between the bond
and any atoms that fall within a cylinder of radius clashDist (default = 1.6 Å), centred on the bond axis.
- clashDist: A float specifying the perpendicular distance from the bond
axis that determines if an atom is clashing with the bond. clashDist must be smaller than the cell size to ensure that the atom is visible.
- selfBond: This is a True or False check that asks whether or not a
block should be allowed to bond to itself, with a default of True.
The essential arguments to zipBlocks are bondMargin and bondAngleMargin. The remaining variables are optional to this command.
If the bonds appear “stretched” in the resulting polymer, the zip distance should be reduced. This will prevent bonds forming between endGroups that are too far apart for the bond to be realistic.
5.4 Updating Blocks
Blocks can be updated within the cell.
updateFragmentCharges will update the charges on all of the fragments of a given fragmentType within the cell.
This does not change the 'parent' fragment within the cell library so seeding/growing more of the fragments will use the original charges. The arguments to updateFragmentCharges are:
- fragmentType: the fragmentType to update the charges for
- filename: path to a CAR file with all the charges for the fragmentType specified
Once the cell has been filled with blocks, it is possible to either optimise the geometry of the cell contents or run a molecular dynamics simulation.