Host Guest Complex¶
-
class
Complex
(guest_start=None, guest_target=None, displacement=None, num_processes=1)¶ Bases:
stk.molecular.topology_graphs.topology_graph.TopologyGraph
Represents a host-guest complex topology graph.
When using this topology graph, the host must be first in the building_blocks of the
ConstructedMolecule
and 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 (
tuple
offloat
, optional) – A direction vector which gets aligned with guest_target.guest_target (
tuple
offloat
, 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 (
list
offloat
, 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 (
list
ofMolecule
) – TheBuildingBlock
andConstructedMolecule
instances 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
Vertex
objects invertices
they are placed on during construction. Thedict
has 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
) – TheConstructedMolecule
instance which needs to be constructed.- Returns
None
- Return type
NoneType
-