Building Polyphenylene#
In this tutorial we will build the first reported dendrimer polyphenylene By Mullen et al.

“Single-Crystal Structures of Polyphenylene Dendrimers”. Chemistry: A European Journal. 8 (17): 3858–3864. 2002. doi:10.1002/1521-3765(20020902)8:17<3858::AID-CHEM3858>3.0.CO;2-5.
We can generate the entire structure using benzene fragments. Because there are many fragments connecting to the same residues, we can automate some of the process using for-loops to make our life just a little bit easier. So let’s get started!
[19]:
import plotly
plotly.offline.init_notebook_mode()
[20]:
import biobuild as bb
First let’s get the benzene
[21]:
bb.load_small_molecules()
[22]:
benzene = bb.get_compound("benzene")
# don't worry about the skewed visuals
# (that's because there are miniscule difference in the z-axis, < 1e-2A)
benzene.show()
We can start by generating the peripheral multi-rings by attaching five benzenes to one in the middle. We could for instance do something like this:
[23]:
# set up the linkage instructions
link = bb.linkage("C1", "C1")
# start with the centrla benzene ring
periphery = benzene.copy()
for carbon in range(1, 6):
# update the linkage to the next carbon
link.atom1 = f"C{carbon}"
# attach one benzene to the central one
periphery.attach(benzene, link, at_residue=1)
periphery.show()
Now that we have the periphery we can use the same setup to attach peripheries to one central benzene ring…
[24]:
# setup a new linkage
link2 = bb.linkage("C1", "C4")
# set a new attach residue for the periphery (now it's the second residue)
periphery.set_attach_residue(2)
# now make the central core
core = benzene.copy()
# and attach the periphery to the core
for carbon in core.get_atoms("C", by="element"):
link2.atom1 = carbon.id
core.attach(periphery, link2, at_residue=1)
core.show()
Now that looks fancy! But it is quite cramped still. So let’s optimize the structure.
[38]:
graph = core.get_atom_graph()
edges = core.get_residue_connections()
edges = graph.direct_edges(graph.central_node, edges)
env = bb.optimizers.DistanceRotatron(graph, edges)
[40]:
core_opt = bb.optimizers.optimize(core.copy(), env, "swarm")
[41]:
core_opt.show()
Now that looks better! Let’s save it to a PDB file.
[42]:
core_opt.to_pdb("polyphenylene.pdb")