Host Guest Complex

  1. 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.

vertices

The vertices which make up the topology graph.

Type

tuple of Vertex

edges

The edges which make up the topology graph.

Type

tuple of Edge

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 of float, optional) – A direction vector which gets aligned with guest_target.

  • guest_target (tuple of float, 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 of float, 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 during construct().

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 of Molecule) – The BuildingBlock and ConstructedMolecule 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 the ConstructedMolecule.

Returns

Maps the building_blocks, to the Vertex objects in vertices they are placed on during construction. The dict has the form

building_block_vertices = {
    BuildingBlock(...): [Vertex(...), Vertex(...)],
    BuildingBlock(...): [
        Vertex(...),
        Vertex(...),
        Vertex(...),
    ]
    ConstructedMolecule(...): [Vertex(...)]
}

Return type

dict

construct(self, mol)

Construct a ConstructedMolecule.

Parameters

mol (ConstructedMolecule) – The ConstructedMolecule instance which needs to be constructed.

Returns

None

Return type

NoneType