Host Guest Complex¶
-
class
Complex(guest_start=None, guest_target=None, displacement=None, num_processes=1)¶ Bases:
stk.molecular.topology_graphs.topology_graph.TopologyGraphRepresents a host-guest complex topology graph.
When using this topology graph, the host must be first in the building_blocks of the
ConstructedMoleculeand the guest must be second.Examples
import stk guest = stk.BuildingBlock('[Br][Br]') host = stk.ConstructedMolecule( building_blocks=[ stk.BuildingBlock('NCCN', ['amine']), stk.BuildingBlock('O=CC(C=O)C=O', ['aldehyde']) ], topology_graph=stk.cage.FourPlusSix() ) complex1 = stk.ConstructedMolecule( building_blocks=[host, guest], topology_graph=stk.host_guest.Complex() )
Change the position and orientation of the guest
complex2 = stk.ConstructedMolecule( building_blocks=[host, guest], topology_graph=stk.host_guest.Complex( # Apply a rotation onto the guest molecule such that # the vector returned by get_direction() has the same # direction as [1, 1, 1]. guest_start=guest.get_direction(), guest_target=[1, 1, 1], displacement=[5.3, 2.1, 7.1] ) )
Methods
assign_building_blocks_to_vertices(self, …)Assign building_blocks to
vertices.construct(self, mol)Construct a
ConstructedMolecule.-
__init__(self, guest_start=None, guest_target=None, displacement=None, num_processes=1)¶ Initialize an instance of
Complex.- Parameters
guest_start (
tupleoffloat, optional) – A direction vector which gets aligned with guest_target.guest_target (
tupleoffloat, optional) – A direction vector which determines the rotation applied to the guest building block. A rotation such that guest_start is transformed into guest_target is applied to the guest building block.displacement (
listoffloat, optional) – The translational offset of the guest from the center of the host cavity.num_processes (
int, optional) – The number of parallel processes to create duringconstruct().
- Raises
TypeError – If guest_start or guest_target is defined but the other is not.
-
assign_building_blocks_to_vertices(self, building_blocks)¶ Assign building_blocks to
vertices.- Parameters
building_blocks (
listofMolecule) – TheBuildingBlockandConstructedMoleculeinstances which represent the building block molecules used for construction. Only one instance is present per building block molecule, even if multiples of that building block join up to form theConstructedMolecule.- Returns
Maps the building_blocks, to the
Vertexobjects inverticesthey are placed on during construction. Thedicthas the formbuilding_block_vertices = { BuildingBlock(...): [Vertex(...), Vertex(...)], BuildingBlock(...): [ Vertex(...), Vertex(...), Vertex(...), ] ConstructedMolecule(...): [Vertex(...)] }
- Return type
dict
-
construct(self, mol)¶ Construct a
ConstructedMolecule.- Parameters
mol (
ConstructedMolecule) – TheConstructedMoleculeinstance which needs to be constructed.- Returns
None
- Return type
NoneType
-