Can I handle BuildingBlock during ConstructedMolecule process? #452
-
Hi, thanks a lot for your excellent tutorial for stk. Because some buildingblocks are asymmetrical, I want to rotate them during construction to list all the possibilities. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hey @KeDUCK00 , welcome and thank you! So, the main way to do this in stk is to set the import stk
bb1 = stk.BuildingBlock('NCCN', [stk.PrimaryAminoFactory()])
bb2 = stk.BuildingBlock(
smiles='O=CC(C=O)C=O',
functional_groups=[stk.AldehydeFactory()],
)
cage = stk.ConstructedMolecule(
topology_graph=stk.cage.FourPlusSix(
building_blocks=(bb1, bb2),
vertex_alignments={0: 1, 1: 1, 2: 2},
),
) In this instance, you are changing the orientation of the 0th, 1st and 2nd building blocks in this topology. You can change the values here to any number associated with any functional group in your building blocks. Lines 171 to 176 in this file https://github.com/andrewtarzia/unsymm_match/blob/master/cage_building.py shows how to do this to build 4 distinct isomers of Pd2L4 cages in my recent paper. Basically, the process I take is to start from the default orientations, then change one "vertex_alignment" value at a time and check the structure until you get the desired isomer. There is currently no way to know in advance what orientation you will get because it depends on the order of the functional groups in the building blocks and the order of vertices in the topology graph. Hope this helps, please let us know! |
Beta Was this translation helpful? Give feedback.
Hey @KeDUCK00 , welcome and thank you!
So, the main way to do this in stk is to set the
vertex_alignments
argument when initialising a topology graph, like in this example (in https://stk.readthedocs.io/en/stable/stk.molecular.topology_graphs.cage.cage.html):In this instance, you are changing the orientation of the 0th, 1st and 2nd building blocks in this…