Organic Cage

For usage examples see Cage.

  1. TwoPlusThree

  2. FourPlusSix

  3. FourPlusSix2

  4. SixPlusNine

  5. EightPlusTwelve

  6. TwentyPlusThirty

  7. TwoPlusFour

  8. ThreePlusSix

  9. FourPlusEight

  10. FivePlusTen

  11. SixPlusTwelve

  12. EightPlusSixteen

  13. TenPlusTwenty

  14. SixPlusEight

  15. OnePlusOne

  16. TwoPlusTwo

  17. FourPlusFour

  18. TwelvePlusThirty

class Cage(vertex_alignments=None, num_processes=1)

Bases: stk.molecular.topology_graphs.topology_graph.TopologyGraph

Represents a cage topology graph.

Cage topologies are added by creating a subclass which defines the vertex_data and edge_data class attributes.

A Cage subclass will add the attributes num_windows and num_window_types to each ConstructedMolecule.

vertex_data

A class attribute. Holds the data of the vertices which make up the topology graph.

Type

tuple of VertexData

edge_data

A class attribute. Holds the data of the edges which make up the topology graph.

Type

tuple of EdgeData

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

Cage instances can be made without supplying additional arguments (using FourPlusSix as an example)

import stk

bb1 = stk.BuildingBlock('NCCN', ['amine'])
bb2 = stk.BuildingBlock('O=CC(C=O)C=O', ['aldehyde'])
cage1 = stk.ConstructedMolecule(
    building_blocks=[bb1, bb2],
    topology_graph=stk.cage.FourPlusSix()
)

Different structural isomers of cages can be made by using the vertex_alignments optional parameter

tetrahedron = stk.cage.FourPlusSix(
    vertex_alignments={0: 1, 1: 1, 2: 2}
)
cage2 = stk.ConstructedMolecule(
    building_blocks=[bb1, bb2],
    topology_graph=tetrahedron
)

The parameter maps the id of a vertex to a number between 0 (inclusive) and the number of edges the vertex is connected to (exclusive). So a vertex connected to three edges can be mapped to 0, 1 or 2.

By changing which edge each vertex is aligned with, a different structural isomer of the cage can be formed.

You can also build cages with multiple building blocks, but you have to assign each building block to a vertex with building_block_vertices.

bb1 = stk.BuildingBlock(‘O=CC(C=O)C=O’, [‘aldehyde’]) bb2 = stk.BuildingBlock(‘O=CC(Cl)(C=O)C=O’, [‘aldehyde’]) bb3 = stk.BuildingBlock(‘NCCN’, [‘amine’]) bb4 = stk.BuildingBlock(‘NCC(Cl)N’, [‘amine’]) bb5 = stk.BuildingBlock(‘NCCCCN’, [‘amine’])

tetrahedron = stk.cage.FourPlusSix() cage = stk.ConstructedMolecule(

building_blocks=[bb1, bb2, bb3, bb4, bb5], topology_graph=tetrahedron, building_block_vertices={

bb1: tetrahedron.vertices[:2], bb2: tetrahedron.vertices[2:4], bb3: tetrahedron.vertices[4:5], bb4: tetrahedron.vertices[5:6], bb5: tetrahedron.vertices[6:]

}

)

Methods

assign_building_blocks_to_vertices(self, …)

Assign building_blocks to vertices.

construct(self, mol)

Construct a ConstructedMolecule.

__init__(self, vertex_alignments=None, num_processes=1)

Initialize a Cage.

Parameters
  • vertex_alignments (dict, optional) – A mapping from the Vertex.id of a Vertex vertices to an Edge connected to it. The Edge is used to align the first FunctionalGroup of a BuildingBlock placed on that vertex. Only vertices which need to have their default edge changed need to be present in the dict. If None then the default edge is used for each vertex. Changing which Edge is used will mean that the topology graph represents different structural isomers. The edge is refered to by a number between 0 (inclusive) and the number of edges the vertex is connected to (exclusive).

  • num_processes (int, optional) – The number of parallel processes to create during construct().

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

Raises

ValueError – If there is more than one building with a given number of functional groups.

construct(self, mol)

Construct a ConstructedMolecule.

Parameters

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

Returns

None

Return type

NoneType